Module docstring
{"# Disjoint union of types
This file defines basic operations on the the sum type α ⊕ β.
α ⊕ β is the type made of a copy of α and a copy of β. It is also called disjoint union.
Main declarations
Sum.isLeft: Returns whetherx : α ⊕ βcomes from the left component or not.Sum.isRight: Returns whetherx : α ⊕ βcomes from the right component or not.Sum.getLeft: Retrieves the left content of ax : α ⊕ βthat is known to come from the left.Sum.getRight: Retrieves the right content ofx : α ⊕ βthat is known to come from the right.Sum.getLeft?: Retrieves the left content ofx : α ⊕ βas an option type or returnsnoneif it's coming from the right.Sum.getRight?: Retrieves the right content ofx : α ⊕ βas an option type or returnsnoneif it's coming from the left.Sum.map: Mapsα ⊕ βtoγ ⊕ δcomponent-wise.Sum.elim: Nondependent eliminator/induction principle forα ⊕ β.Sum.swap: Mapsα ⊕ βtoβ ⊕ αby swapping components.Sum.LiftRel: The disjoint union of two relations.Sum.Lex: Lexicographic order onα ⊕ βinduced by a relation onαand a relation onβ.
Further material
See Init.Data.Sum.Lemmas for theorems about these definitions.
Notes
The definition of Sum takes values in Type _. This effectively forbids Prop- valued sum types.
To this effect, we have PSum, which takes value in Sort _ and carries a more complicated
universe signature in consequence. The Prop version is Or.
"}