Documentation

Std.Data.Sum.Lemmas

Disjoint union of types #

Theorems about the definitions introduced in Std.Data.Sum.Basic.

@[simp]
theorem Sum.forall {α : Type u_1} {β : Type u_2} {p : α ⊕ β → Prop} :
(∀ (x : α ⊕ β), p x) ↔ (∀ (a : α), p (Sum.inl a)) ∧ ∀ (b : β), p (Sum.inr b)
@[simp]
theorem Sum.exists {α : Type u_1} {β : Type u_2} {p : α ⊕ β → Prop} :
(∃ (x : α ⊕ β), p x) ↔ (∃ (a : α), p (Sum.inl a)) ∨ ∃ (b : β), p (Sum.inr b)
theorem Sum.forall_sum {α : Type u_1} {β : Type u_2} {γ : α ⊕ β → Sort u_3} (p : ((ab : α ⊕ β) → γ ab) → Prop) :
(∀ (fab : (ab : α ⊕ β) → γ ab), p fab) ↔ ∀ (fa : (val : α) → γ (Sum.inl val)) (fb : (val : β) → γ (Sum.inr val)), p fun (t : α ⊕ β) => Sum.rec fa fb t
@[simp]
theorem Sum.inl_getLeft {α : Type u_1} {β : Type u_2} (x : α ⊕ β) (h : Sum.isLeft x = true) :
@[simp]
theorem Sum.inr_getRight {α : Type u_1} {β : Type u_2} (x : α ⊕ β) (h : Sum.isRight x = true) :
@[simp]
theorem Sum.getLeft?_eq_none_iff {α : Type u_1} {β : Type u_2} {x : α ⊕ β} :
@[simp]
theorem Sum.getRight?_eq_none_iff {α : Type u_1} {β : Type u_2} {x : α ⊕ β} :
theorem Sum.eq_left_getLeft_of_isLeft {α : Type u_1} {β : Type u_2} {x : α ⊕ β} (h : Sum.isLeft x = true) :
@[simp]
theorem Sum.getLeft_eq_iff :
∀ {α : Type u_1} {a : α} {β : Type u_2} {x : α ⊕ β} (h : Sum.isLeft x = true), Sum.getLeft x h = a ↔ x = Sum.inl a
theorem Sum.eq_right_getRight_of_isRight {α : Type u_1} {β : Type u_2} {x : α ⊕ β} (h : Sum.isRight x = true) :
@[simp]
theorem Sum.getRight_eq_iff :
∀ {β : Type u_1} {b : β} {α : Type u_2} {x : α ⊕ β} (h : Sum.isRight x = true), Sum.getRight x h = b ↔ x = Sum.inr b
@[simp]
theorem Sum.getLeft?_eq_some_iff :
∀ {α : Type u_1} {a : α} {β : Type u_2} {x : α ⊕ β}, Sum.getLeft? x = some a ↔ x = Sum.inl a
@[simp]
theorem Sum.getRight?_eq_some_iff :
∀ {β : Type u_1} {b : β} {α : Type u_2} {x : α ⊕ β}, Sum.getRight? x = some b ↔ x = Sum.inr b
@[simp]
theorem Sum.bnot_isLeft {α : Type u_1} {β : Type u_2} (x : α ⊕ β) :
@[simp]
theorem Sum.isLeft_eq_false {α : Type u_1} {β : Type u_2} {x : α ⊕ β} :
theorem Sum.not_isLeft {α : Type u_1} {β : Type u_2} {x : α ⊕ β} :
@[simp]
theorem Sum.bnot_isRight {α : Type u_1} {β : Type u_2} (x : α ⊕ β) :
@[simp]
theorem Sum.isRight_eq_false {α : Type u_1} {β : Type u_2} {x : α ⊕ β} :
theorem Sum.not_isRight {α : Type u_1} {β : Type u_2} {x : α ⊕ β} :
theorem Sum.isLeft_iff :
∀ {α : Type u_1} {β : Type u_2} {x : α ⊕ β}, Sum.isLeft x = true ↔ ∃ (y : α), x = Sum.inl y
theorem Sum.isRight_iff :
∀ {α : Type u_1} {β : Type u_2} {x : α ⊕ β}, Sum.isRight x = true ↔ ∃ (y : β), x = Sum.inr y
theorem Sum.inl.inj_iff {α : Type u_1} {β : Type u_2} {a : α} {b : α} :
theorem Sum.inr.inj_iff {α : Type u_1} {β : Type u_2} {a : β} {b : β} :
theorem Sum.inl_ne_inr :
∀ {α : Type u_1} {a : α} {β : Type u_2} {b : β}, Sum.inl a ≠ Sum.inr b
theorem Sum.inr_ne_inl :
∀ {β : Type u_1} {b : β} {α : Type u_2} {a : α}, Sum.inr b ≠ Sum.inl a

Sum.elim #

@[simp]
theorem Sum.elim_comp_inl {α : Type u_1} {γ : Sort u_2} {β : Type u_3} (f : α → γ) (g : β → γ) :
Sum.elim f g ∘ Sum.inl = f
@[simp]
theorem Sum.elim_comp_inr {α : Type u_1} {γ : Sort u_2} {β : Type u_3} (f : α → γ) (g : β → γ) :
Sum.elim f g ∘ Sum.inr = g
@[simp]
theorem Sum.elim_inl_inr {α : Type u_1} {β : Type u_2} :
Sum.elim Sum.inl Sum.inr = id
theorem Sum.comp_elim {γ : Sort u_1} {δ : Sort u_2} {α : Type u_3} {β : Type u_4} (f : γ → δ) (g : α → γ) (h : β → γ) :
f ∘ Sum.elim g h = Sum.elim (f ∘ g) (f ∘ h)
@[simp]
theorem Sum.elim_comp_inl_inr {α : Type u_1} {β : Type u_2} {γ : Sort u_3} (f : α ⊕ β → γ) :
Sum.elim (f ∘ Sum.inl) (f ∘ Sum.inr) = f
theorem Sum.elim_eq_iff {α : Type u_1} {γ : Sort u_2} {β : Type u_3} {u : α → γ} {u' : α → γ} {v : β → γ} {v' : β → γ} :
Sum.elim u v = Sum.elim u' v' ↔ u = u' ∧ v = v'

Sum.map #

@[simp]
theorem Sum.map_map {α' : Type u_1} {α'' : Type u_2} {β' : Type u_3} {β'' : Type u_4} {α : Type u_5} {β : Type u_6} (f' : α' → α'') (g' : β' → β'') (f : α → α') (g : β → β') (x : α ⊕ β) :
Sum.map f' g' (Sum.map f g x) = Sum.map (f' ∘ f) (g' ∘ g) x
@[simp]
theorem Sum.map_comp_map {α' : Type u_1} {α'' : Type u_2} {β' : Type u_3} {β'' : Type u_4} {α : Type u_5} {β : Type u_6} (f' : α' → α'') (g' : β' → β'') (f : α → α') (g : β → β') :
Sum.map f' g' ∘ Sum.map f g = Sum.map (f' ∘ f) (g' ∘ g)
@[simp]
theorem Sum.map_id_id {α : Type u_1} {β : Type u_2} :
Sum.map id id = id
theorem Sum.elim_map {α : Type u_1} {β : Type u_2} {ε : Sort u_3} {γ : Type u_4} {δ : Type u_5} {f₁ : α → β} {f₂ : β → ε} {g₁ : γ → δ} {g₂ : δ → ε} {x : α ⊕ γ} :
Sum.elim f₂ g₂ (Sum.map f₁ g₁ x) = Sum.elim (f₂ ∘ f₁) (g₂ ∘ g₁) x
theorem Sum.elim_comp_map {α : Type u_1} {β : Type u_2} {ε : Sort u_3} {γ : Type u_4} {δ : Type u_5} {f₁ : α → β} {f₂ : β → ε} {g₁ : γ → δ} {g₂ : δ → ε} :
Sum.elim f₂ g₂ ∘ Sum.map f₁ g₁ = Sum.elim (f₂ ∘ f₁) (g₂ ∘ g₁)
@[simp]
theorem Sum.isLeft_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
@[simp]
theorem Sum.isRight_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
@[simp]
theorem Sum.getLeft?_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
@[simp]
theorem Sum.getRight?_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (x : α ⊕ γ) :

Sum.swap #

@[simp]
theorem Sum.swap_swap {α : Type u_1} {β : Type u_2} (x : α ⊕ β) :
@[simp]
theorem Sum.swap_swap_eq {α : Type u_1} {β : Type u_2} :
Sum.swap ∘ Sum.swap = id
@[simp]
theorem Sum.isLeft_swap {α : Type u_1} {β : Type u_2} (x : α ⊕ β) :
@[simp]
theorem Sum.isRight_swap {α : Type u_1} {β : Type u_2} (x : α ⊕ β) :
@[simp]
theorem Sum.getLeft?_swap {α : Type u_1} {β : Type u_2} (x : α ⊕ β) :
@[simp]
theorem Sum.getRight?_swap {α : Type u_1} {β : Type u_2} (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
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 (Sum.swap x) (Sum.swap y)
@[simp]
theorem Sum.liftRel_swap_iff :
∀ {β : Type u_1} {β_1 : Type u_2} {s : β → β_1 → Prop} {α : Type u_3} {α_1 : Type u_4} {r : α → α_1 → Prop} {x : α ⊕ β} {y : α_1 ⊕ β_1}, Sum.LiftRel s r (Sum.swap x) (Sum.swap y) ↔ Sum.LiftRel r s x y
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.mono :
∀ {α : Type u_1} {r₁ r₂ : α → α → Prop} {β : Type u_2} {s₁ s₂ : β → β → Prop} {x y : α ⊕ β}, (∀ (a b : α), r₁ a b → r₂ a b) → (∀ (a b : β), s₁ a b → s₂ a b) → Sum.Lex r₁ s₁ x y → Sum.Lex r₂ s₂ x y
theorem Sum.Lex.mono_left :
∀ {α : Type u_1} {r₁ r₂ : α → α → Prop} {β : Type u_2} {s : β → β → Prop} {x y : α ⊕ β}, (∀ (a b : α), r₁ a b → r₂ a b) → Sum.Lex r₁ s x y → Sum.Lex r₂ s x y
theorem Sum.Lex.mono_right :
∀ {β : Type u_1} {s₁ s₂ : β → β → Prop} {α : Type u_2} {r : α → α → Prop} {x y : α ⊕ β}, (∀ (a b : β), s₁ a b → s₂ a b) → Sum.Lex r s₁ x y → Sum.Lex r s₂ x y
theorem Sum.lex_acc_inl :
∀ {α : Type u_1} {r : α → α → Prop} {a : α} {β : Type u_2} {s : β → β → Prop}, Acc r a → Acc (Sum.Lex r s) (Sum.inl a)
theorem Sum.lex_acc_inr :
∀ {α : Type u_1} {r : α → α → Prop} {β : Type u_2} {s : β → β → Prop}, (∀ (a : α), Acc (Sum.Lex r s) (Sum.inl a)) → ∀ {b : β}, Acc s b → Acc (Sum.Lex r s) (Sum.inr b)
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 : γ) :
@[simp]
theorem Sum.elim_lam_const_lam_const {γ : Sort u_1} {α : Type u_2} {β : Type u_3} (c : γ) :
(Sum.elim (fun (x : α) => c) fun (x : β) => c) = fun (x : α ⊕ β) => c