Disjoint union of types #
Theorems about the definitions introduced in Std.Data.Sum.Basic
.
@[simp]
theorem
Sum.inl_getLeft
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
(h : Sum.isLeft x = true)
:
Sum.inl (Sum.getLeft x h) = x
@[simp]
theorem
Sum.inr_getRight
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
(h : Sum.isRight x = true)
:
Sum.inr (Sum.getRight x h) = x
@[simp]
theorem
Sum.getLeft?_eq_none_iff
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
:
Sum.getLeft? x = none ↔ Sum.isRight x = true
@[simp]
theorem
Sum.getRight?_eq_none_iff
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
:
Sum.getRight? x = none ↔ Sum.isLeft x = true
theorem
Sum.eq_left_getLeft_of_isLeft
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
(h : Sum.isLeft x = true)
:
x = Sum.inl (Sum.getLeft x h)
@[simp]
theorem
Sum.eq_right_getRight_of_isRight
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
(h : Sum.isRight x = true)
:
x = Sum.inr (Sum.getRight x h)
@[simp]
@[simp]
theorem
Sum.bnot_isLeft
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
:
(!decide (Sum.isLeft x = Sum.isRight x)) = true
@[simp]
theorem
Sum.isLeft_eq_false
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
:
Sum.isLeft x = false ↔ Sum.isRight x = true
theorem
Sum.not_isLeft
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
:
¬Sum.isLeft x = true ↔ Sum.isRight x = true
@[simp]
theorem
Sum.bnot_isRight
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
:
(!decide (Sum.isRight x = Sum.isLeft x)) = true
@[simp]
theorem
Sum.isRight_eq_false
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
:
Sum.isRight x = false ↔ Sum.isLeft x = true
theorem
Sum.not_isRight
{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
:
¬Sum.isRight x = true ↔ Sum.isLeft x = true
@[simp]
theorem
Sum.isLeft_map
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → β)
(g : γ → δ)
(x : α ⊕ γ)
:
Sum.isLeft (Sum.map f g x) = Sum.isLeft x
@[simp]
theorem
Sum.isRight_map
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → β)
(g : γ → δ)
(x : α ⊕ γ)
:
Sum.isRight (Sum.map f g x) = Sum.isRight x
@[simp]
theorem
Sum.getLeft?_map
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → β)
(g : γ → δ)
(x : α ⊕ γ)
:
Sum.getLeft? (Sum.map f g x) = Option.map f (Sum.getLeft? x)
@[simp]
theorem
Sum.getRight?_map
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → β)
(g : γ → δ)
(x : α ⊕ γ)
:
Sum.getRight? (Sum.map f g x) = Option.map g (Sum.getRight? x)
@[simp]
theorem
Sum.isLeft_swap
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
:
Sum.isLeft (Sum.swap x) = Sum.isRight x
@[simp]
theorem
Sum.isRight_swap
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
:
Sum.isRight (Sum.swap x) = Sum.isLeft x
@[simp]
theorem
Sum.getLeft?_swap
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
:
Sum.getLeft? (Sum.swap x) = Sum.getRight? x
@[simp]
theorem
Sum.getRight?_swap
{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
:
Sum.getRight? (Sum.swap x) = Sum.getLeft? x
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
@[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