Documentation

Init.Data.Option.Lemmas

@[deprecated Option.mem_def (since := "2025-04-07")]
theorem Option.mem_iff {α : Type u_1} {a : α} {b : Option α} :
a b b = some a
theorem Option.mem_some {α : Type u_1} {a b : α} :
a some b b = a
theorem Option.mem_some_iff {α : Type u_1} {a b : α} :
a some b b = a
theorem Option.mem_some_self {α : Type u_1} (a : α) :
a some a
theorem Option.some_ne_none {α : Type u_1} (x : α) :
theorem Option.forall {α : Type u_1} {p : Option αProp} :
(∀ (x : Option α), p x) p none ∀ (x : α), p (some x)
theorem Option.exists {α : Type u_1} {p : Option αProp} :
( (x : Option α), p x) p none (x : α), p (some x)
theorem Option.eq_none_or_eq_some {α : Type u_1} (a : Option α) :
a = none (x : α), a = some x
theorem Option.get_mem {α : Type u_1} {o : Option α} (h : o.isSome = true) :
o.get h o
theorem Option.get_of_mem {α : Type u_1} {a : α} {o : Option α} (h : o.isSome = true) :
a oo.get h = a
theorem Option.get_of_eq_some {α : Type u_1} {a : α} {o : Option α} (h : o.isSome = true) :
o = some ao.get h = a
@[simp]
theorem Option.not_mem_none {α : Type u_1} (a : α) :
theorem Option.getD_of_ne_none {α : Type u_1} {x : Option α} (hx : x none) (y : α) :
some (x.getD y) = x
theorem Option.getD_eq_iff {α : Type u_1} {o : Option α} {a b : α} :
o.getD a = b o = some b o = none a = b
@[simp]
theorem Option.get!_none {α : Type u_1} [Inhabited α] :
@[simp]
theorem Option.get!_some {α : Type u_1} [Inhabited α] {a : α} :
(some a).get! = a
theorem Option.get_eq_get! {α : Type u_1} [Inhabited α] (o : Option α) {h : o.isSome = true} :
o.get h = o.get!
theorem Option.get_eq_getD {α : Type u_1} {fallback : α} (o : Option α) {h : o.isSome = true} :
o.get h = o.getD fallback
theorem Option.some_get! {α : Type u_1} [Inhabited α] (o : Option α) :
o.isSome = truesome o.get! = o
theorem Option.get!_eq_getD {α : Type u_1} [Inhabited α] (o : Option α) :
theorem Option.get_congr {α : Type u_1} {o o' : Option α} {ho : o.isSome = true} (h : o = o') :
o.get ho = o'.get
theorem Option.get_inj {α : Type u_1} {o1 o2 : Option α} {h1 : o1.isSome = true} {h2 : o2.isSome = true} :
o1.get h1 = o2.get h2 o1 = o2
theorem Option.mem_unique {α : Type u_1} {o : Option α} {a b : α} (ha : a o) (hb : b o) :
a = b
theorem Option.eq_some_unique {α : Type u_1} {o : Option α} {a b : α} (ha : o = some a) (hb : o = some b) :
a = b
theorem Option.ext {α : Type u_1} {o₁ o₂ : Option α} :
(∀ (a : α), o₁ = some a o₂ = some a)o₁ = o₂
theorem Option.ext_iff {α : Type u_1} {o₁ o₂ : Option α} :
o₁ = o₂ ∀ (a : α), o₁ = some a o₂ = some a
theorem Option.eq_none_iff_forall_ne_some {α✝ : Type u_1} {o : Option α✝} :
o = none ∀ (a : α✝), o some a
theorem Option.eq_none_iff_forall_some_ne {α✝ : Type u_1} {o : Option α✝} :
o = none ∀ (a : α✝), some a o
theorem Option.eq_none_iff_forall_not_mem {α✝ : Type u_1} {o : Option α✝} :
o = none ∀ (a : α✝), ¬a o
theorem Option.isSome_iff_exists {α✝ : Type u_1} {x : Option α✝} :
x.isSome = true (a : α✝), x = some a
theorem Option.isSome_eq_isSome {α✝ : Type u_1} {x : Option α✝} {α✝¹ : Type u_2} {y : Option α✝¹} :
theorem Option.isSome_of_mem {α : Type u_1} {x : Option α} {y : α} (h : y x) :
theorem Option.isSome_of_eq_some {α : Type u_1} {x : Option α} {y : α} (h : x = some y) :
@[simp]
theorem Option.isSome_eq_false_iff {α✝ : Type u_1} {a : Option α✝} :
@[simp]
theorem Option.isNone_eq_false_iff {α✝ : Type u_1} {a : Option α✝} :
@[simp]
theorem Option.not_isSome {α : Type u_1} (a : Option α) :
@[simp]
theorem Option.not_comp_isSome {α : Type u_1} :
(fun (x : Bool) => !x) isSome = isNone
@[simp]
theorem Option.not_isNone {α : Type u_1} (a : Option α) :
@[simp]
theorem Option.not_comp_isNone {α : Type u_1} :
(fun (x : Bool) => !x) isNone = isSome
theorem Option.eq_some_iff_get_eq {α✝ : Type u_1} {o : Option α✝} {a : α✝} :
o = some a (h : o.isSome = true), o.get h = a
theorem Option.eq_some_of_isSome {α : Type u_1} {o : Option α} (h : o.isSome = true) :
o = some (o.get h)
theorem Option.isSome_iff_ne_none {α✝ : Type u_1} {o : Option α✝} :
theorem Option.not_isSome_iff_eq_none {α✝ : Type u_1} {o : Option α✝} :
theorem Option.ne_none_iff_isSome {α✝ : Type u_1} {o : Option α✝} :
@[simp]
theorem Option.any_true {α : Type u_1} {o : Option α} :
Option.any (fun (x : α) => true) o = o.isSome
@[simp]
theorem Option.any_false {α : Type u_1} {o : Option α} :
Option.any (fun (x : α) => false) o = false
@[simp]
theorem Option.all_true {α : Type u_1} {o : Option α} :
Option.all (fun (x : α) => true) o = true
@[simp]
theorem Option.all_false {α : Type u_1} {o : Option α} :
Option.all (fun (x : α) => false) o = o.isNone
theorem Option.ne_none_iff_exists {α✝ : Type u_1} {o : Option α✝} :
o none (x : α✝), some x = o
theorem Option.ne_none_iff_exists' {α✝ : Type u_1} {o : Option α✝} :
o none (x : α✝), o = some x
theorem Option.exists_ne_none {α : Type u_1} {p : Option αProp} :
( (x : Option α), x none p x) (x : α), p (some x)
@[deprecated Option.exists_ne_none (since := "2025-04-04")]
theorem Option.bex_ne_none {α : Type u_1} {p : Option αProp} :
( (x : Option α), (x_1 : x none), p x) (x : α), p (some x)
theorem Option.forall_ne_none {α : Type u_1} {p : Option αProp} :
(∀ (x : Option α), x nonep x) ∀ (x : α), p (some x)
@[reducible, inline, deprecated Option.forall_ne_none (since := "2025-04-04")]
abbrev Option.ball_ne_none {α : Type u_1} {p : Option αProp} :
(∀ (x : Option α), x nonep x) ∀ (x : α), p (some x)
Equations
    Instances For
      @[simp]
      theorem Option.pure_def {α : Type u_1} :
      @[simp]
      theorem Option.bind_eq_bind {α β : Type u_1} :
      @[simp]
      theorem Option.bind_fun_some {α : Type u_1} (x : Option α) :
      x.bind some = x
      @[simp]
      theorem Option.bind_fun_none {α : Type u_1} {β : Type u_2} (x : Option α) :
      (x.bind fun (x : α) => none) = none
      theorem Option.bind_eq_some_iff {α✝ : Type u_1} {b : α✝} {α✝¹ : Type u_2} {x : Option α✝¹} {f : α✝¹Option α✝} :
      x.bind f = some b (a : α✝¹), x = some a f a = some b
      @[reducible, inline, deprecated Option.bind_eq_some_iff (since := "2025-04-10")]
      abbrev Option.bind_eq_some {α✝ : Type u_1} {b : α✝} {α✝¹ : Type u_2} {x : Option α✝¹} {f : α✝¹Option α✝} :
      x.bind f = some b (a : α✝¹), x = some a f a = some b
      Equations
        Instances For
          @[simp]
          theorem Option.bind_eq_none_iff {α : Type u_1} {β : Type u_2} {o : Option α} {f : αOption β} :
          o.bind f = none ∀ (a : α), o = some af a = none
          @[reducible, inline, deprecated Option.bind_eq_none_iff (since := "2025-04-10")]
          abbrev Option.bind_eq_none {α : Type u_1} {β : Type u_2} {o : Option α} {f : αOption β} :
          o.bind f = none ∀ (a : α), o = some af a = none
          Equations
            Instances For
              theorem Option.bind_eq_none' {α : Type u_1} {β : Type u_2} {o : Option α} {f : αOption β} :
              o.bind f = none ∀ (b : β) (a : α), o = some af a some b
              theorem Option.mem_bind_iff {α : Type u_1} {β : Type u_2} {b : β} {o : Option α} {f : αOption β} :
              b o.bind f (a : α), a o b f a
              theorem Option.bind_comm {α : Type u_1} {β : Type u_2} {γ : Type u_3} {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
              theorem Option.bind_assoc {α : Type u_1} {β : Type u_2} {γ : Type u_3} (x : Option α) (f : αOption β) (g : βOption γ) :
              (x.bind f).bind g = x.bind fun (y : α) => (f y).bind g
              theorem Option.bind_congr {α : Type u_1} {β : Type u_2} {o : Option α} {f g : αOption β} (h : ∀ (a : α), o = some af a = g a) :
              o.bind f = o.bind g
              theorem Option.isSome_bind {α : Type u_1} {β : Type u_2} (x : Option α) (f : αOption β) :
              (x.bind f).isSome = Option.any (fun (x : α) => (f x).isSome) x
              theorem Option.isNone_bind {α : Type u_1} {β : Type u_2} (x : Option α) (f : αOption β) :
              (x.bind f).isNone = Option.all (fun (x : α) => (f x).isNone) x
              theorem Option.isSome_of_isSome_bind {α : Type u_1} {β : Type u_2} {x : Option α} {f : αOption β} (h : (x.bind f).isSome = true) :
              theorem Option.isSome_apply_of_isSome_bind {α : Type u_1} {β : Type u_2} {x : Option α} {f : αOption β} (h : (x.bind f).isSome = true) :
              (f (x.get )).isSome = true
              @[simp]
              theorem Option.get_bind {α : Type u_1} {β : Type u_2} {x : Option α} {f : αOption β} (h : (x.bind f).isSome = true) :
              (x.bind f).get h = (f (x.get )).get
              theorem Option.any_bind {β : Type u_1} {α : Type u_2} {p : βBool} {f : αOption β} {o : Option α} :
              theorem Option.all_bind {β : Type u_1} {α : Type u_2} {p : βBool} {f : αOption β} {o : Option α} :
              theorem Option.bind_id_eq_join {α : Type u_1} {x : Option (Option α)} :
              theorem Option.join_eq_some_iff {α✝ : Type u_1} {a : α✝} {x : Option (Option α✝)} :
              x.join = some a x = some (some a)
              @[reducible, inline, deprecated Option.join_eq_some_iff (since := "2025-04-10")]
              abbrev Option.join_eq_some {α✝ : Type u_1} {a : α✝} {x : Option (Option α✝)} :
              x.join = some a x = some (some a)
              Equations
                Instances For
                  theorem Option.join_ne_none {α✝ : Type u_1} {x : Option (Option α✝)} :
                  x.join none (z : α✝), x = some (some z)
                  theorem Option.join_ne_none' {α✝ : Type u_1} {x : Option (Option α✝)} :
                  ¬x.join = none (z : α✝), x = some (some z)
                  theorem Option.join_eq_none_iff {α✝ : Type u_1} {o : Option (Option α✝)} :
                  @[reducible, inline, deprecated Option.join_eq_none_iff (since := "2025-04-10")]
                  abbrev Option.join_eq_none {α✝ : Type u_1} {o : Option (Option α✝)} :
                  Equations
                    Instances For
                      theorem Option.bind_join {α : Type u_1} {β : Type u_2} {f : αOption β} {o : Option (Option α)} :
                      o.join.bind f = o.bind fun (x : Option α) => x.bind f
                      @[simp]
                      theorem Option.map_eq_map {α✝ α✝¹ : Type u_1} {f : α✝α✝¹} :
                      @[reducible, inline, deprecated Option.map_none (since := "2025-04-10")]
                      abbrev Option.map_none' {α : Type u_1} {β : Type u_2} (f : αβ) :
                      Equations
                        Instances For
                          @[reducible, inline, deprecated Option.map_some (since := "2025-04-10")]
                          abbrev Option.map_some' {α : Type u_1} {β : Type u_2} (a : α) (f : αβ) :
                          Option.map f (some a) = some (f a)
                          Equations
                            Instances For
                              @[simp]
                              theorem Option.map_eq_some_iff {α✝ : Type u_1} {b : α✝} {α✝¹ : Type u_2} {x : Option α✝¹} {f : α✝¹α✝} :
                              Option.map f x = some b (a : α✝¹), x = some a f a = b
                              @[reducible, inline, deprecated Option.map_eq_some_iff (since := "2025-04-10")]
                              abbrev Option.map_eq_some {α✝ : Type u_1} {b : α✝} {α✝¹ : Type u_2} {x : Option α✝¹} {f : α✝¹α✝} :
                              Option.map f x = some b (a : α✝¹), x = some a f a = b
                              Equations
                                Instances For
                                  @[reducible, inline, deprecated Option.map_eq_some_iff (since := "2025-04-10")]
                                  abbrev Option.map_eq_some' {α✝ : Type u_1} {b : α✝} {α✝¹ : Type u_2} {x : Option α✝¹} {f : α✝¹α✝} :
                                  Option.map f x = some b (a : α✝¹), x = some a f a = b
                                  Equations
                                    Instances For
                                      @[simp]
                                      theorem Option.map_eq_none_iff {α✝ : Type u_1} {x : Option α✝} {α✝¹ : Type u_2} {f : α✝α✝¹} :
                                      @[reducible, inline, deprecated Option.map_eq_none_iff (since := "2025-04-10")]
                                      abbrev Option.map_eq_none {α✝ : Type u_1} {x : Option α✝} {α✝¹ : Type u_2} {f : α✝α✝¹} :
                                      Equations
                                        Instances For
                                          @[reducible, inline, deprecated Option.map_eq_none_iff (since := "2025-04-10")]
                                          abbrev Option.map_eq_none' {α✝ : Type u_1} {x : Option α✝} {α✝¹ : Type u_2} {f : α✝α✝¹} :
                                          Equations
                                            Instances For
                                              @[simp]
                                              theorem Option.isSome_map {α : Type u_1} {α✝ : Type u_2} {f : αα✝} {x : Option α} :
                                              @[reducible, inline, deprecated Option.isSome_map (since := "2025-04-10")]
                                              abbrev Option.isSome_map' {α : Type u_1} {α✝ : Type u_2} {f : αα✝} {x : Option α} :
                                              Equations
                                                Instances For
                                                  @[simp]
                                                  theorem Option.isNone_map {α : Type u_1} {α✝ : Type u_2} {f : αα✝} {x : Option α} :
                                                  theorem Option.map_eq_bind {α : Type u_1} {α✝ : Type u_2} {f : αα✝} {x : Option α} :
                                                  theorem Option.map_congr {α : Type u_1} {α✝ : Type u_2} {f g : αα✝} {x : Option α} (h : ∀ (a : α), x = some af a = g a) :
                                                  @[simp]
                                                  theorem Option.map_id' {α : Type u_1} {x : Option α} :
                                                  Option.map (fun (a : α) => a) x = x
                                                  @[simp]
                                                  theorem Option.map_id_fun' {α : Type u} :
                                                  (Option.map fun (a : α) => a) = id
                                                  @[simp]
                                                  theorem Option.get_map {α : Type u_1} {β : Type u_2} {f : αβ} {o : Option α} {h : (Option.map f o).isSome = true} :
                                                  (Option.map f o).get h = f (o.get )
                                                  @[simp]
                                                  theorem Option.map_map {β : Type u_1} {γ : Type u_2} {α : Type u_3} (h : βγ) (g : αβ) (x : Option α) :
                                                  theorem Option.comp_map {β : Type u_1} {γ : Type u_2} {α : Type u_3} (h : βγ) (g : αβ) (x : Option α) :
                                                  @[simp]
                                                  theorem Option.map_comp_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβ) (g : βγ) :
                                                  theorem Option.mem_map_of_mem {α : Type u_1} {β : Type u_2} {x : Option α} {a : α} (g : αβ) (h : a x) :
                                                  g a Option.map g x
                                                  theorem Option.map_inj_right {α : Type u_1} {β : Type u_2} {f : αβ} {o o' : Option α} (w : ∀ (x y : α), f x = f yx = y) :
                                                  Option.map f o = Option.map f o' o = o'
                                                  @[simp]
                                                  theorem Option.map_if {α : Type u_1} {β : Type u_2} {c : Prop} {a : α} {f : αβ} {x✝ : Decidable c} :
                                                  @[simp]
                                                  theorem Option.map_dif {α : Type u_1} {β : Type u_2} {c : Prop} {f : αβ} {x✝ : Decidable c} {a : cα} :
                                                  Option.map f (if h : c then some (a h) else none) = if h : c then some (f (a h)) else none
                                                  @[simp]
                                                  theorem Option.filter_none {α : Type u_1} (p : αBool) :
                                                  theorem Option.filter_some {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                                  theorem Option.filter_some_pos {α✝ : Type u_1} {p : α✝Bool} {a : α✝} (h : p a = true) :
                                                  theorem Option.filter_some_neg {α✝ : Type u_1} {p : α✝Bool} {a : α✝} (h : p a = false) :
                                                  theorem Option.isSome_of_isSome_filter {α : Type u_1} (p : αBool) (o : Option α) (h : (Option.filter p o).isSome = true) :
                                                  @[reducible, inline, deprecated Option.isSome_of_isSome_filter (since := "2025-03-18")]
                                                  abbrev Option.isSome_filter_of_isSome {α : Type u_1} (p : αBool) (o : Option α) (h : (Option.filter p o).isSome = true) :
                                                  Equations
                                                    Instances For
                                                      @[simp]
                                                      theorem Option.filter_eq_none_iff {α : Type u_1} {o : Option α} {p : αBool} :
                                                      Option.filter p o = none ∀ (a : α), o = some a¬p a = true
                                                      @[reducible, inline, deprecated Option.filter_eq_none_iff (since := "2025-04-10")]
                                                      abbrev Option.filter_eq_none {α : Type u_1} {o : Option α} {p : αBool} :
                                                      Option.filter p o = none ∀ (a : α), o = some a¬p a = true
                                                      Equations
                                                        Instances For
                                                          @[simp]
                                                          theorem Option.filter_eq_some_iff {α : Type u_1} {a : α} {o : Option α} {p : αBool} :
                                                          @[reducible, inline, deprecated Option.filter_eq_some_iff (since := "2025-04-10")]
                                                          abbrev Option.filter_eq_some {α : Type u_1} {a : α} {o : Option α} {p : αBool} :
                                                          Equations
                                                            Instances For
                                                              theorem Option.filter_some_eq_some {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                                              theorem Option.filter_some_eq_none {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                                              theorem Option.mem_filter_iff {α : Type u_1} {p : αBool} {a : α} {o : Option α} :
                                                              a Option.filter p o a o p a = true
                                                              theorem Option.bind_guard {α : Type u_1} (x : Option α) (p : αBool) :
                                                              @[deprecated Option.bind_guard (since := "2025-05-15")]
                                                              theorem Option.filter_eq_bind {α : Type u_1} (x : Option α) (p : αBool) :
                                                              @[simp]
                                                              theorem Option.any_filter {α : Type u_1} {p q : αBool} (o : Option α) :
                                                              Option.any q (Option.filter p o) = Option.any (fun (a : α) => p a && q a) o
                                                              @[simp]
                                                              theorem Option.all_filter {α : Type u_1} {p q : αBool} (o : Option α) :
                                                              Option.all q (Option.filter p o) = Option.all (fun (a : α) => !p a || q a) o
                                                              @[simp]
                                                              theorem Option.isNone_filter {α✝ : Type u_1} {p : α✝Bool} {o : Option α✝} :
                                                              (Option.filter p o).isNone = Option.all (fun (a : α✝) => !p a) o
                                                              @[simp]
                                                              theorem Option.isSome_filter {α✝ : Type u_1} {p : α✝Bool} {o : Option α✝} :
                                                              @[simp]
                                                              theorem Option.filter_filter {α✝ : Type u_1} {q p : α✝Bool} {o : Option α✝} :
                                                              Option.filter q (Option.filter p o) = Option.filter (fun (x : α✝) => p x && q x) o
                                                              theorem Option.filter_bind {α : Type u_1} {β : Type u_2} {x : Option α} {p : βBool} {f : αOption β} :
                                                              Option.filter p (x.bind f) = (Option.filter (fun (a : α) => Option.any p (f a)) x).bind f
                                                              theorem Option.eq_some_of_filter_eq_some {α : Type u_1} {p : αBool} {o : Option α} {a : α} (h : Option.filter p o = some a) :
                                                              o = some a
                                                              theorem Option.filter_map {α : Type u_1} {β : Type u_2} {x : Option α} {f : αβ} {p : βBool} :
                                                              @[simp]
                                                              theorem Option.all_guard {α : Type u_1} {q p : αBool} (a : α) :
                                                              Option.all q (guard p a) = (!p a || q a)
                                                              @[simp]
                                                              theorem Option.any_guard {α : Type u_1} {q p : αBool} (a : α) :
                                                              Option.any q (guard p a) = (p a && q a)
                                                              theorem Option.all_eq_true {α : Type u_1} (p : αBool) (x : Option α) :
                                                              Option.all p x = true ∀ (y : α), x = some yp y = true
                                                              theorem Option.all_eq_true_iff_get {α : Type u_1} (p : αBool) (x : Option α) :
                                                              Option.all p x = true ∀ (h : x.isSome = true), p (x.get h) = true
                                                              theorem Option.all_eq_false {α : Type u_1} (p : αBool) (x : Option α) :
                                                              Option.all p x = false (y : α), x = some y p y = false
                                                              theorem Option.all_eq_false_iff_get {α : Type u_1} (p : αBool) (x : Option α) :
                                                              theorem Option.any_eq_true {α : Type u_1} (p : αBool) (x : Option α) :
                                                              Option.any p x = true (y : α), x = some y p y = true
                                                              theorem Option.any_eq_true_iff_get {α : Type u_1} (p : αBool) (x : Option α) :
                                                              theorem Option.any_eq_false {α : Type u_1} (p : αBool) (x : Option α) :
                                                              Option.any p x = false ∀ (y : α), x = some yp y = false
                                                              theorem Option.any_eq_false_iff_get {α : Type u_1} (p : αBool) (x : Option α) :
                                                              Option.any p x = false ∀ (h : x.isSome = true), p (x.get h) = false
                                                              theorem Option.isSome_of_any {α : Type u_1} {x : Option α} {p : αBool} (h : Option.any p x = true) :
                                                              theorem Option.get_of_any_eq_true {α : Type u_1} (p : αBool) (x : Option α) (h : Option.any p x = true) :
                                                              p (x.get ) = true
                                                              theorem Option.any_map {α : Type u_1} {β : Type u_2} {x : Option α} {f : αβ} {p : βBool} :
                                                              Option.any p (Option.map f x) = Option.any (fun (a : α) => p (f a)) x
                                                              theorem Option.all_map {α : Type u_1} {β : Type u_2} {x : Option α} {f : αβ} {p : βBool} :
                                                              Option.all p (Option.map f x) = Option.all (fun (a : α) => p (f a)) x
                                                              theorem Option.bind_map_comm {α : Type u_1} {β : Type u_2} {x : Option (Option α)} {f : αβ} :
                                                              theorem Option.bind_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : αβ} {g : βOption γ} {x : Option α} :
                                                              (Option.map f x).bind g = x.bind (g f)
                                                              @[simp]
                                                              theorem Option.map_bind {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : αOption β} {g : βγ} {x : Option α} :
                                                              theorem Option.join_map_eq_map_join {α : Type u_1} {β : Type u_2} {f : αβ} {x : Option (Option α)} :
                                                              theorem Option.join_join {α : Type u_1} {x : Option (Option (Option α))} :
                                                              theorem Option.mem_of_mem_join {α : Type u_1} {a : α} {x : Option (Option α)} (h : a x.join) :
                                                              some a x
                                                              theorem Option.any_join {α : Type u_1} {p : αBool} {x : Option (Option α)} :
                                                              theorem Option.all_join {α : Type u_1} {p : αBool} {x : Option (Option α)} :
                                                              theorem Option.get_join {α : Type u_1} {x : Option (Option α)} {h : x.join.isSome = true} :
                                                              x.join.get h = (x.get ).get
                                                              theorem Option.join_eq_get {α : Type u_1} {x : Option (Option α)} {h : x.isSome = true} :
                                                              x.join = x.get h
                                                              theorem Option.getD_join {α : Type u_1} {x : Option (Option α)} {default : α} :
                                                              x.join.getD default = (x.getD (some default)).getD default
                                                              theorem Option.get!_join {α : Type u_1} [Inhabited α] {x : Option (Option α)} :
                                                              @[simp]
                                                              theorem Option.guard_eq_some_iff {α✝ : Type u_1} {p : α✝Bool} {a b : α✝} :
                                                              guard p a = some b a = b p a = true
                                                              @[reducible, inline, deprecated Option.guard_eq_some_iff (since := "2025-04-10")]
                                                              abbrev Option.guard_eq_some {α✝ : Type u_1} {p : α✝Bool} {a b : α✝} :
                                                              guard p a = some b a = b p a = true
                                                              Equations
                                                                Instances For
                                                                  @[simp]
                                                                  theorem Option.isSome_guard {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                                                  (guard p a).isSome = p a
                                                                  @[reducible, inline, deprecated Option.isSome_guard (since := "2025-03-18")]
                                                                  abbrev Option.guard_isSome {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                                                  (guard p a).isSome = p a
                                                                  Equations
                                                                    Instances For
                                                                      @[simp]
                                                                      theorem Option.isNone_guard {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                                                      (guard p a).isNone = !p a
                                                                      @[simp]
                                                                      theorem Option.guard_eq_none_iff {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                                                      guard p a = none p a = false
                                                                      @[simp]
                                                                      theorem Option.guard_pos {α✝ : Type u_1} {p : α✝Bool} {a : α✝} (h : p a = true) :
                                                                      guard p a = some a
                                                                      theorem Option.guard_congr {α : Type u_1} {f g : αBool} (h : ∀ (a : α), f a = g a) :
                                                                      @[simp]
                                                                      theorem Option.guard_false {α : Type u_1} :
                                                                      (guard fun (x : α) => false) = fun (x : α) => none
                                                                      @[simp]
                                                                      theorem Option.guard_true {α : Type u_1} :
                                                                      (guard fun (x : α) => true) = some
                                                                      theorem Option.guard_comp {α : Type u_1} {β : Type u_2} {p : αBool} {f : βα} :
                                                                      theorem Option.get_none {α : Type u_1} (a : α) {h : none.isSome = true} :
                                                                      none.get h = a
                                                                      @[simp]
                                                                      theorem Option.get_none_eq_iff_true {α : Type u_1} {a : α} {h : none.isSome = true} :
                                                                      @[simp]
                                                                      theorem Option.get_guard {α✝ : Type u_1} {p : α✝Bool} {a : α✝} {h : (guard p a).isSome = true} :
                                                                      (guard p a).get h = a
                                                                      theorem Option.guard_def {α : Type u_1} (p : αBool) :
                                                                      guard p = fun (x : α) => if p x = true then some x else none
                                                                      @[deprecated Option.guard_def (since := "2025-05-15")]
                                                                      theorem Option.guard_eq_map {α : Type u_1} (p : αBool) :
                                                                      guard p = fun (x : α) => Option.map (fun (x_1 : α) => x) (if p x = true then some x else none)
                                                                      theorem Option.guard_eq_ite {α : Type u_1} {p : αBool} {x : α} :
                                                                      theorem Option.guard_eq_filter {α : Type u_1} {p : αBool} {x : α} :
                                                                      @[simp]
                                                                      theorem Option.filter_guard {α : Type u_1} {p q : αBool} {x : α} :
                                                                      Option.filter q (guard p x) = guard (fun (y : α) => p y && q y) x
                                                                      theorem Option.map_guard {α : Type u_1} {β : Type u_2} {p : αBool} {f : αβ} {x : α} :
                                                                      Option.map f (guard p x) = if p x = true then some (f x) else none
                                                                      theorem Option.join_filter {α : Type u_1} {p : Option αBool} {o : Option (Option α)} :
                                                                      (Option.filter p o).join = Option.filter (fun (a : α) => p (some a)) o.join
                                                                      theorem Option.filter_join {α : Type u_1} {p : αBool} {o : Option (Option α)} :
                                                                      theorem Option.merge_eq_or_eq {α : Type u_1} {f : ααα} (h : ∀ (a b : α), f a b = a f a b = b) (o₁ o₂ : Option α) :
                                                                      merge f o₁ o₂ = o₁ merge f o₁ o₂ = o₂
                                                                      @[simp]
                                                                      theorem Option.merge_none_left {α : Type u_1} {f : ααα} {b : Option α} :
                                                                      merge f none b = b
                                                                      @[simp]
                                                                      theorem Option.merge_none_right {α : Type u_1} {f : ααα} {a : Option α} :
                                                                      merge f a none = a
                                                                      @[simp]
                                                                      theorem Option.merge_some_some {α : Type u_1} {f : ααα} {a b : α} :
                                                                      merge f (some a) (some b) = some (f a b)
                                                                      @[deprecated Option.merge_eq_or_eq (since := "2025-04-04")]
                                                                      theorem Option.liftOrGet_eq_or_eq {α : Type u_1} {f : ααα} (h : ∀ (a b : α), f a b = a f a b = b) (o₁ o₂ : Option α) :
                                                                      merge f o₁ o₂ = o₁ merge f o₁ o₂ = o₂
                                                                      @[deprecated Option.merge_none_left (since := "2025-04-04")]
                                                                      theorem Option.liftOrGet_none_left {α : Type u_1} {f : ααα} {b : Option α} :
                                                                      merge f none b = b
                                                                      @[deprecated Option.merge_none_right (since := "2025-04-04")]
                                                                      theorem Option.liftOrGet_none_right {α : Type u_1} {f : ααα} {a : Option α} :
                                                                      merge f a none = a
                                                                      @[deprecated Option.merge_some_some (since := "2025-04-04")]
                                                                      theorem Option.liftOrGet_some_some {α : Type u_1} {f : ααα} {a b : α} :
                                                                      merge f (some a) (some b) = some (f a b)
                                                                      instance Option.commutative_merge {α : Type u_1} (f : ααα) [Std.Commutative f] :
                                                                      instance Option.associative_merge {α : Type u_1} (f : ααα) [Std.Associative f] :
                                                                      instance Option.idempotentOp_merge {α : Type u_1} (f : ααα) [Std.IdempotentOp f] :
                                                                      instance Option.lawfulIdentity_merge {α : Type u_1} (f : ααα) :
                                                                      theorem Option.merge_join {α : Type u_1} {o o' : Option (Option α)} {f : ααα} :
                                                                      merge f o.join o'.join = (merge (merge f) o o').join
                                                                      theorem Option.merge_eq_some_iff {α : Type u_1} {o o' : Option α} {f : ααα} {a : α} :
                                                                      merge f o o' = some a o = some a o' = none o = none o' = some a (b : α), (c : α), o = some b o' = some c f b c = a
                                                                      @[simp]
                                                                      theorem Option.merge_eq_none_iff {α : Type u_1} {f : ααα} {o o' : Option α} :
                                                                      merge f o o' = none o = none o' = none
                                                                      @[simp]
                                                                      theorem Option.any_merge {α : Type u_1} {p : αBool} {f : ααα} (hpf : ∀ (a b : α), p (f a b) = (p a || p b)) {o o' : Option α} :
                                                                      Option.any p (merge f o o') = (Option.any p o || Option.any p o')
                                                                      @[simp]
                                                                      theorem Option.all_merge {α : Type u_1} {p : αBool} {f : ααα} (hpf : ∀ (a b : α), p (f a b) = (p a && p b)) {o o' : Option α} :
                                                                      Option.all p (merge f o o') = (Option.all p o && Option.all p o')
                                                                      @[simp]
                                                                      theorem Option.isSome_merge {α : Type u_1} {o o' : Option α} {f : ααα} :
                                                                      (merge f o o').isSome = (o.isSome || o'.isSome)
                                                                      @[simp]
                                                                      theorem Option.isNone_merge {α : Type u_1} {o o' : Option α} {f : ααα} :
                                                                      (merge f o o').isNone = (o.isNone && o'.isNone)
                                                                      @[simp]
                                                                      theorem Option.get_merge {α : Type u_1} {o o' : Option α} {f : ααα} {i : α} [Std.LawfulIdentity f i] {h : (merge f o o').isSome = true} :
                                                                      (merge f o o').get h = f (o.getD i) (o'.getD i)
                                                                      @[simp]
                                                                      theorem Option.elim_none {β : Sort u_1} {α : Type u_2} (x : β) (f : αβ) :
                                                                      none.elim x f = x
                                                                      @[simp]
                                                                      theorem Option.elim_some {β : Sort u_1} {α : Type u_2} (x : β) (f : αβ) (a : α) :
                                                                      (some a).elim x f = f a
                                                                      theorem Option.elim_filter {α : Type u_1} {β : Sort u_2} {p : αBool} {f : αβ} {o : Option α} {b : β} :
                                                                      (Option.filter p o).elim b f = o.elim b fun (a : α) => if p a = true then f a else b
                                                                      theorem Option.elim_join {α : Type u_1} {β : Sort u_2} {o : Option (Option α)} {b : β} {f : αβ} :
                                                                      o.join.elim b f = o.elim b fun (x : Option α) => x.elim b f
                                                                      theorem Option.elim_guard {α✝ : Type u_1} {p : α✝Bool} {a : α✝} {α✝¹ : Sort u_2} {b : α✝¹} {f : α✝α✝¹} :
                                                                      (guard p a).elim b f = if p a = true then f a else b
                                                                      @[simp]
                                                                      theorem Option.getD_map {α : Type u_1} {β : Type u_2} (f : αβ) (x : α) (o : Option α) :
                                                                      (Option.map f o).getD (f x) = f (o.getD x)
                                                                      noncomputable def Option.choice (α : Type u_1) :

                                                                      An optional arbitrary element of a given type.

                                                                      If α is non-empty, then there exists some v : α and this arbitrary element is some v. Otherwise, it is none.

                                                                      Equations
                                                                        Instances For
                                                                          theorem Option.choice_eq_some {α : Type u_1} [Subsingleton α] (a : α) :
                                                                          @[reducible, inline, deprecated Option.choice_eq_some (since := "2025-05-12")]
                                                                          abbrev Option.choice_eq {α : Type u_1} [Subsingleton α] (a : α) :
                                                                          Equations
                                                                            Instances For
                                                                              @[simp]
                                                                              theorem Option.isSome_choice {α : Type u_1} [Nonempty α] :
                                                                              @[reducible, inline, deprecated Option.isSome_choice_iff_nonempty (since := "2025-03-18")]
                                                                              Equations
                                                                                Instances For
                                                                                  @[simp]
                                                                                  @[simp]
                                                                                  theorem Option.getD_choice {α : Type u_1} {a : α} :
                                                                                  (choice α).getD a = (choice α).get
                                                                                  @[simp]
                                                                                  theorem Option.get!_choice {α : Type u_1} [Inhabited α] :
                                                                                  (choice α).get! = (choice α).get
                                                                                  @[simp]
                                                                                  theorem Option.toList_some {α : Type u_1} (a : α) :
                                                                                  @[simp]
                                                                                  theorem Option.toList_none (α : Type u_1) :
                                                                                  @[simp]
                                                                                  theorem Option.toArray_some {α : Type u_1} (a : α) :
                                                                                  @[simp]
                                                                                  @[simp]
                                                                                  theorem Option.some_or {α✝ : Type u_1} {a : α✝} {o : Option α✝} :
                                                                                  (some a).or o = some a
                                                                                  @[simp]
                                                                                  theorem Option.none_or {α✝ : Type u_1} {o : Option α✝} :
                                                                                  none.or o = o
                                                                                  theorem Option.or_eq_right_of_none {α : Type u_1} {o o' : Option α} (h : o = none) :
                                                                                  o.or o' = o'
                                                                                  @[simp]
                                                                                  theorem Option.or_some {α : Type u_1} {a : α} {o : Option α} :
                                                                                  o.or (some a) = some (o.getD a)
                                                                                  @[reducible, inline, deprecated Option.or_some (since := "2025-05-03")]
                                                                                  abbrev Option.or_some' {α : Type u_1} {a : α} {o : Option α} :
                                                                                  o.or (some a) = some (o.getD a)
                                                                                  Equations
                                                                                    Instances For
                                                                                      @[simp]
                                                                                      theorem Option.or_none {α✝ : Type u_1} {o : Option α✝} :
                                                                                      o.or none = o
                                                                                      theorem Option.or_eq_bif {α✝ : Type u_1} {o o' : Option α✝} :
                                                                                      o.or o' = bif o.isSome then o else o'
                                                                                      @[simp]
                                                                                      theorem Option.isSome_or {α✝ : Type u_1} {o o' : Option α✝} :
                                                                                      (o.or o').isSome = (o.isSome || o'.isSome)
                                                                                      @[simp]
                                                                                      theorem Option.isNone_or {α✝ : Type u_1} {o o' : Option α✝} :
                                                                                      (o.or o').isNone = (o.isNone && o'.isNone)
                                                                                      @[simp]
                                                                                      theorem Option.or_eq_none_iff {α✝ : Type u_1} {o o' : Option α✝} :
                                                                                      o.or o' = none o = none o' = none
                                                                                      @[reducible, inline, deprecated Option.or_eq_none_iff (since := "2025-04-10")]
                                                                                      abbrev Option.or_eq_none {α✝ : Type u_1} {o o' : Option α✝} :
                                                                                      o.or o' = none o = none o' = none
                                                                                      Equations
                                                                                        Instances For
                                                                                          @[simp]
                                                                                          theorem Option.or_eq_some_iff {α✝ : Type u_1} {o o' : Option α✝} {a : α✝} :
                                                                                          o.or o' = some a o = some a o = none o' = some a
                                                                                          @[reducible, inline, deprecated Option.or_eq_some_iff (since := "2025-04-10")]
                                                                                          abbrev Option.or_eq_some {α✝ : Type u_1} {o o' : Option α✝} {a : α✝} :
                                                                                          o.or o' = some a o = some a o = none o' = some a
                                                                                          Equations
                                                                                            Instances For
                                                                                              theorem Option.or_assoc {α✝ : Type u_1} {o₁ o₂ o₃ : Option α✝} :
                                                                                              (o₁.or o₂).or o₃ = o₁.or (o₂.or o₃)
                                                                                              theorem Option.or_eq_left_of_none {α : Type u_1} {o o' : Option α} (h : o' = none) :
                                                                                              o.or o' = o
                                                                                              @[simp]
                                                                                              theorem Option.or_self {α✝ : Type u_1} {o : Option α✝} :
                                                                                              o.or o = o
                                                                                              theorem Option.map_or {α✝ : Type u_1} {o o' : Option α✝} {α✝¹ : Type u_2} {f : α✝α✝¹} :
                                                                                              Option.map f (o.or o') = (Option.map f o).or (Option.map f o')
                                                                                              @[reducible, inline, deprecated Option.map_or (since := "2025-04-10")]
                                                                                              abbrev Option.map_or' {α✝ : Type u_1} {o o' : Option α✝} {α✝¹ : Type u_2} {f : α✝α✝¹} :
                                                                                              Option.map f (o.or o') = (Option.map f o).or (Option.map f o')
                                                                                              Equations
                                                                                                Instances For
                                                                                                  theorem Option.or_of_isSome {α : Type u_1} {o o' : Option α} (h : o.isSome = true) :
                                                                                                  o.or o' = o
                                                                                                  theorem Option.or_of_isNone {α : Type u_1} {o o' : Option α} (h : o.isNone = true) :
                                                                                                  o.or o' = o'
                                                                                                  @[simp]
                                                                                                  theorem Option.getD_or {α : Type u_1} {o o' : Option α} {fallback : α} :
                                                                                                  (o.or o').getD fallback = o.getD (o'.getD fallback)
                                                                                                  @[simp]
                                                                                                  theorem Option.get!_or {α : Type u_1} {o o' : Option α} [Inhabited α] :
                                                                                                  (o.or o').get! = o.getD o'.get!
                                                                                                  @[simp]
                                                                                                  theorem Option.filter_or_filter {α : Type u_1} {o o' : Option α} {f : αBool} :
                                                                                                  theorem Option.guard_or_guard {α✝ : Type u_1} {p : α✝Bool} {a : α✝} {q : α✝Bool} :
                                                                                                  (guard p a).or (guard q a) = guard (fun (x : α✝) => p x || q x) a

                                                                                                  orElse #

                                                                                                  @[simp]

                                                                                                  The simp normal form of o <|> o' is o.or o' via orElse_eq_orElse and orElse_eq_or.

                                                                                                  theorem Option.or_eq_orElse {α✝ : Type u_1} {o o' : Option α✝} :
                                                                                                  o.or o' = o.orElse fun (x : Unit) => o'
                                                                                                  @[simp]
                                                                                                  theorem Option.orElse_eq_or {α : Type u_1} {o : Option α} {f : UnitOption α} :
                                                                                                  o.orElse f = o.or (f ())

                                                                                                  The simp normal form of o.orElse f is o.or (f ())`.

                                                                                                  @[deprecated Option.or_some (since := "2025-05-03")]
                                                                                                  theorem Option.some_orElse {α : Type u_1} (a : α) (f : UnitOption α) :
                                                                                                  (some a).orElse f = some a
                                                                                                  @[deprecated Option.or_none (since := "2025-05-03")]
                                                                                                  theorem Option.none_orElse {α : Type u_1} (f : UnitOption α) :
                                                                                                  @[deprecated Option.or_none (since := "2025-05-13")]
                                                                                                  theorem Option.orElse_fun_none {α : Type u_1} (x : Option α) :
                                                                                                  (x.orElse fun (x : Unit) => none) = x
                                                                                                  @[deprecated Option.or_some (since := "2025-05-13")]
                                                                                                  theorem Option.orElse_fun_some {α : Type u_1} (x : Option α) (a : α) :
                                                                                                  (x.orElse fun (x : Unit) => some a) = some (x.getD a)
                                                                                                  @[deprecated Option.or_eq_some_iff (since := "2025-05-13")]
                                                                                                  theorem Option.orElse_eq_some_iff {α : Type u_1} (o : Option α) (f : UnitOption α) (x : α) :
                                                                                                  o.orElse f = some x o = some x o = none f () = some x
                                                                                                  @[deprecated Option.or_eq_none_iff (since := "2025-05-13")]
                                                                                                  theorem Option.orElse_eq_none_iff {α : Type u_1} (o : Option α) (f : UnitOption α) :
                                                                                                  @[deprecated Option.map_or (since := "2025-05-13")]
                                                                                                  theorem Option.map_orElse {α : Type u_1} {α✝ : Type u_2} {f : αα✝} {x : Option α} {y : UnitOption α} :
                                                                                                  Option.map f (x.orElse y) = (Option.map f x).orElse fun (x : Unit) => Option.map f (y ())

                                                                                                  beq #

                                                                                                  @[simp]
                                                                                                  theorem Option.none_beq_none {α : Type u_1} [BEq α] :
                                                                                                  @[simp]
                                                                                                  theorem Option.none_beq_some {α : Type u_1} [BEq α] (a : α) :
                                                                                                  @[simp]
                                                                                                  theorem Option.some_beq_none {α : Type u_1} [BEq α] (a : α) :
                                                                                                  @[simp]
                                                                                                  theorem Option.some_beq_some {α : Type u_1} [BEq α] {a b : α} :
                                                                                                  (some a == some b) = (a == b)
                                                                                                  @[simp]
                                                                                                  theorem Option.isEqSome_eq_beq_some {α : Type u_1} [BEq α] {y : α} {o : Option α} :
                                                                                                  o.isEqSome y = (o == some y)

                                                                                                  We simplify away isEqSome in terms of ==.

                                                                                                  @[simp]
                                                                                                  theorem Option.reflBEq_iff {α : Type u_1} [BEq α] :
                                                                                                  @[simp]
                                                                                                  theorem Option.lawfulBEq_iff {α : Type u_1} [BEq α] :
                                                                                                  @[simp]
                                                                                                  theorem Option.beq_none {α : Type u_1} [BEq α] {o : Option α} :
                                                                                                  (o == none) = o.isNone
                                                                                                  @[simp]
                                                                                                  theorem Option.filter_beq_self {α : Type u_1} [BEq α] [ReflBEq α] {p : αBool} {o : Option α} :
                                                                                                  @[simp]
                                                                                                  theorem Option.self_beq_filter {α : Type u_1} [BEq α] [ReflBEq α] {p : αBool} {o : Option α} :
                                                                                                  theorem Option.join_beq_some {α : Type u_1} [BEq α] {o : Option (Option α)} {a : α} :
                                                                                                  (o.join == some a) = (o == some (some a))
                                                                                                  theorem Option.join_beq_none {α : Type u_1} [BEq α] {o : Option (Option α)} :
                                                                                                  @[simp]
                                                                                                  theorem Option.guard_beq_some {α : Type u_1} [BEq α] [ReflBEq α] {x : α} {p : αBool} :
                                                                                                  (guard p x == some x) = p x
                                                                                                  theorem Option.guard_beq_none {α : Type u_1} [BEq α] {x : α} {p : αBool} :
                                                                                                  (guard p x == none) = !p x
                                                                                                  theorem Option.merge_beq_none {α : Type u_1} [BEq α] {o o' : Option α} {f : ααα} :
                                                                                                  (merge f o o' == none) = (o == none && o' == none)

                                                                                                  ite #

                                                                                                  @[simp]
                                                                                                  theorem Option.dite_none_left_eq_some {β : Type u_1} {a : β} {p : Prop} {x✝ : Decidable p} {b : ¬pOption β} :
                                                                                                  (if h : p then none else b h) = some a (h : ¬p), b h = some a
                                                                                                  @[simp]
                                                                                                  theorem Option.dite_none_right_eq_some {α : Type u_1} {a : α} {p : Prop} {x✝ : Decidable p} {b : pOption α} :
                                                                                                  (if h : p then b h else none) = some a (h : p), b h = some a
                                                                                                  @[simp]
                                                                                                  theorem Option.some_eq_dite_none_left {β : Type u_1} {a : β} {p : Prop} {x✝ : Decidable p} {b : ¬pOption β} :
                                                                                                  (some a = if h : p then none else b h) (h : ¬p), some a = b h
                                                                                                  @[simp]
                                                                                                  theorem Option.some_eq_dite_none_right {α : Type u_1} {a : α} {p : Prop} {x✝ : Decidable p} {b : pOption α} :
                                                                                                  (some a = if h : p then b h else none) (h : p), some a = b h
                                                                                                  @[simp]
                                                                                                  theorem Option.ite_none_left_eq_some {β : Type u_1} {a : β} {p : Prop} {x✝ : Decidable p} {b : Option β} :
                                                                                                  (if p then none else b) = some a ¬p b = some a
                                                                                                  @[simp]
                                                                                                  theorem Option.ite_none_right_eq_some {α : Type u_1} {a : α} {p : Prop} {x✝ : Decidable p} {b : Option α} :
                                                                                                  (if p then b else none) = some a p b = some a
                                                                                                  @[simp]
                                                                                                  theorem Option.some_eq_ite_none_left {β : Type u_1} {a : β} {p : Prop} {x✝ : Decidable p} {b : Option β} :
                                                                                                  (some a = if p then none else b) ¬p some a = b
                                                                                                  @[simp]
                                                                                                  theorem Option.some_eq_ite_none_right {α : Type u_1} {a : α} {p : Prop} {x✝ : Decidable p} {b : Option α} :
                                                                                                  (some a = if p then b else none) p some a = b
                                                                                                  theorem Option.ite_some_none_eq_some {α : Type u_1} {p : Prop} {x✝ : Decidable p} {a b : α} :
                                                                                                  (if p then some a else none) = some b p a = b
                                                                                                  theorem Option.mem_dite_none_left {α : Type u_1} {p : Prop} {x : α} {x✝ : Decidable p} {l : ¬pOption α} :
                                                                                                  (x if h : p then none else l h) (h : ¬p), x l h
                                                                                                  theorem Option.mem_dite_none_right {α : Type u_1} {p : Prop} {x : α} {x✝ : Decidable p} {l : pOption α} :
                                                                                                  (x if h : p then l h else none) (h : p), x l h
                                                                                                  theorem Option.mem_ite_none_left {α : Type u_1} {p : Prop} {x : α} {x✝ : Decidable p} {l : Option α} :
                                                                                                  (x if p then none else l) ¬p x l
                                                                                                  theorem Option.mem_ite_none_right {α : Type u_1} {p : Prop} {x : α} {x✝ : Decidable p} {l : Option α} :
                                                                                                  (x if p then l else none) p x l
                                                                                                  @[simp]
                                                                                                  theorem Option.isSome_dite {β : Type u_1} {p : Prop} {x✝ : Decidable p} {b : pβ} :
                                                                                                  (if h : p then some (b h) else none).isSome = true p
                                                                                                  @[simp]
                                                                                                  theorem Option.isSome_ite {α✝ : Type u_1} {b : α✝} {p : Prop} {x✝ : Decidable p} :
                                                                                                  @[simp]
                                                                                                  theorem Option.isSome_dite' {β : Type u_1} {p : Prop} {x✝ : Decidable p} {b : ¬pβ} :
                                                                                                  (if h : p then none else some (b h)).isSome = true ¬p
                                                                                                  @[simp]
                                                                                                  theorem Option.isSome_ite' {α✝ : Type u_1} {b : α✝} {p : Prop} {x✝ : Decidable p} :
                                                                                                  @[simp]
                                                                                                  theorem Option.get_dite {β : Type u_1} {p : Prop} {x✝ : Decidable p} (b : pβ) (w : (if h : p then some (b h) else none).isSome = true) :
                                                                                                  (if h : p then some (b h) else none).get w = b
                                                                                                  @[simp]
                                                                                                  theorem Option.get_ite {α✝ : Type u_1} {b : α✝} {p : Prop} {x✝ : Decidable p} (h : (if p then some b else none).isSome = true) :
                                                                                                  (if p then some b else none).get h = b
                                                                                                  @[simp]
                                                                                                  theorem Option.get_dite' {β : Type u_1} {p : Prop} {x✝ : Decidable p} (b : ¬pβ) (w : (if h : p then none else some (b h)).isSome = true) :
                                                                                                  (if h : p then none else some (b h)).get w = b
                                                                                                  @[simp]
                                                                                                  theorem Option.get_ite' {α✝ : Type u_1} {b : α✝} {p : Prop} {x✝ : Decidable p} (h : (if p then none else some b).isSome = true) :
                                                                                                  (if p then none else some b).get h = b
                                                                                                  @[simp]
                                                                                                  theorem Option.get_filter {α : Type u_1} {x : Option α} {f : αBool} (h : (Option.filter f x).isSome = true) :
                                                                                                  (Option.filter f x).get h = x.get

                                                                                                  pbind #

                                                                                                  @[simp]
                                                                                                  theorem Option.pbind_none {α✝ : Type u_1} {α✝¹ : Type u_2} {f : (a : α✝) → none = some aOption α✝¹} :
                                                                                                  @[simp]
                                                                                                  theorem Option.pbind_some {α✝ : Type u_1} {a : α✝} {α✝¹ : Type u_2} {f : (a_1 : α✝) → some a = some a_1Option α✝¹} :
                                                                                                  (some a).pbind f = f a
                                                                                                  theorem Option.pbind_none' {α✝ : Type u_1} {x : Option α✝} {α✝¹ : Type u_2} {f : (a : α✝) → x = some aOption α✝¹} (h : x = none) :
                                                                                                  theorem Option.pbind_some' {α✝ : Type u_1} {x : Option α✝} {a : α✝} {α✝¹ : Type u_2} {f : (a : α✝) → x = some aOption α✝¹} (h : x = some a) :
                                                                                                  x.pbind f = f a h
                                                                                                  @[simp]
                                                                                                  theorem Option.map_pbind {α : Type u_1} {β : Type u_2} {γ : Type u_3} {o : Option α} {f : (a : α) → o = some aOption β} {g : βγ} :
                                                                                                  Option.map g (o.pbind f) = o.pbind fun (a : α) (h : o = some a) => Option.map g (f a h)
                                                                                                  @[simp]
                                                                                                  theorem Option.pbind_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} (o : Option α) (f : αβ) (g : (x : β) → Option.map f o = some xOption γ) :
                                                                                                  (Option.map f o).pbind g = o.pbind fun (x : α) (h : o = some x) => g (f x)
                                                                                                  @[simp]
                                                                                                  theorem Option.pbind_eq_bind {α : Type u_1} {β : Type u_2} (o : Option α) (f : αOption β) :
                                                                                                  (o.pbind fun (x : α) (x_1 : o = some x) => f x) = o.bind f
                                                                                                  theorem Option.pbind_congr {α : Type u_1} {β : Type u_2} {o o' : Option α} (ho : o = o') {f : (a : α) → o = some aOption β} {g : (a : α) → o' = some aOption β} (hf : ∀ (a : α) (h : o' = some a), f a = g a h) :
                                                                                                  o.pbind f = o'.pbind g
                                                                                                  theorem Option.pbind_eq_none_iff {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} :
                                                                                                  o.pbind f = none o = none (a : α), (h : o = some a), f a h = none
                                                                                                  theorem Option.isSome_pbind_iff {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} :
                                                                                                  (o.pbind f).isSome = true (a : α), (h : o = some a), (f a h).isSome = true
                                                                                                  theorem Option.isNone_pbind_iff {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} :
                                                                                                  (o.pbind f).isNone = true o = none (a : α), (h : o = some a), f a h = none
                                                                                                  @[deprecated "isSome_pbind_iff" (since := "2025-04-01")]
                                                                                                  theorem Option.pbind_isSome {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} :
                                                                                                  ((o.pbind f).isSome = true) = (a : α), (h : o = some a), (f a h).isSome = true
                                                                                                  theorem Option.pbind_eq_some_iff {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} {b : β} :
                                                                                                  o.pbind f = some b (a : α), (h : o = some a), f a h = some b
                                                                                                  theorem Option.pbind_join {α : Type u_1} {β : Type u_2} {o : Option (Option α)} {f : (a : α) → o.join = some aOption β} :
                                                                                                  o.join.pbind f = o.pbind fun (o' : Option α) (ho' : o = some o') => o'.pbind fun (a : α) (ha : o' = some a) => f a
                                                                                                  theorem Option.isSome_of_isSome_pbind {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} :
                                                                                                  (o.pbind f).isSome = trueo.isSome = true
                                                                                                  theorem Option.isSome_get_of_isSome_pbind {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} (h : (o.pbind f).isSome = true) :
                                                                                                  (f (o.get ) ).isSome = true
                                                                                                  @[simp]
                                                                                                  theorem Option.get_pbind {α : Type u_1} {β : Type u_2} {o : Option α} {f : (a : α) → o = some aOption β} {h : (o.pbind f).isSome = true} :
                                                                                                  (o.pbind f).get h = (f (o.get ) ).get

                                                                                                  pmap #

                                                                                                  @[simp]
                                                                                                  theorem Option.pmap_none {α : Type u_1} {β : Type u_2} {p : αProp} {f : (a : α) → p aβ} {h : ∀ (a : α), none = some ap a} :
                                                                                                  @[simp]
                                                                                                  theorem Option.pmap_some {α : Type u_1} {β : Type u_2} {a : α} {p : αProp} {f : (a : α) → p aβ} {h : ∀ (a_1 : α), some a = some a_1p a_1} :
                                                                                                  pmap f (some a) h = some (f a )
                                                                                                  theorem Option.pmap_none' {α : Type u_1} {β : Type u_2} {x : Option α} {p : αProp} {f : (a : α) → p aβ} (he : x = none) {h : ∀ (a : α), x = some ap a} :
                                                                                                  pmap f x h = none
                                                                                                  theorem Option.pmap_some' {α : Type u_1} {β : Type u_2} {x : Option α} {a : α} {p : αProp} {f : (a : α) → p aβ} (he : x = some a) {h : ∀ (a : α), x = some ap a} :
                                                                                                  pmap f x h = some (f a )
                                                                                                  @[simp]
                                                                                                  theorem Option.pmap_eq_none_iff {α : Type u_1} {β : Type u_2} {o : Option α} {p : αProp} {f : (a : α) → p aβ} {h : ∀ (a : α), o = some ap a} :
                                                                                                  pmap f o h = none o = none
                                                                                                  @[simp]
                                                                                                  theorem Option.isSome_pmap {α : Type u_1} {β : Type u_2} {p : αProp} {f : (a : α) → p aβ} {o : Option α} {h : ∀ (a : α), o = some ap a} :
                                                                                                  (pmap f o h).isSome = o.isSome
                                                                                                  @[simp]
                                                                                                  theorem Option.isNone_pmap {α : Type u_1} {β : Type u_2} {p : αProp} {f : (a : α) → p aβ} {o : Option α} {h : ∀ (a : α), o = some ap a} :
                                                                                                  (pmap f o h).isNone = o.isNone
                                                                                                  @[reducible, inline, deprecated Option.isSome_pmap (since := "2025-04-01")]
                                                                                                  abbrev Option.pmap_isSome {α : Type u_1} {β : Type u_2} {p : αProp} {f : (a : α) → p aβ} {o : Option α} {h : ∀ (a : α), o = some ap a} :
                                                                                                  (pmap f o h).isSome = o.isSome
                                                                                                  Equations
                                                                                                    Instances For
                                                                                                      @[simp]
                                                                                                      theorem Option.pmap_eq_some_iff {α : Type u_1} {β : Type u_2} {b : β} {p : αProp} {f : (a : α) → p aβ} {o : Option α} {h : ∀ (a : α), o = some ap a} :
                                                                                                      pmap f o h = some b (a : α), (h : p a), o = some a b = f a h
                                                                                                      @[simp]
                                                                                                      theorem Option.pmap_eq_map {α : Type u_1} {β : Type u_2} (p : αProp) (f : αβ) (o : Option α) (H : ∀ (a : α), o = some ap a) :
                                                                                                      pmap (fun (a : α) (x : p a) => f a) o H = Option.map f o
                                                                                                      theorem Option.map_pmap {α : Type u_1} {β : Type u_2} {γ : Type u_3} {p : αProp} (g : βγ) (f : (a : α) → p aβ) (o : Option α) (H : ∀ (a : α), o = some ap a) :
                                                                                                      Option.map g (pmap f o H) = pmap (fun (a : α) (h : p a) => g (f a h)) o H
                                                                                                      theorem Option.pmap_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} (o : Option α) (f : αβ) {p : βProp} (g : (b : β) → p bγ) (H : ∀ (a : β), Option.map f o = some ap a) :
                                                                                                      pmap g (Option.map f o) H = pmap (fun (a : α) (h : p (f a)) => g (f a) h) o
                                                                                                      theorem Option.pmap_or {α : Type u_1} {β : Type u_2} {p : αProp} {f : (a : α) → p aβ} {o o' : Option α} {h : ∀ (a : α), o.or o' = some ap a} :
                                                                                                      pmap f (o.or o') h = match o, h with | none, h => pmap f o' | some a, h => some (f a )
                                                                                                      theorem Option.pmap_pred_congr {α : Type u} {p p' : αProp} (hp : ∀ (x : α), p x p' x) {o o' : Option α} (ho : o = o') (h : ∀ (x : α), o = some xp x) (x : α) :
                                                                                                      o' = some xp' x
                                                                                                      theorem Option.pmap_congr {α : Type u} {β : Type v} {p p' : αProp} (hp : ∀ (x : α), p x p' x) {f : (x : α) → p xβ} {f' : (x : α) → p' xβ} (hf : ∀ (x : α) (h : p' x), f x = f' x h) {o o' : Option α} (ho : o = o') {h : ∀ (x : α), o = some xp x} :
                                                                                                      pmap f o h = pmap f' o'
                                                                                                      theorem Option.pmap_guard {α : Type u_1} {β : Type u_2} {q : αBool} {p : αProp} (f : (x : α) → p xβ) {x : α} (h : ∀ (a : α), guard q x = some ap a) :
                                                                                                      pmap f (guard q x) h = if h' : q x = true then some (f x ) else none
                                                                                                      @[simp]
                                                                                                      theorem Option.get_pmap {α : Type u_1} {β : Type u_2} {p : αBool} {f : (x : α) → p x = trueβ} {o : Option α} {h : ∀ (a : α), o = some ap a = true} {h' : (pmap f o h).isSome = true} :
                                                                                                      (pmap f o h).get h' = f (o.get )

                                                                                                      pelim #

                                                                                                      @[simp]
                                                                                                      theorem Option.pelim_none {α✝ : Sort u_1} {b : α✝} {α✝¹ : Type u_2} {f : (a : α✝¹) → none = some aα✝} :
                                                                                                      none.pelim b f = b
                                                                                                      @[simp]
                                                                                                      theorem Option.pelim_some {α✝ : Type u_1} {a : α✝} {α✝¹ : Sort u_2} {b : α✝¹} {f : (a_1 : α✝) → some a = some a_1α✝¹} :
                                                                                                      (some a).pelim b f = f a
                                                                                                      theorem Option.pelim_none' {α✝ : Type u_1} {x : Option α✝} {α✝¹ : Sort u_2} {b : α✝¹} {f : (a : α✝) → x = some aα✝¹} (h : x = none) :
                                                                                                      x.pelim b f = b
                                                                                                      theorem Option.pelim_some' {α✝ : Type u_1} {x : Option α✝} {a : α✝} {α✝¹ : Sort u_2} {b : α✝¹} {f : (a : α✝) → x = some aα✝¹} (h : x = some a) :
                                                                                                      x.pelim b f = f a h
                                                                                                      @[simp]
                                                                                                      theorem Option.pelim_eq_elim {α✝ : Type u_1} {o : Option α✝} {α✝¹ : Sort u_2} {b : α✝¹} {f : α✝α✝¹} :
                                                                                                      (o.pelim b fun (a : α✝) (x : o = some a) => f a) = o.elim b f
                                                                                                      @[simp]
                                                                                                      theorem Option.elim_pmap {α : Type u_1} {β : Type u_2} {γ : Sort u_3} {p : αProp} (f : (a : α) → p aβ) (o : Option α) (H : ∀ (a : α), o = some ap a) (g : γ) (g' : βγ) :
                                                                                                      (pmap f o H).elim g g' = o.pelim g fun (a : α) (h : o = some a) => g' (f a )
                                                                                                      theorem Option.pelim_congr_left {α : Type u_1} {β : Sort u_2} {o o' : Option α} {b : β} {f : (a : α) → a oβ} (h : o = o') :
                                                                                                      o.pelim b f = o'.pelim b fun (a : α) (ha : o' = some a) => f a
                                                                                                      theorem Option.pelim_filter {α : Type u_1} {β : Sort u_2} {p : αBool} {o : Option α} {b : β} {f : (a : α) → a Option.filter p oβ} :
                                                                                                      (Option.filter p o).pelim b f = o.pelim b fun (a : α) (h : o = some a) => if hp : p a = true then f a else b
                                                                                                      theorem Option.pelim_join {α : Type u_1} {β : Sort u_2} {o : Option (Option α)} {b : β} {f : (a : α) → a o.joinβ} :
                                                                                                      o.join.pelim b f = o.pelim b fun (o' : Option α) (ho' : o = some o') => o'.pelim b fun (a : α) (ha : o' = some a) => f a
                                                                                                      theorem Option.pelim_congr {α : Type u_1} {β : Sort u_2} {o o' : Option α} {b b' : β} {f : (a : α) → o = some aβ} {g : (a : α) → o' = some aβ} (ho : o = o') (hb : b = b') (hf : ∀ (a : α) (ha : o' = some a), f a = g a ha) :
                                                                                                      o.pelim b f = o'.pelim b' g
                                                                                                      theorem Option.pelim_guard {α : Type u_1} {p : αBool} {β : Sort u_2} {b : β} {a : α} {f : (a' : α) → guard p a = some a'β} :
                                                                                                      (guard p a).pelim b f = if h : p a = true then f a else b

                                                                                                      pfilter #

                                                                                                      theorem Option.pfilter_congr {α : Type u} {o o' : Option α} (ho : o = o') {f : (a : α) → o = some aBool} {g : (a : α) → o' = some aBool} (hf : ∀ (a : α) (ha : o' = some a), f a = g a ha) :
                                                                                                      o.pfilter f = o'.pfilter g
                                                                                                      @[simp]
                                                                                                      theorem Option.pfilter_none {α : Type u_1} {p : (a : α) → none = some aBool} :
                                                                                                      @[simp]
                                                                                                      theorem Option.pfilter_some {α : Type u_1} {x : α} {p : (a : α) → some x = some aBool} :
                                                                                                      (some x).pfilter p = if p x = true then some x else none
                                                                                                      theorem Option.isSome_pfilter_iff {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      (o.pfilter p).isSome = true (a : α), (ha : o = some a), p a ha = true
                                                                                                      theorem Option.isSome_pfilter_iff_get {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      (o.pfilter p).isSome = true (h : o.isSome = true), p (o.get h) = true
                                                                                                      theorem Option.isSome_of_isSome_pfilter {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} (h : (o.pfilter p).isSome = true) :
                                                                                                      theorem Option.isNone_pfilter_iff {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      (o.pfilter p).isNone = true ∀ (a : α) (ha : o = some a), p a ha = false
                                                                                                      @[simp]
                                                                                                      theorem Option.get_pfilter {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} (h : (o.pfilter p).isSome = true) :
                                                                                                      (o.pfilter p).get h = o.get
                                                                                                      theorem Option.pfilter_eq_none_iff {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      o.pfilter p = none o = none (a : α), (ha : o = some a), p a ha = false
                                                                                                      theorem Option.pfilter_eq_some_iff {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} {a : α} :
                                                                                                      o.pfilter p = some a (ha : o = some a), p a ha = true
                                                                                                      theorem Option.eq_some_of_pfilter_eq_some {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} {a : α} (h : o.pfilter p = some a) :
                                                                                                      o = some a
                                                                                                      theorem Option.filter_pbind {α : Type u_1} {o : Option α} {β : Type u_2} {p : βBool} {f : (a : α) → o = some aOption β} :
                                                                                                      Option.filter p (o.pbind f) = (o.pfilter fun (a : α) (h : o = some a) => Option.any p (f a h)).pbind fun (a : α) (h : (o.pfilter fun (a : α) (h : o = some a) => Option.any p (f a h)) = some a) => f a
                                                                                                      @[simp]
                                                                                                      theorem Option.pfilter_eq_filter {α : Type u_1} {o : Option α} {p : αBool} :
                                                                                                      (o.pfilter fun (a : α) (x : o = some a) => p a) = Option.filter p o
                                                                                                      @[simp]
                                                                                                      theorem Option.pfilter_filter {α : Type u_1} {o : Option α} {p : αBool} {q : (a : α) → Option.filter p o = some aBool} :
                                                                                                      (Option.filter p o).pfilter q = o.pfilter fun (a : α) (h : o = some a) => if h' : p a = true then q a else false
                                                                                                      @[simp]
                                                                                                      theorem Option.filter_pfilter {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} {q : αBool} :
                                                                                                      Option.filter q (o.pfilter p) = o.pfilter fun (a : α) (h : o = some a) => p a h && q a
                                                                                                      @[simp]
                                                                                                      theorem Option.pfilter_pfilter {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} {q : (a : α) → o.pfilter p = some aBool} :
                                                                                                      (o.pfilter p).pfilter q = o.pfilter fun (a : α) (h : o = some a) => if h' : p a h = true then q a else false
                                                                                                      theorem Option.pfilter_eq_pbind_ite {α : Type u_1} {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      o.pfilter p = o.pbind fun (a : α) (h : o = some a) => if p a h = true then some a else none
                                                                                                      theorem Option.filter_pmap {α : Type u_1} {β : Type u_2} {o : Option α} {p : αProp} {f : (a : α) → p aβ} {h : ∀ (a : α), o = some ap a} {q : βBool} :
                                                                                                      Option.filter q (pmap f o h) = pmap f (o.pfilter fun (a : α) (h' : o = some a) => q (f a ))
                                                                                                      theorem Option.pfilter_join {α : Type u_1} {o : Option (Option α)} {p : (a : α) → o.join = some aBool} :
                                                                                                      o.join.pfilter p = (o.pfilter fun (o' : Option α) (h : o = some o') => o'.pelim false fun (a : α) (ha : o' = some a) => p a ).join
                                                                                                      theorem Option.join_pfilter {α : Type u_1} {o : Option (Option α)} {p : (o' : Option α) → o = some o'Bool} :
                                                                                                      (o.pfilter p).join = o.pbind fun (o' : Option α) (ho' : o = some o') => if p o' ho' = true then o' else none
                                                                                                      theorem Option.elim_pfilter {α : Type u_1} {β : Sort u_2} {o : Option α} {b : β} {f : αβ} {p : (a : α) → o = some aBool} :
                                                                                                      (o.pfilter p).elim b f = o.pelim b fun (a : α) (ha : o = some a) => if p a ha = true then f a else b
                                                                                                      theorem Option.pelim_pfilter {α : Type u_1} {β : Sort u_2} {o : Option α} {b : β} {p : (a : α) → o = some aBool} {f : (a : α) → o.pfilter p = some aβ} :
                                                                                                      (o.pfilter p).pelim b f = o.pelim b fun (a : α) (ha : o = some a) => if hp : p a ha = true then f a else b
                                                                                                      theorem Option.pfilter_guard {α : Type u_1} {a : α} {p : αBool} {q : (a' : α) → guard p a = some a'Bool} :
                                                                                                      (guard p a).pfilter q = if (h : p a = true), q a = true then some a else none

                                                                                                      LT and LE #

                                                                                                      @[simp]
                                                                                                      theorem Option.not_lt_none {α : Type u_1} [LT α] {a : Option α} :
                                                                                                      theorem Option.none_lt_some {α : Type u_1} [LT α] {a : α} :
                                                                                                      @[simp]
                                                                                                      theorem Option.none_lt {α : Type u_1} [LT α] {a : Option α} :
                                                                                                      @[simp]
                                                                                                      theorem Option.some_lt_some {α : Type u_1} [LT α] {a b : α} :
                                                                                                      some a < some b a < b
                                                                                                      @[simp]
                                                                                                      theorem Option.none_le {α : Type u_1} [LE α] {a : Option α} :
                                                                                                      theorem Option.not_some_le_none {α : Type u_1} [LE α] {a : α} :
                                                                                                      @[simp]
                                                                                                      theorem Option.le_none {α : Type u_1} [LE α] {a : Option α} :
                                                                                                      @[simp]
                                                                                                      theorem Option.some_le_some {α : Type u_1} [LE α] {a b : α} :
                                                                                                      some a some b a b
                                                                                                      @[simp]
                                                                                                      theorem Option.filter_le {α : Type u_1} [LE α] (le_refl : ∀ (x : α), x x) {o : Option α} {p : αBool} :
                                                                                                      @[simp]
                                                                                                      theorem Option.filter_lt {α : Type u_1} [LT α] (lt_irrefl : ∀ (x : α), ¬x < x) {o : Option α} {p : αBool} :
                                                                                                      Option.filter p o < o Option.any (fun (a : α) => !p a) o = true
                                                                                                      @[simp]
                                                                                                      theorem Option.le_filter {α : Type u_1} [LE α] (le_refl : ∀ (x : α), x x) {o : Option α} {p : αBool} :
                                                                                                      @[simp]
                                                                                                      theorem Option.not_lt_filter {α : Type u_1} [LT α] (lt_irrefl : ∀ (x : α), ¬x < x) {o : Option α} {p : αBool} :
                                                                                                      @[simp]
                                                                                                      theorem Option.pfilter_le {α : Type u_1} [LE α] (le_refl : ∀ (x : α), x x) {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      o.pfilter p o
                                                                                                      @[simp]
                                                                                                      theorem Option.not_lt_pfilter {α : Type u_1} [LT α] (lt_irrefl : ∀ (x : α), ¬x < x) {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      ¬o < o.pfilter p
                                                                                                      theorem Option.join_le {α : Type u_1} [LE α] {o : Option (Option α)} {o' : Option α} :
                                                                                                      o.join o' o some o'
                                                                                                      @[simp]
                                                                                                      theorem Option.guard_le_some {α : Type u_1} [LE α] (le_refl : ∀ (x : α), x x) {x : α} {p : αBool} :
                                                                                                      guard p x some x
                                                                                                      @[simp]
                                                                                                      theorem Option.guard_lt_some {α : Type u_1} [LT α] (lt_irrefl : ∀ (x : α), ¬x < x) {x : α} {p : αBool} :
                                                                                                      guard p x < some x p x = false
                                                                                                      theorem Option.left_le_of_merge_le {α : Type u_1} [LE α] {f : ααα} (hf : ∀ (a b c : α), f a b ca c) {o₁ o₂ o₃ : Option α} :
                                                                                                      merge f o₁ o₂ o₃o₁ o₃
                                                                                                      theorem Option.right_le_of_merge_le {α : Type u_1} [LE α] {f : ααα} (hf : ∀ (a b c : α), f a b cb c) {o₁ o₂ o₃ : Option α} :
                                                                                                      merge f o₁ o₂ o₃o₂ o₃
                                                                                                      theorem Option.merge_le {α : Type u_1} [LE α] {f : ααα} {o₁ o₂ o₃ : Option α} (hf : ∀ (a b c : α), a cb cf a b c) :
                                                                                                      o₁ o₃o₂ o₃merge f o₁ o₂ o₃
                                                                                                      @[simp]
                                                                                                      theorem Option.merge_le_iff {α : Type u_1} [LE α] {f : ααα} {o₁ o₂ o₃ : Option α} (hf : ∀ (a b c : α), f a b c a c b c) :
                                                                                                      merge f o₁ o₂ o₃ o₁ o₃ o₂ o₃
                                                                                                      theorem Option.left_lt_of_merge_lt {α : Type u_1} [LT α] {f : ααα} (hf : ∀ (a b c : α), f a b < ca < c) {o₁ o₂ o₃ : Option α} :
                                                                                                      merge f o₁ o₂ < o₃o₁ < o₃
                                                                                                      theorem Option.right_lt_of_merge_lt {α : Type u_1} [LT α] {f : ααα} (hf : ∀ (a b c : α), f a b < cb < c) {o₁ o₂ o₃ : Option α} :
                                                                                                      merge f o₁ o₂ < o₃o₂ < o₃
                                                                                                      theorem Option.merge_lt {α : Type u_1} [LT α] {f : ααα} {o₁ o₂ o₃ : Option α} (hf : ∀ (a b c : α), a < cb < cf a b < c) :
                                                                                                      o₁ < o₃o₂ < o₃merge f o₁ o₂ < o₃
                                                                                                      @[simp]
                                                                                                      theorem Option.merge_lt_iff {α : Type u_1} [LT α] {f : ααα} {o₁ o₂ o₃ : Option α} (hf : ∀ (a b c : α), f a b < c a < c b < c) :
                                                                                                      merge f o₁ o₂ < o₃ o₁ < o₃ o₂ < o₃

                                                                                                      Rel #

                                                                                                      @[simp]
                                                                                                      theorem Option.rel_some_some {α : Type u_1} {β : Type u_2} {a : α} {b : β} {r : αβProp} :
                                                                                                      Rel r (some a) (some b) r a b
                                                                                                      @[simp]
                                                                                                      theorem Option.not_rel_some_none {α : Type u_1} {β : Type u_2} {a : α} {r : αβProp} :
                                                                                                      @[simp]
                                                                                                      theorem Option.not_rel_none_some {α : Type u_1} {β : Type u_2} {a : β} {r : αβProp} :
                                                                                                      @[simp]
                                                                                                      theorem Option.rel_none_none {α : Type u_1} {β : Type u_2} {r : αβProp} :

                                                                                                      min and max #

                                                                                                      theorem Option.min_eq_left {α : Type u_1} [LE α] [Min α] (min_eq_left : ∀ (x y : α), x ymin x y = x) {a b : Option α} (h : a b) :
                                                                                                      min a b = a
                                                                                                      theorem Option.min_eq_right {α : Type u_1} [LE α] [Min α] (min_eq_right : ∀ (x y : α), y xmin x y = y) {a b : Option α} (h : b a) :
                                                                                                      min a b = b
                                                                                                      theorem Option.min_eq_left_of_lt {α : Type u_1} [LT α] [Min α] (min_eq_left : ∀ (x y : α), x < ymin x y = x) {a b : Option α} (h : a < b) :
                                                                                                      min a b = a
                                                                                                      theorem Option.min_eq_right_of_lt {α : Type u_1} [LT α] [Min α] (min_eq_right : ∀ (x y : α), y < xmin x y = y) {a b : Option α} (h : b < a) :
                                                                                                      min a b = b
                                                                                                      theorem Option.min_eq_or {α : Type u_1} [LE α] [Min α] (min_eq_or : ∀ (x y : α), min x y = x min x y = y) {a b : Option α} :
                                                                                                      min a b = a min a b = b
                                                                                                      theorem Option.min_le_left {α : Type u_1} [LE α] [Min α] (min_le_left : ∀ (x y : α), min x y x) {a b : Option α} :
                                                                                                      min a b a
                                                                                                      theorem Option.min_le_right {α : Type u_1} [LE α] [Min α] (min_le_right : ∀ (x y : α), min x y y) {a b : Option α} :
                                                                                                      min a b b
                                                                                                      theorem Option.le_min {α : Type u_1} [LE α] [Min α] (le_min : ∀ (x y z : α), x min y z x y x z) {a b c : Option α} :
                                                                                                      a min b c a b a c
                                                                                                      theorem Option.max_eq_left {α : Type u_1} [LE α] [Max α] (max_eq_left : ∀ (x y : α), x ymax x y = y) {a b : Option α} (h : a b) :
                                                                                                      max a b = b
                                                                                                      theorem Option.max_eq_right {α : Type u_1} [LE α] [Max α] (max_eq_right : ∀ (x y : α), y xmax x y = x) {a b : Option α} (h : b a) :
                                                                                                      max a b = a
                                                                                                      theorem Option.max_eq_left_of_lt {α : Type u_1} [LT α] [Max α] (max_eq_left : ∀ (x y : α), x < ymax x y = y) {a b : Option α} (h : a < b) :
                                                                                                      max a b = b
                                                                                                      theorem Option.max_eq_right_of_lt {α : Type u_1} [LT α] [Max α] (max_eq_right : ∀ (x y : α), y < xmax x y = x) {a b : Option α} (h : b < a) :
                                                                                                      max a b = a
                                                                                                      theorem Option.max_eq_or {α : Type u_1} [LE α] [Max α] (max_eq_or : ∀ (x y : α), max x y = x max x y = y) {a b : Option α} :
                                                                                                      max a b = a max a b = b
                                                                                                      theorem Option.left_le_max {α : Type u_1} [LE α] [Max α] (le_refl : ∀ (x : α), x x) (left_le_max : ∀ (x y : α), x max x y) {a b : Option α} :
                                                                                                      a max a b
                                                                                                      theorem Option.right_le_max {α : Type u_1} [LE α] [Max α] (le_refl : ∀ (x : α), x x) (right_le_max : ∀ (x y : α), y max x y) {a b : Option α} :
                                                                                                      b max a b
                                                                                                      theorem Option.max_le {α : Type u_1} [LE α] [Max α] (max_le : ∀ (x y z : α), max x y z x z y z) {a b c : Option α} :
                                                                                                      max a b c a c b c
                                                                                                      @[simp]
                                                                                                      theorem Option.merge_max {α : Type u_1} [Max α] :
                                                                                                      @[simp]
                                                                                                      theorem Option.max_filter_left {α : Type u_1} [Max α] [Std.IdempotentOp max] {p : αBool} {o : Option α} :
                                                                                                      max (Option.filter p o) o = o
                                                                                                      @[simp]
                                                                                                      theorem Option.max_filter_right {α : Type u_1} [Max α] [Std.IdempotentOp max] {p : αBool} {o : Option α} :
                                                                                                      max o (Option.filter p o) = o
                                                                                                      @[simp]
                                                                                                      theorem Option.min_filter_left {α : Type u_1} [Min α] [Std.IdempotentOp min] {p : αBool} {o : Option α} :
                                                                                                      @[simp]
                                                                                                      theorem Option.min_filter_right {α : Type u_1} [Min α] [Std.IdempotentOp min] {p : αBool} {o : Option α} :
                                                                                                      @[simp]
                                                                                                      theorem Option.max_pfilter_left {α : Type u_1} [Max α] [Std.IdempotentOp max] {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      max (o.pfilter p) o = o
                                                                                                      @[simp]
                                                                                                      theorem Option.max_pfilter_right {α : Type u_1} [Max α] [Std.IdempotentOp max] {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      max o (o.pfilter p) = o
                                                                                                      @[simp]
                                                                                                      theorem Option.min_pfilter_left {α : Type u_1} [Min α] [Std.IdempotentOp min] {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      min (o.pfilter p) o = o.pfilter p
                                                                                                      @[simp]
                                                                                                      theorem Option.min_pfilter_right {α : Type u_1} [Min α] [Std.IdempotentOp min] {o : Option α} {p : (a : α) → o = some aBool} :
                                                                                                      min o (o.pfilter p) = o.pfilter p
                                                                                                      @[simp]
                                                                                                      theorem Option.isSome_max {α : Type u_1} [Max α] {o o' : Option α} :
                                                                                                      (max o o').isSome = (o.isSome || o'.isSome)
                                                                                                      @[simp]
                                                                                                      theorem Option.isNone_max {α : Type u_1} [Max α] {o o' : Option α} :
                                                                                                      (max o o').isNone = (o.isNone && o'.isNone)
                                                                                                      @[simp]
                                                                                                      theorem Option.isSome_min {α : Type u_1} [Min α] {o o' : Option α} :
                                                                                                      (min o o').isSome = (o.isSome && o'.isSome)
                                                                                                      @[simp]
                                                                                                      theorem Option.isNone_min {α : Type u_1} [Min α] {o o' : Option α} :
                                                                                                      (min o o').isNone = (o.isNone || o'.isNone)
                                                                                                      theorem Option.max_join_left {α : Type u_1} [Max α] {o : Option (Option α)} {o' : Option α} :
                                                                                                      max o.join o' = (max o (some o')).get
                                                                                                      theorem Option.max_join_right {α : Type u_1} [Max α] {o : Option α} {o' : Option (Option α)} :
                                                                                                      max o o'.join = (max (some o) o').get
                                                                                                      theorem Option.join_max {α : Type u_1} [Max α] {o o' : Option (Option α)} :
                                                                                                      (max o o').join = max o.join o'.join
                                                                                                      theorem Option.min_join_left {α : Type u_1} [Min α] {o : Option (Option α)} {o' : Option α} :
                                                                                                      min o.join o' = (min o (some o')).join
                                                                                                      theorem Option.min_join_right {α : Type u_1} [Min α] {o : Option α} {o' : Option (Option α)} :
                                                                                                      min o o'.join = (min (some o) o').join
                                                                                                      theorem Option.join_min {α : Type u_1} [Min α] {o o' : Option (Option α)} :
                                                                                                      (min o o').join = min o.join o'.join
                                                                                                      @[simp]
                                                                                                      theorem Option.min_guard_some {α : Type u_1} [Min α] [Std.IdempotentOp min] {x : α} {p : αBool} :
                                                                                                      min (guard p x) (some x) = guard p x
                                                                                                      @[simp]
                                                                                                      theorem Option.min_some_guard {α : Type u_1} [Min α] [Std.IdempotentOp min] {x : α} {p : αBool} :
                                                                                                      min (some x) (guard p x) = guard p x
                                                                                                      @[simp]
                                                                                                      theorem Option.max_guard_some {α : Type u_1} [Max α] [Std.IdempotentOp max] {x : α} {p : αBool} :
                                                                                                      max (guard p x) (some x) = some x
                                                                                                      @[simp]
                                                                                                      theorem Option.max_some_guard {α : Type u_1} [Max α] [Std.IdempotentOp max] {x : α} {p : αBool} :
                                                                                                      max (some x) (guard p x) = some x
                                                                                                      theorem Option.max_eq_some_iff {α : Type u_1} [Max α] {o o' : Option α} {a : α} :
                                                                                                      max o o' = some a o = some a o' = none o = none o' = some a (b : α), (c : α), o = some b o' = some c max b c = a
                                                                                                      @[simp]
                                                                                                      theorem Option.max_eq_none_iff {α : Type u_1} [Max α] {o o' : Option α} :
                                                                                                      max o o' = none o = none o' = none
                                                                                                      @[simp]
                                                                                                      theorem Option.min_eq_some_iff {α : Type u_1} [Min α] {o o' : Option α} {a : α} :
                                                                                                      min o o' = some a (b : α), (c : α), o = some b o' = some c min b c = a
                                                                                                      @[simp]
                                                                                                      theorem Option.min_eq_none_iff {α : Type u_1} [Min α] {o o' : Option α} :
                                                                                                      min o o' = none o = none o' = none
                                                                                                      @[simp]
                                                                                                      theorem Option.any_max {α : Type u_1} [Max α] {o o' : Option α} {p : αBool} (hp : ∀ (a b : α), p (max a b) = (p a || p b)) :
                                                                                                      Option.any p (max o o') = (Option.any p o || Option.any p o')
                                                                                                      @[simp]
                                                                                                      theorem Option.all_min {α : Type u_1} [Min α] {o o' : Option α} {p : αBool} (hp : ∀ (a b : α), p (min a b) = (p a || p b)) :
                                                                                                      Option.all p (min o o') = (Option.all p o || Option.all p o')
                                                                                                      theorem Option.isSome_left_of_isSome_min {α : Type u_1} [Min α] {o o' : Option α} :
                                                                                                      (min o o').isSome = trueo.isSome = true
                                                                                                      theorem Option.isSome_right_of_isSome_min {α : Type u_1} [Min α] {o o' : Option α} :
                                                                                                      (min o o').isSome = trueo'.isSome = true
                                                                                                      @[simp]
                                                                                                      theorem Option.get_min {α : Type u_1} [Min α] {o o' : Option α} {h : (min o o').isSome = true} :
                                                                                                      (min o o').get h = min (o.get ) (o'.get )
                                                                                                      theorem Option.map_max {α : Type u_1} {β : Type u_2} [Max α] [Max β] {o o' : Option α} {f : αβ} (hf : ∀ (x y : α), f (max x y) = max (f x) (f y)) :
                                                                                                      Option.map f (max o o') = max (Option.map f o) (Option.map f o')
                                                                                                      theorem Option.map_min {α : Type u_1} {β : Type u_2} [Min α] [Min β] {o o' : Option α} {f : αβ} (hf : ∀ (x y : α), f (min x y) = min (f x) (f y)) :
                                                                                                      Option.map f (min o o') = min (Option.map f o) (Option.map f o')