Disjoint union of types #
Theorems about the definitions introduced in Batteries.Data.Sum.Basic
.
@[simp]
theorem
Sum.getLeft?_map
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → β)
(g : γ → δ)
(x : α ⊕ γ)
:
(Sum.map f g x).getLeft? = Option.map f x.getLeft?
@[simp]
theorem
Sum.getRight?_map
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → β)
(g : γ → δ)
(x : α ⊕ γ)
:
(Sum.map f g x).getRight? = Option.map g x.getRight?
theorem
Sum.LiftRel.mono :
∀ {α : Type u_1} {α_1 : Type u_2} {r₁ r₂ : α → α_1 → Prop} {β : Type u_3} {β_1 : Type u_4} {s₁ s₂ : β → β_1 → Prop}
{x : α ⊕ β} {y : α_1 ⊕ β_1},
(∀ (a : α) (b : α_1), r₁ a b → r₂ a b) →
(∀ (a : β) (b : β_1), s₁ a b → s₂ a b) → Sum.LiftRel r₁ s₁ x y → Sum.LiftRel r₂ s₂ x y
theorem
Sum.LiftRel.mono_left :
∀ {α : Type u_1} {α_1 : Type u_2} {r₁ r₂ : α → α_1 → Prop} {β : Type u_3} {β_1 : Type u_4} {s : β → β_1 → Prop}
{x : α ⊕ β} {y : α_1 ⊕ β_1}, (∀ (a : α) (b : α_1), r₁ a b → r₂ a b) → Sum.LiftRel r₁ s x y → Sum.LiftRel r₂ s x y
theorem
Sum.LiftRel.mono_right :
∀ {β : Type u_1} {β_1 : Type u_2} {s₁ s₂ : β → β_1 → Prop} {α : Type u_3} {α_1 : Type u_4} {r : α → α_1 → Prop}
{x : α ⊕ β} {y : α_1 ⊕ β_1}, (∀ (a : β) (b : β_1), s₁ a b → s₂ a b) → Sum.LiftRel r s₁ x y → Sum.LiftRel r s₂ x y
theorem
Sum.LiftRel.swap :
∀ {α : Type u_1} {α_1 : Type u_2} {r : α → α_1 → Prop} {β : Type u_3} {β_1 : Type u_4} {s : β → β_1 → Prop} {x : α ⊕ β}
{y : α_1 ⊕ β_1}, Sum.LiftRel r s x y → Sum.LiftRel s r x.swap y.swap
@[simp]
theorem
Sum.LiftRel.lex
{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{a : α ⊕ β}
{b : α ⊕ β}
(h : Sum.LiftRel r s a b)
:
Sum.Lex r s a b
theorem
Sum.liftRel_subrelation_lex :
∀ {α : Type u_1} {r : α → α → Prop} {β : Type u_2} {s : β → β → Prop}, Subrelation (Sum.LiftRel r s) (Sum.Lex r s)
theorem
Sum.lex_wf :
∀ {α : Type u_1} {r : α → α → Prop} {α_1 : Type u_2} {s : α_1 → α_1 → Prop},
WellFounded r → WellFounded s → WellFounded (Sum.Lex r s)
theorem
Sum.elim_const_const
{γ : Sort u_1}
{α : Type u_2}
{β : Type u_3}
(c : γ)
:
Sum.elim (Function.const α c) (Function.const β c) = Function.const (α ⊕ β) c