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 α) :
@[reducible, inline, deprecated Option.get!_eq_getD (since := "2024-11-18")]
abbrev Option.get!_eq_getD_default {α : Type u_1} [Inhabited α] (o : Option α) :
Equations
Instances For
    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 α✝} :
    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_some {α : Type u_1} (x : Option α) :
      x.bind some = x
      @[simp]
      theorem Option.bind_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.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.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_id_eq_join {α : Type u_1} {x : Option (Option α)} :
              @[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
                            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.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.mem_filter_iff {α : Type u_1} {p : αBool} {a : α} {o : Option α} :
                                  a Option.filter p o a o p a = true
                                  theorem Option.filter_eq_bind {α : Type u_1} (x : Option α) (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.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.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
                                  @[simp]
                                  theorem Option.some_orElse {α : Type u_1} (a : α) (f : UnitOption α) :
                                  (some a).orElse f = some a
                                  @[simp]
                                  theorem Option.none_orElse {α : Type u_1} (f : UnitOption α) :
                                  @[simp]
                                  theorem Option.orElse_none {α : Type u_1} (x : Option α) :
                                  (x.orElse fun (x : Unit) => none) = x
                                  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
                                  theorem Option.orElse_eq_none_iff {α : Type u_1} (o : Option α) (f : UnitOption α) :
                                  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 ())
                                  @[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.guard_eq_none_iff {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                      guard p a = none p a = false
                                      @[reducible, inline, deprecated Option.guard_eq_none_iff (since := "2025-04-10")]
                                      abbrev Option.guard_eq_none {α✝ : Type u_1} {p : α✝Bool} {a : α✝} :
                                      guard p a = none p a = false
                                      Equations
                                      Instances For
                                        @[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.bind_guard {α : Type u_1} (x : Option α) (p : αBool) :
                                        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_def {α : Type u_1} (p : αBool) :
                                        guard p = fun (x : α) => if p x = true then some x else none
                                        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 : ααα) :
                                        @[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
                                        @[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 {α : Type u_1} [Subsingleton α] (a : α) :
                                          @[reducible, inline, deprecated Option.isSome_choice_iff_nonempty (since := "2025-03-18")]
                                          Equations
                                          Instances For
                                            @[simp]
                                            theorem Option.toList_some {α : Type u_1} (a : α) :
                                            @[simp]
                                            theorem Option.toList_none (α : Type u_1) :
                                            @[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'
                                            @[deprecated Option.some_or (since := "2024-11-03")]
                                            theorem Option.or_some {α✝ : Type u_1} {a : α✝} {o : Option α✝} :
                                            (some a).or o = some a
                                            @[simp]
                                            theorem Option.or_some' {α : Type u_1} {a : α} {o : Option α} :
                                            o.or (some a) = some (o.getD a)

                                            This will be renamed to or_some once the existing deprecated lemma is removed.

                                            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₃)
                                                @[simp]
                                                theorem Option.or_none {α✝ : Type u_1} {o : Option α✝} :
                                                o.or none = 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.or_eq_orElse {α✝ : Type u_1} {o o' : Option α✝} :
                                                o.or o' = o.orElse fun (x : Unit) => 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)

                                                  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.reflBEq_iff {α : Type u_1} [BEq α] :
                                                  @[simp]
                                                  theorem Option.lawfulBEq_iff {α : Type u_1} [BEq α] :

                                                  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.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
                                                  theorem Option.isSome_filter {α : Type u_1} {x : Option α} {f : αBool} :
                                                  @[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
                                                  @[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
                                                  @[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

                                                  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 )
                                                  @[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'

                                                    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
                                                    @[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 )

                                                    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) :
                                                    @[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
                                                    @[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
                                                    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

                                                    LT and LE #

                                                    @[simp]
                                                    theorem Option.not_lt_none {α : Type u_1} [LT α] {a : Option α} :
                                                    @[simp]
                                                    theorem Option.none_lt_some {α : Type u_1} [LT α] {a : α} :
                                                    @[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 α} :
                                                    @[simp]
                                                    theorem Option.not_some_le_none {α : Type u_1} [LE α] {a : α} :
                                                    @[simp]
                                                    theorem Option.some_le_some {α : Type u_1} [LE α] {a b : α} :
                                                    some a some b a b

                                                    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