File: Mathlib/Data/Sum/Basic.lean

full_name: Sum.exists_sum
code: theorem exists_sum {γ : α ⊕ β → Sort*} (p : (∀ ab, γ ab) → Prop) :
    (∃ fab, p fab) ↔ (∃ fa fb, p (Sum.rec fa fb)) 
goal: (∃ fab, p fab) ↔ ∃ fa fb, p fun t => Sum.rec fa fb t

full_name: Sum.inl_injective
code: theorem inl_injective : Function.Injective (inl : α → α ⊕ β) 
goal: Function.Injective Sum.inl

full_name: Sum.inr_injective
code: theorem inr_injective : Function.Injective (inr : β → α ⊕ β) 
goal: Function.Injective Sum.inr

full_name: Sum.sum_rec_congr
code: theorem sum_rec_congr (P : α ⊕ β → Sort*) (f : ∀ i, P (inl i)) (g : ∀ i, P (inr i))
    {x y : α ⊕ β} (h : x = y) :
    @Sum.rec _ _ _ f g x = cast (congr_arg P h.symm) (@Sum.rec _ _ _ f g y) 
goal: Sum.rec f g x = cast ⋯ (Sum.rec f g y)

full_name: Sum.eq_left_iff_getLeft_eq
code: theorem eq_left_iff_getLeft_eq {a : α} : x = inl a ↔ ∃ h, x.getLeft h = a 
goal: x = Sum.inl a ↔ ∃ h, x.getLeft h = a

full_name: Sum.eq_right_iff_getRight_eq
code: theorem eq_right_iff_getRight_eq {b : β} : x = inr b ↔ ∃ h, x.getRight h = b 
goal: x = Sum.inr b ↔ ∃ h, x.getRight h = b

full_name: Sum.getLeft_eq_getLeft?
code: theorem getLeft_eq_getLeft? (h₁ : x.isLeft) (h₂ : x.getLeft?.isSome) :
    x.getLeft h₁ = x.getLeft?.get h₂ 
goal: x.getLeft h₁ = x.getLeft?.get h₂

full_name: Sum.getRight_eq_getRight?
code: theorem getRight_eq_getRight? (h₁ : x.isRight) (h₂ : x.getRight?.isSome) :
    x.getRight h₁ = x.getRight?.get h₂ 
goal: x.getRight h₁ = x.getRight?.get h₂

full_name: Sum.isSome_getLeft?_iff_isLeft
code: @[simp] theorem isSome_getLeft?_iff_isLeft : x.getLeft?.isSome ↔ x.isLeft 
goal: x.getLeft?.isSome = true ↔ x.isLeft = true

full_name: Sum.isSome_getRight?_iff_isRight
code: @[simp] theorem isSome_getRight?_iff_isRight : x.getRight?.isSome ↔ x.isRight 
goal: x.getRight?.isSome = true ↔ x.isRight = true

full_name: Sum.update_elim_inl
code: @[simp]
theorem update_elim_inl [DecidableEq α] [DecidableEq (α ⊕ β)] {f : α → γ} {g : β → γ} {i : α}
    {x : γ} : update (Sum.elim f g) (inl i) x = Sum.elim (update f i x) g 
goal: Function.update (Sum.elim f g) (Sum.inl i) x = Sum.elim (Function.update f i x) g

full_name: Sum.update_elim_inr
code: @[simp]
theorem update_elim_inr [DecidableEq β] [DecidableEq (α ⊕ β)] {f : α → γ} {g : β → γ} {i : β}
    {x : γ} : update (Sum.elim f g) (inr i) x = Sum.elim f (update g i x) 
goal: Function.update (Sum.elim f g) (Sum.inr i) x = Sum.elim f (Function.update g i x)

full_name: Sum.update_inl_comp_inl
code: @[simp]
theorem update_inl_comp_inl [DecidableEq α] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α}
    {x : γ} : update f (inl i) x ∘ inl = update (f ∘ inl) i x 
goal: Function.update f (Sum.inl i) x ∘ Sum.inl = Function.update (f ∘ Sum.inl) i x

full_name: Sum.update_inl_apply_inl
code: @[simp]
theorem update_inl_apply_inl [DecidableEq α] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i j : α}
    {x : γ} : update f (inl i) x (inl j) = update (f ∘ inl) i x j 
goal: Function.update f (Sum.inl i) x (Sum.inl j) = Function.update (f ∘ Sum.inl) i x j

full_name: Sum.update_inl_comp_inr
code: @[simp]
theorem update_inl_comp_inr [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α} {x : γ} :
    update f (inl i) x ∘ inr = f ∘ inr 
goal: Function.update f (Sum.inl i) x ∘ Sum.inr = f ∘ Sum.inr

full_name: Sum.update_inl_apply_inr
code: theorem update_inl_apply_inr [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α} {j : β} {x : γ} :
    update f (inl i) x (inr j) = f (inr j) 
goal: Function.update f (Sum.inl i) x (Sum.inr j) = f (Sum.inr j)

full_name: Sum.update_inr_comp_inl
code: @[simp]
theorem update_inr_comp_inl [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : β} {x : γ} :
    update f (inr i) x ∘ inl = f ∘ inl 
goal: Function.update f (Sum.inr i) x ∘ Sum.inl = f ∘ Sum.inl

full_name: Sum.update_inr_apply_inl
code: theorem update_inr_apply_inl [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α} {j : β} {x : γ} :
    update f (inr j) x (inl i) = f (inl i) 
goal: Function.update f (Sum.inr j) x (Sum.inl i) = f (Sum.inl i)

full_name: Sum.update_inr_comp_inr
code: @[simp]
theorem update_inr_comp_inr [DecidableEq β] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : β}
    {x : γ} : update f (inr i) x ∘ inr = update (f ∘ inr) i x 
goal: Function.update f (Sum.inr i) x ∘ Sum.inr = Function.update (f ∘ Sum.inr) i x

full_name: Sum.update_inr_apply_inr
code: @[simp]
theorem update_inr_apply_inr [DecidableEq β] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i j : β}
    {x : γ} : update f (inr i) x (inr j) = update (f ∘ inr) i x j 
goal: Function.update f (Sum.inr i) x (Sum.inr j) = Function.update (f ∘ Sum.inr) i x j

full_name: Sum.swap_leftInverse
code: @[simp]
theorem swap_leftInverse : Function.LeftInverse (@swap α β) swap 
goal: Function.LeftInverse Sum.swap Sum.swap

full_name: Sum.swap_rightInverse
code: @[simp]
theorem swap_rightInverse : Function.RightInverse (@swap α β) swap 
goal: Function.RightInverse Sum.swap Sum.swap

full_name: Sum.LiftRel.isLeft_congr
code: theorem isLeft_congr (h : LiftRel r s x y) : x.isLeft ↔ y.isLeft 
goal: x.isLeft = true ↔ y.isLeft = true

full_name: Sum.LiftRel.isRight_congr
code: theorem isRight_congr (h : LiftRel r s x y) : x.isRight ↔ y.isRight 
goal: x.isRight = true ↔ y.isRight = true

full_name: Sum.LiftRel.isLeft_left
code: theorem isLeft_left (h : LiftRel r s x (inl c)) : x.isLeft 
goal: x.isLeft = true

full_name: Sum.LiftRel.isLeft_right
code: theorem isLeft_right (h : LiftRel r s (inl a) y) : y.isLeft 
goal: y.isLeft = true

full_name: Sum.LiftRel.isRight_left
code: theorem isRight_left (h : LiftRel r s x (inr d)) : x.isRight 
goal: x.isRight = true

full_name: Sum.LiftRel.isRight_right
code: theorem isRight_right (h : LiftRel r s (inr b) y) : y.isRight 
goal: y.isRight = true

full_name: Sum.LiftRel.exists_of_isLeft_left
code: theorem exists_of_isLeft_left (h₁ : LiftRel r s x y) (h₂ : x.isLeft) :
    ∃ a c, r a c ∧ x = inl a ∧ y = inl c 
goal: ∃ a c, r a c ∧ x = Sum.inl a ∧ y = Sum.inl c

full_name: Sum.LiftRel.exists_of_isLeft_right
code: theorem exists_of_isLeft_right (h₁ : LiftRel r s x y) (h₂ : y.isLeft) :
    ∃ a c, r a c ∧ x = inl a ∧ y = inl c 
goal: ∃ a c, r a c ∧ x = Sum.inl a ∧ y = Sum.inl c

full_name: Sum.LiftRel.exists_of_isRight_left
code: theorem exists_of_isRight_left (h₁ : LiftRel r s x y) (h₂ : x.isRight) :
    ∃ b d, s b d ∧ x = inr b ∧ y = inr d 
goal: ∃ b d, s b d ∧ x = Sum.inr b ∧ y = Sum.inr d

full_name: Sum.LiftRel.exists_of_isRight_right
code: theorem exists_of_isRight_right (h₁ : LiftRel r s x y) (h₂ : y.isRight) :
    ∃ b d, s b d ∧ x = inr b ∧ y = inr d 
goal: ∃ b d, s b d ∧ x = Sum.inr b ∧ y = Sum.inr d

full_name: Function.Injective.sum_elim
code: theorem Injective.sum_elim {f : α → γ} {g : β → γ} (hf : Injective f) (hg : Injective g)
    (hfg : ∀ a b, f a ≠ g b) : Injective (Sum.elim f g)
  
goal: Function.Injective (Sum.elim f g)

full_name: Function.Injective.sum_map
code: theorem Injective.sum_map {f : α → β} {g : α' → β'} (hf : Injective f) (hg : Injective g) :
    Injective (Sum.map f g)
  
goal: Function.Injective (Sum.map f g)

full_name: Function.Surjective.sum_map
code: theorem Surjective.sum_map {f : α → β} {g : α' → β'} (hf : Surjective f) (hg : Surjective g) :
    Surjective (Sum.map f g)
  
goal: Function.Surjective (Sum.map f g)

full_name: Function.Bijective.sum_map
code: theorem Bijective.sum_map {f : α → β} {g : α' → β'} (hf : Bijective f) (hg : Bijective g) :
    Bijective (Sum.map f g) 
goal: Function.Bijective (Sum.map f g)

full_name: Sum.map_injective
code: @[simp]
theorem map_injective {f : α → γ} {g : β → δ} :
    Injective (Sum.map f g) ↔ Injective f ∧ Injective g 
goal: Function.Injective (Sum.map f g) ↔ Function.Injective f ∧ Function.Injective g

full_name: Sum.map_surjective
code: @[simp]
theorem map_surjective {f : α → γ} {g : β → δ} :
    Surjective (Sum.map f g) ↔ Surjective f ∧ Surjective g 
goal: Function.Surjective (Sum.map f g) ↔ Function.Surjective f ∧ Function.Surjective g

full_name: Sum.map_bijective
code: @[simp]
theorem map_bijective {f : α → γ} {g : β → δ} :
    Bijective (Sum.map f g) ↔ Bijective f ∧ Bijective g 
goal: Function.Bijective (Sum.map f g) ↔ Function.Bijective f ∧ Function.Bijective g

full_name: Sum.elim_update_left
code: theorem elim_update_left [DecidableEq α] [DecidableEq β] (f : α → γ) (g : β → γ) (i : α) (c : γ) :
    Sum.elim (Function.update f i c) g = Function.update (Sum.elim f g) (inl i) c 
goal: Sum.elim (Function.update f i c) g = Function.update (Sum.elim f g) (Sum.inl i) c

full_name: Sum.elim_update_right
code: theorem elim_update_right [DecidableEq α] [DecidableEq β] (f : α → γ) (g : β → γ) (i : β) (c : γ) :
    Sum.elim f (Function.update g i c) = Function.update (Sum.elim f g) (inr i) c 
goal: Sum.elim f (Function.update g i c) = Function.update (Sum.elim f g) (Sum.inr i) c

full_name: Sum3.in₀
code: /-- The map from the first summand into a ternary sum. -/
@[match_pattern, simp, reducible]
def in₀ (a : α) : α ⊕ (β ⊕ γ) 
goal: α ⊕ β ⊕ γ

full_name: Sum3.in₁
code: /-- The map from the second summand into a ternary sum. -/
@[match_pattern, simp, reducible]
def in₁ (b : β) : α ⊕ (β ⊕ γ) 
goal: α ⊕ β ⊕ γ

full_name: Sum3.in₂
code: /-- The map from the third summand into a ternary sum. -/
@[match_pattern, simp, reducible]
def in₂ (c : γ) : α ⊕ (β ⊕ γ) 
goal: α ⊕ β ⊕ γ