File: .lake/packages/lean4/src/lean/Init/ByCases.lean

full_name: «tacticBy_cases_:_»
code: /--
`by_cases (h :)? p` splits the main goal into two cases, assuming `h : p` in the first branch, and `h : ¬ p` in the second branch.
-/
syntax "by_cases " (atomic(ident " : "))? term : tactic
goal: Lean.ParserDescr

full_name: «_aux_.lake_packages_lean4_src_lean_Init_ByCases___macroRules_tacticBy_cases_:__1»
code: macro_rules
  | `(tactic| by_cases $e) => `(tactic| by_cases h : $e)
goal: Lean.Macro

full_name: «_aux_.lake_packages_lean4_src_lean_Init_ByCases___macroRules_tacticBy_cases_:__2»
code: macro_rules
  | `(tactic| by_cases $h : $e) =>
    `(tactic| open Classical in refine if $h:ident : $e then ?pos else ?neg)
goal: Lean.Macro

full_name: if_true
code: @[simp] theorem if_true {_ : Decidable True} (t e : α) : ite True t e = t 
goal: ∀ {x : Decidable True} (t e : α), (if True then t else e) = t

full_name: if_false
code: @[simp] theorem if_false {_ : Decidable False} (t e : α) : ite False t e = e 
goal: ∀ {x : Decidable False} (t e : α), (if False then t else e) = e

full_name: ite_id
code: theorem ite_id [Decidable c] {α} (t : α) : (if c then t else t) = t 
goal: (if c then t else t) = t

full_name: apply_dite
code: /-- A function applied to a `dite` is a `dite` of that function applied to each of the branches. -/
theorem apply_dite (f : α → β) (P : Prop) [Decidable P] (x : P → α) (y : ¬P → α) :
    f (dite P x y) = dite P (fun h => f (x h)) (fun h => f (y h)) 
goal: f (dite P x y) = if h : P then f (x h) else f (y h)

full_name: apply_ite
code: /-- A function applied to a `ite` is a `ite` of that function applied to each of the branches. -/
theorem apply_ite (f : α → β) (P : Prop) [Decidable P] (x y : α) :
    f (ite P x y) = ite P (f x) (f y) 
goal: f (if P then x else y) = if P then f x else f y

full_name: dite_eq_left_iff
code: @[simp] theorem dite_eq_left_iff {P : Prop} [Decidable P] {B : ¬ P → α} :
    dite P (fun _ => a) B = a ↔ ∀ h, B h = a 
goal: dite P (fun x => a) B = a ↔ ∀ (h : ¬P), B h = a

full_name: dite_eq_right_iff
code: @[simp] theorem dite_eq_right_iff {P : Prop} [Decidable P] {A : P → α} :
    (dite P A fun _ => b) = b ↔ ∀ h, A h = b 
goal: (dite P A fun x => b) = b ↔ ∀ (h : P), A h = b

full_name: ite_eq_left_iff
code: @[simp] theorem ite_eq_left_iff {P : Prop} [Decidable P] : ite P a b = a ↔ ¬P → b = a 
goal: ∀ {α : Sort u_1} {a b : α} {P : Prop} [inst : Decidable P], (if P then a else b) = a ↔ ¬P → b = a

full_name: ite_eq_right_iff
code: @[simp] theorem ite_eq_right_iff {P : Prop} [Decidable P] : ite P a b = b ↔ P → a = b 
goal: ∀ {α : Sort u_1} {a b : α} {P : Prop} [inst : Decidable P], (if P then a else b) = b ↔ P → a = b

full_name: dite_eq_ite
code: /-- A `dite` whose results do not actually depend on the condition may be reduced to an `ite`. -/
@[simp] theorem dite_eq_ite [Decidable P] : (dite P (fun _ => a) fun _ => b) = ite P a b 
goal: ∀ {α : Sort u_1} {a b : α} [inst : Decidable P], (if x : P then a else b) = if P then a else b

full_name: ite_some_none_eq_none
code: theorem ite_some_none_eq_none [Decidable P] :
    (if P then some x else none) = none ↔ ¬ P 
goal: ∀ {α : Type u_1} {x : α} [inst : Decidable P], (if P then some x else none) = none ↔ ¬P

full_name: ite_some_none_eq_some
code: @[simp] theorem ite_some_none_eq_some [Decidable P] :
    (if P then some x else none) = some y ↔ P ∧ x = y 
goal: ∀ {α : Type u_1} {x y : α} [inst : Decidable P], (if P then some x else none) = some y ↔ P ∧ x = y

full_name: dite_some_none_eq_none
code: theorem dite_some_none_eq_none [Decidable P] {x : P → α} :
    (if h : P then some (x h) else none) = none ↔ ¬P 
goal: (if h : P then some (x h) else none) = none ↔ ¬P

full_name: dite_some_none_eq_some
code: @[simp] theorem dite_some_none_eq_some [Decidable P] {x : P → α} {y : α} :
    (if h : P then some (x h) else none) = some y ↔ ∃ h : P, x h = y 
goal: (if h : P then some (x h) else none) = some y ↔ ∃ h, x h = y