More theorems about the sum type
@[simp]
@[simp]
theorem
sum.elim_injective
{α : Type u_1}
{β : Type u_2}
{γ : Sort u_3}
{f : α → γ}
{g : β → γ}
(hf : function.injective f)
(hg : function.injective g)
(hfg : ∀ (a : α) (b : β), f a ≠ g b) :
function.injective (sum.elim f g)
inductive
sum.lex
{α : Type u}
{β : Type v}
(ra : α → α → Prop)
(rb : β → β → Prop)
(a a_1 : α ⊕ β) :
Prop
- inl : ∀ {α : Type u} {β : Type v} (ra : α → α → Prop) (rb : β → β → Prop) {a₁ a₂ : α}, ra a₁ a₂ → sum.lex ra rb (sum.inl a₁) (sum.inl a₂)
- inr : ∀ {α : Type u} {β : Type v} (ra : α → α → Prop) (rb : β → β → Prop) {b₁ b₂ : β}, rb b₁ b₂ → sum.lex ra rb (sum.inr b₁) (sum.inr b₂)
- sep : ∀ {α : Type u} {β : Type v} (ra : α → α → Prop) (rb : β → β → Prop) (a : α) (b : β), sum.lex ra rb (sum.inl a) (sum.inr b)
Lexicographic order for sum. Sort all the inl a
before the inr b
,
otherwise use the respective order on α
or β
.
theorem
sum.lex_wf
{α : Type u}
{β : Type v}
{ra : α → α → Prop}
{rb : β → β → Prop}
(ha : well_founded ra)
(hb : well_founded rb) :
well_founded (sum.lex ra rb)
@[simp]
@[simp]
theorem
function.injective.sum_map
{α : Type u}
{α' : Type w}
{β : Type v}
{β' : Type x}
{f : α → β}
{g : α' → β'}
(hf : function.injective f)
(hg : function.injective g) :
function.injective (sum.map f g)
theorem
function.surjective.sum_map
{α : Type u}
{α' : Type w}
{β : Type v}
{β' : Type x}
{f : α → β}
{g : α' → β'}
(hf : function.surjective f)
(hg : function.surjective g) :
function.surjective (sum.map f g)