File: .lake/packages/lean4/src/lean/Init/Data/Option/Lemmas.lean

full_name: Option.mem_iff
code: theorem mem_iff {a : α} {b : Option α} : a ∈ b ↔ b = a 
goal: a ∈ b ↔ b = some a

full_name: Option.some_ne_none
code: theorem some_ne_none (x : α) : some x ≠ none 
goal: some x ≠ none

full_name: Option.forall
code: protected theorem «forall» {p : Option α → Prop} : (∀ x, p x) ↔ p none ∧ ∀ x, p (some x) 
goal: (∀ (x : Option α), p x) ↔ p none ∧ ∀ (x : α), p (some x)

full_name: Option.exists
code: protected theorem «exists» {p : Option α → Prop} :
    (∃ x, p x) ↔ p none ∨ ∃ x, p (some x) 
goal: (∃ x, p x) ↔ p none ∨ ∃ x, p (some x)

full_name: Option.get_mem
code: theorem get_mem : ∀ {o : Option α} (h : isSome o), o.get h ∈ o
  
goal: o.get h ∈ o

full_name: Option.get_of_mem
code: theorem get_of_mem : ∀ {o : Option α} (h : isSome o), a ∈ o → o.get h = a
  
goal: a ∈ o → o.get h = a

full_name: Option.not_mem_none
code: theorem not_mem_none (a : α) : a ∉ (none : Option α) 
goal: ¬a ∈ none

full_name: Option.some_get
code: @[simp] theorem some_get : ∀ {x : Option α} (h : isSome x), some (x.get h) = x

goal: some (x.get h) = x

full_name: Option.get_some
code: @[simp] theorem get_some (x : α) (h : isSome (some x)) : (some x).get h = x 
goal: (some x).get h = x

full_name: Option.getD_of_ne_none
code: theorem getD_of_ne_none {x : Option α} (hx : x ≠ none) (y : α) : some (x.getD y) = x 
goal: some (x.getD y) = x

full_name: Option.getD_eq_iff
code: theorem getD_eq_iff {o : Option α} {a b} : o.getD a = b ↔ (o = some b ∨ o = none ∧ a = b) 
goal: o.getD a = b ↔ o = some b ∨ o = none ∧ a = b

full_name: Option.mem_unique
code: theorem mem_unique {o : Option α} {a b : α} (ha : a ∈ o) (hb : b ∈ o) : a = b 
goal: a = b

full_name: Option.ext
code: @[ext] theorem ext : ∀ {o₁ o₂ : Option α}, (∀ a, a ∈ o₁ ↔ a ∈ o₂) → o₁ = o₂
  
goal: (∀ (a : α), a ∈ o₁ ↔ a ∈ o₂) → o₁ = o₂

full_name: Option.eq_none_iff_forall_not_mem
code: theorem eq_none_iff_forall_not_mem : o = none ↔ ∀ a, a ∉ o 
goal: ∀ {α : Type u_1} {o : Option α}, o = none ↔ ∀ (a : α), ¬a ∈ o

full_name: Option.isSome_none
code: @[simp] theorem isSome_none : @isSome α none = false 
goal: none.isSome = false

full_name: Option.isSome_some
code: @[simp] theorem isSome_some : isSome (some a) = true 
goal: ∀ {α : Type u_1} {a : α}, (some a).isSome = true

full_name: Option.isSome_iff_exists
code: theorem isSome_iff_exists : isSome x ↔ ∃ a, x = some a 
goal: ∀ {α : Type u_1} {x : Option α}, x.isSome = true ↔ ∃ a, x = some a

full_name: Option.isNone_none
code: @[simp] theorem isNone_none : @isNone α none = true 
goal: none.isNone = true

full_name: Option.isNone_some
code: @[simp] theorem isNone_some : isNone (some a) = false 
goal: ∀ {α : Type u_1} {a : α}, (some a).isNone = false

full_name: Option.not_isSome
code: @[simp] theorem not_isSome : isSome a = false ↔ a.isNone = true 
goal: ∀ {α : Type u_1} {a : Option α}, a.isSome = false ↔ a.isNone = true

full_name: Option.eq_some_iff_get_eq
code: theorem eq_some_iff_get_eq : o = some a ↔ ∃ h : o.isSome, o.get h = a 
goal: ∀ {α : Type u_1} {o : Option α} {a : α}, o = some a ↔ ∃ h, o.get h = a

full_name: Option.eq_some_of_isSome
code: theorem eq_some_of_isSome : ∀ {o : Option α} (h : o.isSome), o = some (o.get h)
  
goal: o = some (o.get h)

full_name: Option.not_isSome_iff_eq_none
code: theorem not_isSome_iff_eq_none : ¬o.isSome ↔ o = none 
goal: ∀ {α : Type u_1} {o : Option α}, ¬o.isSome = true ↔ o = none

full_name: Option.ne_none_iff_isSome
code: theorem ne_none_iff_isSome : o ≠ none ↔ o.isSome 
goal: ∀ {α : Type u_1} {o : Option α}, o ≠ none ↔ o.isSome = true

full_name: Option.ne_none_iff_exists
code: theorem ne_none_iff_exists : o ≠ none ↔ ∃ x, some x = o 
goal: ∀ {α : Type u_1} {o : Option α}, o ≠ none ↔ ∃ x, some x = o

full_name: Option.ne_none_iff_exists'
code: theorem ne_none_iff_exists' : o ≠ none ↔ ∃ x, o = some x 
goal: ∀ {α : Type u_1} {o : Option α}, o ≠ none ↔ ∃ x, o = some x

full_name: Option.bex_ne_none
code: theorem bex_ne_none {p : Option α → Prop} : (∃ x, ∃ (_ : x ≠ none), p x) ↔ ∃ x, p (some x) 
goal: (∃ x x_1, p x) ↔ ∃ x, p (some x)

full_name: Option.ball_ne_none
code: theorem ball_ne_none {p : Option α → Prop} : (∀ x (_ : x ≠ none), p x) ↔ ∀ x, p (some x) 
goal: (∀ (x : Option α), x ≠ none → p x) ↔ ∀ (x : α), p (some x)

full_name: Option.pure_def
code: @[simp] theorem pure_def : pure = @some α 
goal: pure = some

full_name: Option.bind_eq_bind
code: @[simp] theorem bind_eq_bind : bind = @Option.bind α β 
goal: bind = Option.bind

full_name: Option.bind_some
code: @[simp] theorem bind_some (x : Option α) : x.bind some = x 
goal: x.bind some = x

full_name: Option.bind_none
code: @[simp] theorem bind_none (x : Option α) : x.bind (fun _ => none (α := β)) = none 
goal: (x.bind fun x => none) = none

full_name: Option.bind_eq_some
code: theorem bind_eq_some : x.bind f = some b ↔ ∃ a, x = some a ∧ f a = some b 
goal: ∀ {α : Type u_1} {b : α} {α_1 : Type u_2} {x : Option α_1} {f : α_1 → Option α},
  x.bind f = some b ↔ ∃ a, x = some a ∧ f a = some b

full_name: Option.bind_eq_none
code: @[simp] theorem bind_eq_none {o : Option α} {f : α → Option β} :
    o.bind f = none ↔ ∀ a, o = some a → f a = none 
goal: o.bind f = none ↔ ∀ (a : α), o = some a → f a = none

full_name: Option.bind_eq_none'
code: theorem bind_eq_none' {o : Option α} {f : α → Option β} :
    o.bind f = none ↔ ∀ b a, a ∈ o → b ∉ f a 
goal: o.bind f = none ↔ ∀ (b : β) (a : α), a ∈ o → ¬b ∈ f a

full_name: Option.bind_comm
code: theorem bind_comm {f : α → β → Option γ} (a : Option α) (b : Option β) :
    (a.bind fun x => b.bind (f x)) = b.bind fun y => a.bind fun x => f x y 
goal: (a.bind fun x => b.bind (f x)) = b.bind fun y => a.bind fun x => f x y

full_name: Option.bind_assoc
code: theorem bind_assoc (x : Option α) (f : α → Option β) (g : β → Option γ) :
    (x.bind f).bind g = x.bind fun y => (f y).bind g 
goal: (x.bind f).bind g = x.bind fun y => (f y).bind g

full_name: Option.join_eq_some
code: theorem join_eq_some : x.join = some a ↔ x = some (some a) 
goal: ∀ {α : Type u_1} {a : α} {x : Option (Option α)}, x.join = some a ↔ x = some (some a)

full_name: Option.join_ne_none
code: theorem join_ne_none : x.join ≠ none ↔ ∃ z, x = some (some z) 
goal: ∀ {α : Type u_1} {x : Option (Option α)}, x.join ≠ none ↔ ∃ z, x = some (some z)

full_name: Option.join_ne_none'
code: theorem join_ne_none' : ¬x.join = none ↔ ∃ z, x = some (some z) 
goal: ∀ {α : Type u_1} {x : Option (Option α)}, ¬x.join = none ↔ ∃ z, x = some (some z)

full_name: Option.join_eq_none
code: theorem join_eq_none : o.join = none ↔ o = none ∨ o = some none 
goal: ∀ {α : Type u_1} {o : Option (Option α)}, o.join = none ↔ o = none ∨ o = some none

full_name: Option.bind_id_eq_join
code: theorem bind_id_eq_join {x : Option (Option α)} : x.bind id = x.join 
goal: x.bind id = x.join

full_name: Option.map_eq_map
code: @[simp] theorem map_eq_map : Functor.map f = Option.map f 
goal: ∀ {α α_1 : Type u_1} {f : α → α_1}, Functor.map f = Option.map f

full_name: Option.map_none
code: theorem map_none : f <$> none = none 
goal: ∀ {α α_1 : Type u_1} {f : α → α_1}, f <$> none = none

full_name: Option.map_some
code: theorem map_some : f <$> some a = some (f a) 
goal: ∀ {α α_1 : Type u_1} {f : α → α_1} {a : α}, f <$> some a = some (f a)

full_name: Option.map_eq_some'
code: @[simp] theorem map_eq_some' : x.map f = some b ↔ ∃ a, x = some a ∧ f a = b 
goal: ∀ {α : Type u_1} {b : α} {α_1 : Type u_2} {x : Option α_1} {f : α_1 → α},
  Option.map f x = some b ↔ ∃ a, x = some a ∧ f a = b

full_name: Option.map_eq_some
code: theorem map_eq_some : f <$> x = some b ↔ ∃ a, x = some a ∧ f a = b 
goal: ∀ {α α_1 : Type u_1} {f : α → α_1} {x : Option α} {b : α_1}, f <$> x = some b ↔ ∃ a, x = some a ∧ f a = b

full_name: Option.map_eq_none'
code: @[simp] theorem map_eq_none' : x.map f = none ↔ x = none 
goal: ∀ {α : Type u_1} {x : Option α} {α_1 : Type u_2} {f : α → α_1}, Option.map f x = none ↔ x = none

full_name: Option.map_eq_none
code: theorem map_eq_none : f <$> x = none ↔ x = none 
goal: ∀ {α α_1 : Type u_1} {f : α → α_1} {x : Option α}, f <$> x = none ↔ x = none

full_name: Option.map_eq_bind
code: theorem map_eq_bind {x : Option α} : x.map f = x.bind (some ∘ f) 
goal: ∀ {α_1 : Type u_2} {f : α → α_1} {x : Option α}, Option.map f x = x.bind (some ∘ f)

full_name: Option.map_congr
code: theorem map_congr {x : Option α} (h : ∀ a, a ∈ x → f a = g a) : x.map f = x.map g 
goal: ∀ {α_1 : Type u_2} {f g : α → α_1} {x : Option α}, (∀ (a : α), a ∈ x → f a = g a) → Option.map f x = Option.map g x

full_name: Option.map_id'
code: @[simp] theorem map_id' : Option.map (@id α) = id 
goal: Option.map id = id

full_name: Option.map_id''
code: @[simp] theorem map_id'' {x : Option α} : (x.map fun a => a) = x 
goal: Option.map (fun a => a) x = x

full_name: Option.map_map
code: @[simp] theorem map_map (h : β → γ) (g : α → β) (x : Option α) :
    (x.map g).map h = x.map (h ∘ g) 
goal: Option.map h (Option.map g x) = Option.map (h ∘ g) x

full_name: Option.comp_map
code: theorem comp_map (h : β → γ) (g : α → β) (x : Option α) : x.map (h ∘ g) = (x.map g).map h 
goal: Option.map (h ∘ g) x = Option.map h (Option.map g x)

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

full_name: Option.mem_map_of_mem
code: theorem mem_map_of_mem (g : α → β) (h : a ∈ x) : g a ∈ Option.map g x 
goal: g a ∈ Option.map g x

full_name: Option.bind_map_comm
code: theorem bind_map_comm {α β} {x : Option (Option α)} {f : α → β} :
    x.bind (Option.map f) = (x.map (Option.map f)).bind id 
goal: x.bind (Option.map f) = (Option.map (Option.map f) x).bind id

full_name: Option.join_map_eq_map_join
code: theorem join_map_eq_map_join {f : α → β} {x : Option (Option α)} :
    (x.map (Option.map f)).join = x.join.map f 
goal: (Option.map (Option.map f) x).join = Option.map f x.join

full_name: Option.join_join
code: theorem join_join {x : Option (Option (Option α))} : x.join.join = (x.map join).join 
goal: x.join.join = (Option.map Option.join x).join

full_name: Option.mem_of_mem_join
code: theorem mem_of_mem_join {a : α} {x : Option (Option α)} (h : a ∈ x.join) : some a ∈ x 
goal: some a ∈ x

full_name: Option.some_orElse
code: @[simp] theorem some_orElse (a : α) (x : Option α) : (some a <|> x) = some a 
goal: (HOrElse.hOrElse (some a) fun x_1 => x) = some a

full_name: Option.none_orElse
code: @[simp] theorem none_orElse (x : Option α) : (none <|> x) = x 
goal: (HOrElse.hOrElse none fun x_1 => x) = x

full_name: Option.orElse_none
code: @[simp] theorem orElse_none (x : Option α) : (x <|> none) = x 
goal: (HOrElse.hOrElse x fun x => none) = x

full_name: Option.map_orElse
code: theorem map_orElse {x y : Option α} : (x <|> y).map f = (x.map f <|> y.map f) 
goal: ∀ {α_1 : Type u_2} {f : α → α_1} {x y : Option α},
  Option.map f (HOrElse.hOrElse x fun x => y) = HOrElse.hOrElse (Option.map f x) fun x => Option.map f y

full_name: Option.guard_eq_some
code: @[simp] theorem guard_eq_some [DecidablePred p] : guard p a = some b ↔ a = b ∧ p a 
goal: ∀ {α : Type u_1} {p : α → Prop} {a b : α} [inst : DecidablePred p], Option.guard p a = some b ↔ a = b ∧ p a

full_name: Option.liftOrGet_eq_or_eq
code: theorem liftOrGet_eq_or_eq {f : α → α → α} (h : ∀ a b, f a b = a ∨ f a b = b) :
    ∀ o₁ o₂, liftOrGet f o₁ o₂ = o₁ ∨ liftOrGet f o₁ o₂ = o₂
  
goal: Option.liftOrGet f o₁ o₂ = o₁ ∨ Option.liftOrGet f o₁ o₂ = o₂

full_name: Option.liftOrGet_none_left
code: @[simp] theorem liftOrGet_none_left {f} {b : Option α} : liftOrGet f none b = b 
goal: Option.liftOrGet f none b = b

full_name: Option.liftOrGet_none_right
code: @[simp] theorem liftOrGet_none_right {f} {a : Option α} : liftOrGet f a none = a 
goal: Option.liftOrGet f a none = a

full_name: Option.liftOrGet_some_some
code: @[simp] theorem liftOrGet_some_some {f} {a b : α} :
  liftOrGet f (some a) (some b) = f a b 
goal: Option.liftOrGet f (some a) (some b) = some (f a b)

full_name: Option.elim_none
code: @[simp] theorem elim_none (x : β) (f : α → β) : none.elim x f = x 
goal: none.elim x f = x

full_name: Option.elim_some
code: @[simp] theorem elim_some (x : β) (f : α → β) (a : α) : (some a).elim x f = f a 
goal: (some a).elim x f = f a

full_name: Option.getD_map
code: @[simp] theorem getD_map (f : α → β) (x : α) (o : Option α) :
  (o.map f).getD (f x) = f (getD o x) 
goal: (Option.map f o).getD (f x) = f (o.getD x)

full_name: Option.choice
code: /-- An arbitrary `some a` with `a : α` if `α` is nonempty, and otherwise `none`. -/
noncomputable def choice (α : Type _) : Option α 
goal: Option α

full_name: Option.choice_eq
code: theorem choice_eq {α : Type _} [Subsingleton α] (a : α) : choice α = some a 
goal: Option.choice α = some a

full_name: Option.choice_isSome_iff_nonempty
code: theorem choice_isSome_iff_nonempty {α : Type _} : (choice α).isSome ↔ Nonempty α 
goal: (Option.choice α).isSome = true ↔ Nonempty α

full_name: Option.toList_some
code: @[simp] theorem toList_some (a : α) : (a : Option α).toList = [a] 
goal: (some a).toList = [a]

full_name: Option.toList_none
code: @[simp] theorem toList_none (α : Type _) : (none : Option α).toList = [] 
goal: none.toList = []