File: .lake/packages/batteries/Batteries/Data/Sum/Lemmas.lean

full_name: Sum.forall
code: @[simp] protected theorem «forall» {p : α ⊕ β → Prop} :
    (∀ x, p x) ↔ (∀ a, p (inl a)) ∧ ∀ b, p (inr b) 
goal: (∀ (x : α ⊕ β), p x) ↔ (∀ (a : α), p (Sum.inl a)) ∧ ∀ (b : β), p (Sum.inr b)

full_name: Sum.exists
code: @[simp] protected theorem «exists» {p : α ⊕ β → Prop} :
    (∃ x, p x) ↔ (∃ a, p (inl a)) ∨ ∃ b, p (inr b) 
goal: (∃ x, p x) ↔ (∃ a, p (Sum.inl a)) ∨ ∃ b, p (Sum.inr b)

full_name: Sum.forall_sum
code: theorem forall_sum {γ : α ⊕ β → Sort _} (p : (∀ ab, γ ab) → Prop) :
    (∀ fab, p fab) ↔ (∀ fa fb, p (Sum.rec fa fb)) 
goal: (∀ (fab : (ab : α ⊕ β) → γ ab), p fab) ↔
  ∀ (fa : (val : α) → γ (Sum.inl val)) (fb : (val : β) → γ (Sum.inr val)), p fun t => Sum.rec fa fb t

full_name: Sum.inl_getLeft
code: @[simp] theorem inl_getLeft : ∀ (x : α ⊕ β) (h : x.isLeft), inl (x.getLeft h) = x
  
goal: Sum.inl (x.getLeft h) = x

full_name: Sum.inr_getRight
code: @[simp] theorem inr_getRight : ∀ (x : α ⊕ β) (h : x.isRight), inr (x.getRight h) = x
  
goal: Sum.inr (x.getRight h) = x

full_name: Sum.getLeft?_eq_none_iff
code: @[simp] theorem getLeft?_eq_none_iff {x : α ⊕ β} : x.getLeft? = none ↔ x.isRight 
goal: x.getLeft? = none ↔ x.isRight = true

full_name: Sum.getRight?_eq_none_iff
code: @[simp] theorem getRight?_eq_none_iff {x : α ⊕ β} : x.getRight? = none ↔ x.isLeft 
goal: x.getRight? = none ↔ x.isLeft = true

full_name: Sum.eq_left_getLeft_of_isLeft
code: theorem eq_left_getLeft_of_isLeft : ∀ {x : α ⊕ β} (h : x.isLeft), x = inl (x.getLeft h)
  
goal: x = Sum.inl (x.getLeft h)

full_name: Sum.getLeft_eq_iff
code: @[simp] theorem getLeft_eq_iff (h : x.isLeft) : x.getLeft h = a ↔ x = inl a 
goal: ∀ {α : Type u_1} {a : α} {β : Type u_2} {x : α ⊕ β} (h : x.isLeft = true), x.getLeft h = a ↔ x = Sum.inl a

full_name: Sum.eq_right_getRight_of_isRight
code: theorem eq_right_getRight_of_isRight : ∀ {x : α ⊕ β} (h : x.isRight), x = inr (x.getRight h)
  
goal: x = Sum.inr (x.getRight h)

full_name: Sum.getRight_eq_iff
code: @[simp] theorem getRight_eq_iff (h : x.isRight) : x.getRight h = b ↔ x = inr b 
goal: ∀ {β : Type u_1} {b : β} {α : Type u_2} {x : α ⊕ β} (h : x.isRight = true), x.getRight h = b ↔ x = Sum.inr b

full_name: Sum.getLeft?_eq_some_iff
code: @[simp] theorem getLeft?_eq_some_iff : x.getLeft? = some a ↔ x = inl a 
goal: ∀ {α : Type u_1} {a : α} {β : Type u_2} {x : α ⊕ β}, x.getLeft? = some a ↔ x = Sum.inl a

full_name: Sum.getRight?_eq_some_iff
code: @[simp] theorem getRight?_eq_some_iff : x.getRight? = some b ↔ x = inr b 
goal: ∀ {β : Type u_1} {b : β} {α : Type u_2} {x : α ⊕ β}, x.getRight? = some b ↔ x = Sum.inr b

full_name: Sum.bnot_isLeft
code: @[simp] theorem bnot_isLeft (x : α ⊕ β) : !x.isLeft = x.isRight 
goal: (!decide (x.isLeft = x.isRight)) = true

full_name: Sum.isLeft_eq_false
code: @[simp] theorem isLeft_eq_false {x : α ⊕ β} : x.isLeft = false ↔ x.isRight 
goal: x.isLeft = false ↔ x.isRight = true

full_name: Sum.not_isLeft
code: theorem not_isLeft {x : α ⊕ β} : ¬x.isLeft ↔ x.isRight 
goal: ¬x.isLeft = true ↔ x.isRight = true

full_name: Sum.bnot_isRight
code: @[simp] theorem bnot_isRight (x : α ⊕ β) : !x.isRight = x.isLeft 
goal: (!decide (x.isRight = x.isLeft)) = true

full_name: Sum.isRight_eq_false
code: @[simp] theorem isRight_eq_false {x : α ⊕ β} : x.isRight = false ↔ x.isLeft 
goal: x.isRight = false ↔ x.isLeft = true

full_name: Sum.not_isRight
code: theorem not_isRight {x : α ⊕ β} : ¬x.isRight ↔ x.isLeft 
goal: ¬x.isRight = true ↔ x.isLeft = true

full_name: Sum.isLeft_iff
code: theorem isLeft_iff : x.isLeft ↔ ∃ y, x = Sum.inl y 
goal: ∀ {α : Type u_1} {β : Type u_2} {x : α ⊕ β}, x.isLeft = true ↔ ∃ y, x = Sum.inl y

full_name: Sum.isRight_iff
code: theorem isRight_iff : x.isRight ↔ ∃ y, x = Sum.inr y 
goal: ∀ {α : Type u_1} {β : Type u_2} {x : α ⊕ β}, x.isRight = true ↔ ∃ y, x = Sum.inr y

full_name: Sum.inl.inj_iff
code: theorem inl.inj_iff : (inl a : α ⊕ β) = inl b ↔ a = b 
goal: Sum.inl a = Sum.inl b ↔ a = b

full_name: Sum.inr.inj_iff
code: theorem inr.inj_iff : (inr a : α ⊕ β) = inr b ↔ a = b 
goal: Sum.inr a = Sum.inr b ↔ a = b

full_name: Sum.inl_ne_inr
code: theorem inl_ne_inr : inl a ≠ inr b 
goal: ∀ {α : Type u_1} {a : α} {β : Type u_2} {b : β}, Sum.inl a ≠ Sum.inr b

full_name: Sum.inr_ne_inl
code: theorem inr_ne_inl : inr b ≠ inl a 
goal: ∀ {β : Type u_1} {b : β} {α : Type u_2} {a : α}, Sum.inr b ≠ Sum.inl a

full_name: Sum.elim_comp_inl
code: @[simp] theorem elim_comp_inl (f : α → γ) (g : β → γ) : Sum.elim f g ∘ inl = f 
goal: Sum.elim f g ∘ Sum.inl = f

full_name: Sum.elim_comp_inr
code: @[simp] theorem elim_comp_inr (f : α → γ) (g : β → γ) : Sum.elim f g ∘ inr = g 
goal: Sum.elim f g ∘ Sum.inr = g

full_name: Sum.elim_inl_inr
code: @[simp] theorem elim_inl_inr : @Sum.elim α β _ inl inr = id 
goal: Sum.elim Sum.inl Sum.inr = id

full_name: Sum.comp_elim
code: theorem comp_elim (f : γ → δ) (g : α → γ) (h : β → γ) :
    f ∘ Sum.elim g h = Sum.elim (f ∘ g) (f ∘ h) 
goal: f ∘ Sum.elim g h = Sum.elim (f ∘ g) (f ∘ h)

full_name: Sum.elim_comp_inl_inr
code: @[simp] theorem elim_comp_inl_inr (f : α ⊕ β → γ) :
    Sum.elim (f ∘ inl) (f ∘ inr) = f 
goal: Sum.elim (f ∘ Sum.inl) (f ∘ Sum.inr) = f

full_name: Sum.elim_eq_iff
code: theorem elim_eq_iff {u u' : α → γ} {v v' : β → γ} :
    Sum.elim u v = Sum.elim u' v' ↔ u = u' ∧ v = v' 
goal: Sum.elim u v = Sum.elim u' v' ↔ u = u' ∧ v = v'

full_name: Sum.map_map
code: @[simp] theorem map_map (f' : α' → α'') (g' : β' → β'') (f : α → α') (g : β → β') :
    ∀ x : Sum α β, (x.map f g).map f' g' = x.map (f' ∘ f) (g' ∘ g)
  
goal: Sum.map f' g' (Sum.map f g x) = Sum.map (f' ∘ f) (g' ∘ g) x

full_name: Sum.map_comp_map
code: @[simp] theorem map_comp_map (f' : α' → α'') (g' : β' → β'') (f : α → α') (g : β → β') :
    Sum.map f' g' ∘ Sum.map f g = Sum.map (f' ∘ f) (g' ∘ g) 
goal: Sum.map f' g' ∘ Sum.map f g = Sum.map (f' ∘ f) (g' ∘ g)

full_name: Sum.map_id_id
code: @[simp] theorem map_id_id : Sum.map (@id α) (@id β) = id 
goal: Sum.map id id = id

full_name: Sum.elim_map
code: theorem elim_map {f₁ : α → β} {f₂ : β → ε} {g₁ : γ → δ} {g₂ : δ → ε} {x} :
    Sum.elim f₂ g₂ (Sum.map f₁ g₁ x) = Sum.elim (f₂ ∘ f₁) (g₂ ∘ g₁) x 
goal: Sum.elim f₂ g₂ (Sum.map f₁ g₁ x) = Sum.elim (f₂ ∘ f₁) (g₂ ∘ g₁) x

full_name: Sum.elim_comp_map
code: theorem elim_comp_map {f₁ : α → β} {f₂ : β → ε} {g₁ : γ → δ} {g₂ : δ → ε} :
    Sum.elim f₂ g₂ ∘ Sum.map f₁ g₁ = Sum.elim (f₂ ∘ f₁) (g₂ ∘ g₁) 
goal: Sum.elim f₂ g₂ ∘ Sum.map f₁ g₁ = Sum.elim (f₂ ∘ f₁) (g₂ ∘ g₁)

full_name: Sum.isLeft_map
code: @[simp] theorem isLeft_map (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
    isLeft (x.map f g) = isLeft x 
goal: (Sum.map f g x).isLeft = x.isLeft

full_name: Sum.isRight_map
code: @[simp] theorem isRight_map (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
    isRight (x.map f g) = isRight x 
goal: (Sum.map f g x).isRight = x.isRight

full_name: Sum.getLeft?_map
code: @[simp] theorem getLeft?_map (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
    (x.map f g).getLeft? = x.getLeft?.map f 
goal: (Sum.map f g x).getLeft? = Option.map f x.getLeft?

full_name: Sum.getRight?_map
code: @[simp] theorem getRight?_map (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
    (x.map f g).getRight? = x.getRight?.map g 
goal: (Sum.map f g x).getRight? = Option.map g x.getRight?

full_name: Sum.swap_swap
code: @[simp] theorem swap_swap (x : α ⊕ β) : swap (swap x) = x 
goal: x.swap.swap = x

full_name: Sum.swap_swap_eq
code: @[simp] theorem swap_swap_eq : swap ∘ swap = @id (α ⊕ β) 
goal: Sum.swap ∘ Sum.swap = id

full_name: Sum.isLeft_swap
code: @[simp] theorem isLeft_swap (x : α ⊕ β) : x.swap.isLeft = x.isRight 
goal: x.swap.isLeft = x.isRight

full_name: Sum.isRight_swap
code: @[simp] theorem isRight_swap (x : α ⊕ β) : x.swap.isRight = x.isLeft 
goal: x.swap.isRight = x.isLeft

full_name: Sum.getLeft?_swap
code: @[simp] theorem getLeft?_swap (x : α ⊕ β) : x.swap.getLeft? = x.getRight? 
goal: x.swap.getLeft? = x.getRight?

full_name: Sum.getRight?_swap
code: @[simp] theorem getRight?_swap (x : α ⊕ β) : x.swap.getRight? = x.getLeft? 
goal: x.swap.getRight? = x.getLeft?

full_name: Sum.LiftRel.mono
code: theorem LiftRel.mono (hr : ∀ a b, r₁ a b → r₂ a b) (hs : ∀ a b, s₁ a b → s₂ a b)
  (h : LiftRel r₁ s₁ x y) : LiftRel r₂ s₂ x y 
goal: ∀ {α : 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

full_name: Sum.LiftRel.mono_left
code: theorem LiftRel.mono_left (hr : ∀ a b, r₁ a b → r₂ a b) (h : LiftRel r₁ s x y) :
    LiftRel r₂ s x y 
goal: ∀ {α : 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

full_name: Sum.LiftRel.mono_right
code: theorem LiftRel.mono_right (hs : ∀ a b, s₁ a b → s₂ a b) (h : LiftRel r s₁ x y) :
    LiftRel r s₂ x y 
goal: ∀ {β : 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

full_name: Sum.LiftRel.swap
code: protected theorem LiftRel.swap (h : LiftRel r s x y) : LiftRel s r x.swap y.swap 
goal: ∀ {α : 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

full_name: Sum.liftRel_swap_iff
code: @[simp] theorem liftRel_swap_iff : LiftRel s r x.swap y.swap ↔ LiftRel r s x y 
goal: ∀ {β : 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 x.swap y.swap ↔ Sum.LiftRel r s x y

full_name: Sum.LiftRel.lex
code: protected theorem LiftRel.lex {a b : α ⊕ β} (h : LiftRel r s a b) : Lex r s a b 
goal: Sum.Lex r s a b

full_name: Sum.liftRel_subrelation_lex
code: theorem liftRel_subrelation_lex : Subrelation (LiftRel r s) (Lex r s) 
goal: ∀ {α : Type u_1} {r : α → α → Prop} {β : Type u_2} {s : β → β → Prop}, Subrelation (Sum.LiftRel r s) (Sum.Lex r s)

full_name: Sum.Lex.mono
code: theorem Lex.mono (hr : ∀ a b, r₁ a b → r₂ a b) (hs : ∀ a b, s₁ a b → s₂ a b) (h : Lex r₁ s₁ x y) :
    Lex r₂ s₂ x y 
goal: ∀ {α : 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

full_name: Sum.Lex.mono_left
code: theorem Lex.mono_left (hr : ∀ a b, r₁ a b → r₂ a b) (h : Lex r₁ s x y) : Lex r₂ s x y 
goal: ∀ {α : 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

full_name: Sum.Lex.mono_right
code: theorem Lex.mono_right (hs : ∀ a b, s₁ a b → s₂ a b) (h : Lex r s₁ x y) : Lex r s₂ x y 
goal: ∀ {β : 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

full_name: Sum.lex_acc_inl
code: theorem lex_acc_inl (aca : Acc r a) : Acc (Lex r s) (inl a) 
goal: ∀ {α : Type u_1} {r : α → α → Prop} {a : α} {β : Type u_2} {s : β → β → Prop}, Acc r a → Acc (Sum.Lex r s) (Sum.inl a)

full_name: Sum.lex_acc_inr
code: theorem lex_acc_inr (aca : ∀ a, Acc (Lex r s) (inl a)) {b} (acb : Acc s b) :
    Acc (Lex r s) (inr b) 
goal: ∀ {α : 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)

full_name: Sum.lex_wf
code: theorem lex_wf (ha : WellFounded r) (hb : WellFounded s) : WellFounded (Lex r s) 
goal: ∀ {α : Type u_1} {r : α → α → Prop} {α_1 : Type u_2} {s : α_1 → α_1 → Prop},
  WellFounded r → WellFounded s → WellFounded (Sum.Lex r s)

full_name: Sum.elim_const_const
code: theorem elim_const_const (c : γ) :
    Sum.elim (const _ c : α → γ) (const _ c : β → γ) = const _ c 
goal: Sum.elim (Function.const α c) (Function.const β c) = Function.const (α ⊕ β) c

full_name: Sum.elim_lam_const_lam_const
code: @[simp] theorem elim_lam_const_lam_const (c : γ) :
    Sum.elim (fun _ : α => c) (fun _ : β => c) = fun _ => c 
goal: (Sum.elim (fun x => c) fun x => c) = fun x => c