File: Mathlib/Order/BooleanAlgebra.lean

full_name: GeneralizedBooleanAlgebra.inf_inf_sdiff
code: /-- A generalized Boolean algebra is a distributive lattice with `⊥` and a relative complement
operation `\` (called `sdiff`, after "set difference") satisfying `(a ⊓ b) ⊔ (a \ b) = a` and
`(a ⊓ b) ⊓ (a \ b) = ⊥`, i.e. `a \ b` is the complement of `b` in `a`.

This is a generalization of Boolean algebras which applies to `Finset α` for arbitrary
(not-necessarily-`Fintype`) `α`. -/
class GeneralizedBooleanAlgebra (α : Type u) extends DistribLattice α, SDiff α, Bot α where
  /-- For any `a`, `b`, `(a ⊓ b) ⊔ (a / b) = a` -/
  sup_inf_sdiff : ∀ a b : α, a ⊓ b ⊔ a \ b = a
  /-- For any `a`, `b`, `(a ⊓ b) ⊓ (a / b) = ⊥` -/
  inf_inf_sdiff : ∀ a b : α, a ⊓ b ⊓ a \ b = ⊥
goal: a ⊓ b ⊓ a \ b = ⊥

full_name: GeneralizedBooleanAlgebra.sup_inf_sdiff
code: /-- A generalized Boolean algebra is a distributive lattice with `⊥` and a relative complement
operation `\` (called `sdiff`, after "set difference") satisfying `(a ⊓ b) ⊔ (a \ b) = a` and
`(a ⊓ b) ⊓ (a \ b) = ⊥`, i.e. `a \ b` is the complement of `b` in `a`.

This is a generalization of Boolean algebras which applies to `Finset α` for arbitrary
(not-necessarily-`Fintype`) `α`. -/
class GeneralizedBooleanAlgebra (α : Type u) extends DistribLattice α, SDiff α, Bot α where
  /-- For any `a`, `b`, `(a ⊓ b) ⊔ (a / b) = a` -/
  sup_inf_sdiff : ∀ a b : α, a ⊓ b ⊔ a \ b = a
  /-- For any `a`, `b`, `(a ⊓ b) ⊓ (a / b) = ⊥` -/
  inf_inf_sdiff : ∀ a b : α, a ⊓ b ⊓ a \ b = ⊥
goal: a ⊓ b ⊔ a \ b = a

full_name: GeneralizedBooleanAlgebra
code: /-- A generalized Boolean algebra is a distributive lattice with `⊥` and a relative complement
operation `\` (called `sdiff`, after "set difference") satisfying `(a ⊓ b) ⊔ (a \ b) = a` and
`(a ⊓ b) ⊓ (a \ b) = ⊥`, i.e. `a \ b` is the complement of `b` in `a`.

This is a generalization of Boolean algebras which applies to `Finset α` for arbitrary
(not-necessarily-`Fintype`) `α`. -/
class GeneralizedBooleanAlgebra (α : Type u) extends DistribLattice α, SDiff α, Bot α where
  /-- For any `a`, `b`, `(a ⊓ b) ⊔ (a / b) = a` -/
  sup_inf_sdiff : ∀ a b : α, a ⊓ b ⊔ a \ b = a
  /-- For any `a`, `b`, `(a ⊓ b) ⊓ (a / b) = ⊥` -/
  inf_inf_sdiff : ∀ a b : α, a ⊓ b ⊓ a \ b = ⊥
goal: Type u

full_name: sup_inf_sdiff
code: @[simp]
theorem sup_inf_sdiff (x y : α) : x ⊓ y ⊔ x \ y = x 
goal: x ⊓ y ⊔ x \ y = x

full_name: inf_inf_sdiff
code: @[simp]
theorem inf_inf_sdiff (x y : α) : x ⊓ y ⊓ x \ y = ⊥ 
goal: x ⊓ y ⊓ x \ y = ⊥

full_name: sup_sdiff_inf
code: @[simp]
theorem sup_sdiff_inf (x y : α) : x \ y ⊔ x ⊓ y = x 
goal: x \ y ⊔ x ⊓ y = x

full_name: inf_sdiff_inf
code: @[simp]
theorem inf_sdiff_inf (x y : α) : x \ y ⊓ (x ⊓ y) = ⊥ 
goal: x \ y ⊓ (x ⊓ y) = ⊥

full_name: GeneralizedBooleanAlgebra.toOrderBot
code: instance (priority := 100) GeneralizedBooleanAlgebra.toOrderBot : OrderBot α 
goal: OrderBot α

full_name: disjoint_inf_sdiff
code: theorem disjoint_inf_sdiff : Disjoint (x ⊓ y) (x \ y) 
goal: Disjoint (x ⊓ y) (x \ y)

full_name: sdiff_unique
code: theorem sdiff_unique (s : x ⊓ y ⊔ z = x) (i : x ⊓ y ⊓ z = ⊥) : x \ y = z 
goal: x \ y = z

full_name: _private.Mathlib.Order.BooleanAlgebra.0.sdiff_le'
code: private theorem sdiff_le' : x \ y ≤ x 
goal: x \ y ≤ x

full_name: _private.Mathlib.Order.BooleanAlgebra.0.sdiff_sup_self'
code: private theorem sdiff_sup_self' : y \ x ⊔ x = y ⊔ x 
goal: y \ x ⊔ x = y ⊔ x

full_name: sdiff_inf_sdiff
code: @[simp]
theorem sdiff_inf_sdiff : x \ y ⊓ y \ x = ⊥ 
goal: x \ y ⊓ y \ x = ⊥

full_name: disjoint_sdiff_sdiff
code: theorem disjoint_sdiff_sdiff : Disjoint (x \ y) (y \ x) 
goal: Disjoint (x \ y) (y \ x)

full_name: inf_sdiff_self_right
code: @[simp]
theorem inf_sdiff_self_right : x ⊓ y \ x = ⊥ 
goal: x ⊓ y \ x = ⊥

full_name: inf_sdiff_self_left
code: @[simp]
theorem inf_sdiff_self_left : y \ x ⊓ x = ⊥ 
goal: y \ x ⊓ x = ⊥

full_name: GeneralizedBooleanAlgebra.toGeneralizedCoheytingAlgebra
code: instance (priority := 100) GeneralizedBooleanAlgebra.toGeneralizedCoheytingAlgebra :
    GeneralizedCoheytingAlgebra α 
goal: GeneralizedCoheytingAlgebra α

full_name: disjoint_sdiff_self_left
code: theorem disjoint_sdiff_self_left : Disjoint (y \ x) x 
goal: Disjoint (y \ x) x

full_name: disjoint_sdiff_self_right
code: theorem disjoint_sdiff_self_right : Disjoint x (y \ x) 
goal: Disjoint x (y \ x)

full_name: le_sdiff
code: lemma le_sdiff : x ≤ y \ z ↔ x ≤ y ∧ Disjoint x z 
goal: x ≤ y \ z ↔ x ≤ y ∧ Disjoint x z

full_name: sdiff_eq_left
code: @[simp] lemma sdiff_eq_left : x \ y = x ↔ Disjoint x y 
goal: x \ y = x ↔ Disjoint x y

full_name: Disjoint.sdiff_eq_of_sup_eq
code: theorem Disjoint.sdiff_eq_of_sup_eq (hi : Disjoint x z) (hs : x ⊔ z = y) : y \ x = z 
goal: y \ x = z

full_name: Disjoint.sdiff_unique
code: protected theorem Disjoint.sdiff_unique (hd : Disjoint x z) (hz : z ≤ y) (hs : y ≤ x ⊔ z) :
    y \ x = z 
goal: y \ x = z

full_name: disjoint_sdiff_iff_le
code: theorem disjoint_sdiff_iff_le (hz : z ≤ y) (hx : x ≤ y) : Disjoint z (y \ x) ↔ z ≤ x 
goal: Disjoint z (y \ x) ↔ z ≤ x

full_name: le_iff_disjoint_sdiff
code: theorem le_iff_disjoint_sdiff (hz : z ≤ y) (hx : x ≤ y) : z ≤ x ↔ Disjoint z (y \ x) 
goal: z ≤ x ↔ Disjoint z (y \ x)

full_name: inf_sdiff_eq_bot_iff
code: theorem inf_sdiff_eq_bot_iff (hz : z ≤ y) (hx : x ≤ y) : z ⊓ y \ x = ⊥ ↔ z ≤ x 
goal: z ⊓ y \ x = ⊥ ↔ z ≤ x

full_name: le_iff_eq_sup_sdiff
code: theorem le_iff_eq_sup_sdiff (hz : z ≤ y) (hx : x ≤ y) : x ≤ z ↔ y = z ⊔ y \ x 
goal: x ≤ z ↔ y = z ⊔ y \ x

full_name: sdiff_sup
code: theorem sdiff_sup : y \ (x ⊔ z) = y \ x ⊓ y \ z 
goal: y \ (x ⊔ z) = y \ x ⊓ y \ z

full_name: sdiff_eq_sdiff_iff_inf_eq_inf
code: theorem sdiff_eq_sdiff_iff_inf_eq_inf : y \ x = y \ z ↔ y ⊓ x = y ⊓ z 
goal: y \ x = y \ z ↔ y ⊓ x = y ⊓ z

full_name: sdiff_eq_self_iff_disjoint
code: theorem sdiff_eq_self_iff_disjoint : x \ y = x ↔ Disjoint y x 
goal: x \ y = x ↔ Disjoint y x

full_name: sdiff_eq_self_iff_disjoint'
code: theorem sdiff_eq_self_iff_disjoint' : x \ y = x ↔ Disjoint x y 
goal: x \ y = x ↔ Disjoint x y

full_name: sdiff_lt
code: theorem sdiff_lt (hx : y ≤ x) (hy : y ≠ ⊥) : x \ y < x 
goal: x \ y < x

full_name: le_sdiff_iff
code: @[simp]
theorem le_sdiff_iff : x ≤ y \ x ↔ x = ⊥ 
goal: x ≤ y \ x ↔ x = ⊥

full_name: sdiff_eq_right
code: @[simp] lemma sdiff_eq_right : x \ y = y ↔ x = ⊥ ∧ y = ⊥ 
goal: x \ y = y ↔ x = ⊥ ∧ y = ⊥

full_name: sdiff_ne_right
code: lemma sdiff_ne_right : x \ y ≠ y ↔ x ≠ ⊥ ∨ y ≠ ⊥ 
goal: x \ y ≠ y ↔ x ≠ ⊥ ∨ y ≠ ⊥

full_name: sdiff_lt_sdiff_right
code: theorem sdiff_lt_sdiff_right (h : x < y) (hz : z ≤ x) : x \ z < y \ z 
goal: x \ z < y \ z

full_name: sup_inf_inf_sdiff
code: theorem sup_inf_inf_sdiff : x ⊓ y ⊓ z ⊔ y \ z = x ⊓ y ⊔ y \ z 
goal: x ⊓ y ⊓ z ⊔ y \ z = x ⊓ y ⊔ y \ z

full_name: sdiff_sdiff_right
code: theorem sdiff_sdiff_right : x \ (y \ z) = x \ y ⊔ x ⊓ y ⊓ z 
goal: x \ (y \ z) = x \ y ⊔ x ⊓ y ⊓ z

full_name: sdiff_sdiff_right'
code: theorem sdiff_sdiff_right' : x \ (y \ z) = x \ y ⊔ x ⊓ z 
goal: x \ (y \ z) = x \ y ⊔ x ⊓ z

full_name: sdiff_sdiff_eq_sdiff_sup
code: theorem sdiff_sdiff_eq_sdiff_sup (h : z ≤ x) : x \ (y \ z) = x \ y ⊔ z 
goal: x \ (y \ z) = x \ y ⊔ z

full_name: sdiff_sdiff_right_self
code: @[simp]
theorem sdiff_sdiff_right_self : x \ (x \ y) = x ⊓ y 
goal: x \ (x \ y) = x ⊓ y

full_name: sdiff_sdiff_eq_self
code: theorem sdiff_sdiff_eq_self (h : y ≤ x) : x \ (x \ y) = y 
goal: x \ (x \ y) = y

full_name: sdiff_eq_symm
code: theorem sdiff_eq_symm (hy : y ≤ x) (h : x \ y = z) : x \ z = y 
goal: x \ z = y

full_name: sdiff_eq_comm
code: theorem sdiff_eq_comm (hy : y ≤ x) (hz : z ≤ x) : x \ y = z ↔ x \ z = y 
goal: x \ y = z ↔ x \ z = y

full_name: eq_of_sdiff_eq_sdiff
code: theorem eq_of_sdiff_eq_sdiff (hxz : x ≤ z) (hyz : y ≤ z) (h : z \ x = z \ y) : x = y 
goal: x = y

full_name: sdiff_sdiff_left'
code: theorem sdiff_sdiff_left' : (x \ y) \ z = x \ y ⊓ x \ z 
goal: (x \ y) \ z = x \ y ⊓ x \ z

full_name: sdiff_sdiff_sup_sdiff
code: theorem sdiff_sdiff_sup_sdiff : z \ (x \ y ⊔ y \ x) = z ⊓ (z \ x ⊔ y) ⊓ (z \ y ⊔ x) 
goal: z \ (x \ y ⊔ y \ x) = z ⊓ (z \ x ⊔ y) ⊓ (z \ y ⊔ x)

full_name: sdiff_sdiff_sup_sdiff'
code: theorem sdiff_sdiff_sup_sdiff' : z \ (x \ y ⊔ y \ x) = z ⊓ x ⊓ y ⊔ z \ x ⊓ z \ y 
goal: z \ (x \ y ⊔ y \ x) = z ⊓ x ⊓ y ⊔ z \ x ⊓ z \ y

full_name: sdiff_sdiff_sdiff_cancel_left
code: lemma sdiff_sdiff_sdiff_cancel_left (hca : z ≤ x) : (x \ y) \ (x \ z) = z \ y 
goal: (x \ y) \ (x \ z) = z \ y

full_name: sdiff_sdiff_sdiff_cancel_right
code: lemma sdiff_sdiff_sdiff_cancel_right (hcb : z ≤ y) : (x \ z) \ (y \ z) = x \ y 
goal: (x \ z) \ (y \ z) = x \ y

full_name: inf_sdiff
code: theorem inf_sdiff : (x ⊓ y) \ z = x \ z ⊓ y \ z 
goal: (x ⊓ y) \ z = x \ z ⊓ y \ z

full_name: inf_sdiff_assoc
code: theorem inf_sdiff_assoc : (x ⊓ y) \ z = x ⊓ y \ z 
goal: (x ⊓ y) \ z = x ⊓ y \ z

full_name: inf_sdiff_right_comm
code: theorem inf_sdiff_right_comm : x \ z ⊓ y = (x ⊓ y) \ z 
goal: x \ z ⊓ y = (x ⊓ y) \ z

full_name: inf_sdiff_distrib_left
code: theorem inf_sdiff_distrib_left (a b c : α) : a ⊓ b \ c = (a ⊓ b) \ (a ⊓ c) 
goal: a ⊓ b \ c = (a ⊓ b) \ (a ⊓ c)

full_name: inf_sdiff_distrib_right
code: theorem inf_sdiff_distrib_right (a b c : α) : a \ b ⊓ c = (a ⊓ c) \ (b ⊓ c) 
goal: a \ b ⊓ c = (a ⊓ c) \ (b ⊓ c)

full_name: disjoint_sdiff_comm
code: theorem disjoint_sdiff_comm : Disjoint (x \ z) y ↔ Disjoint x (y \ z) 
goal: Disjoint (x \ z) y ↔ Disjoint x (y \ z)

full_name: sup_eq_sdiff_sup_sdiff_sup_inf
code: theorem sup_eq_sdiff_sup_sdiff_sup_inf : x ⊔ y = x \ y ⊔ y \ x ⊔ x ⊓ y 
goal: x ⊔ y = x \ y ⊔ y \ x ⊔ x ⊓ y

full_name: sup_lt_of_lt_sdiff_left
code: theorem sup_lt_of_lt_sdiff_left (h : y < z \ x) (hxz : x ≤ z) : x ⊔ y < z 
goal: x ⊔ y < z

full_name: sup_lt_of_lt_sdiff_right
code: theorem sup_lt_of_lt_sdiff_right (h : x < z \ y) (hyz : y ≤ z) : x ⊔ y < z 
goal: x ⊔ y < z

full_name: Prod.instGeneralizedBooleanAlgebra
code: instance Prod.instGeneralizedBooleanAlgebra [GeneralizedBooleanAlgebra β] :
    GeneralizedBooleanAlgebra (α × β) 
goal: GeneralizedBooleanAlgebra (α × β)

full_name: Pi.instGeneralizedBooleanAlgebra
code: instance Pi.instGeneralizedBooleanAlgebra {ι : Type*} {α : ι → Type*}
    [∀ i, GeneralizedBooleanAlgebra (α i)] : GeneralizedBooleanAlgebra (∀ i, α i) 
goal: GeneralizedBooleanAlgebra ((i : ι) → α i)

full_name: BooleanAlgebra.inf_compl_le_bot
code: /-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop
goal: x ⊓ xᶜ ≤ ⊥

full_name: BooleanAlgebra.himp_eq
code: /-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop
goal: x ⇨ y = y ⊔ xᶜ

full_name: BooleanAlgebra.sdiff_eq
code: /-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop
goal: x \ y = x ⊓ yᶜ

full_name: BooleanAlgebra.le_top
code: /-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop
goal: a ≤ ⊤

full_name: BooleanAlgebra.bot_le
code: /-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop
goal: ⊥ ≤ a

full_name: BooleanAlgebra
code: /-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop
goal: Type u

full_name: BooleanAlgebra.top_le_sup_compl
code: /-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop
goal: ⊤ ≤ x ⊔ xᶜ

full_name: BooleanAlgebra.toBoundedOrder
code: instance (priority := 100) BooleanAlgebra.toBoundedOrder [h : BooleanAlgebra α] : BoundedOrder α 
goal: BoundedOrder α

full_name: GeneralizedBooleanAlgebra.toBooleanAlgebra
code: /-- A bounded generalized boolean algebra is a boolean algebra. -/
abbrev GeneralizedBooleanAlgebra.toBooleanAlgebra [GeneralizedBooleanAlgebra α] [OrderTop α] :
    BooleanAlgebra α 
goal: BooleanAlgebra α

full_name: inf_compl_eq_bot'
code: theorem inf_compl_eq_bot' : x ⊓ xᶜ = ⊥ 
goal: x ⊓ xᶜ = ⊥

full_name: sup_compl_eq_top
code: @[simp]
theorem sup_compl_eq_top : x ⊔ xᶜ = ⊤ 
goal: x ⊔ xᶜ = ⊤

full_name: compl_sup_eq_top
code: @[simp]
theorem compl_sup_eq_top : xᶜ ⊔ x = ⊤ 
goal: xᶜ ⊔ x = ⊤

full_name: isCompl_compl
code: theorem isCompl_compl : IsCompl x xᶜ 
goal: IsCompl x xᶜ

full_name: sdiff_eq
code: theorem sdiff_eq : x \ y = x ⊓ yᶜ 
goal: x \ y = x ⊓ yᶜ

full_name: himp_eq
code: theorem himp_eq : x ⇨ y = y ⊔ xᶜ 
goal: x ⇨ y = y ⊔ xᶜ

full_name: BooleanAlgebra.toComplementedLattice
code: instance (priority := 100) BooleanAlgebra.toComplementedLattice : ComplementedLattice α 
goal: ComplementedLattice α

full_name: BooleanAlgebra.toGeneralizedBooleanAlgebra
code: instance (priority := 100) BooleanAlgebra.toGeneralizedBooleanAlgebra :
    GeneralizedBooleanAlgebra α 
goal: GeneralizedBooleanAlgebra α

full_name: BooleanAlgebra.toBiheytingAlgebra
code: instance (priority := 100) BooleanAlgebra.toBiheytingAlgebra : BiheytingAlgebra α 
goal: BiheytingAlgebra α

full_name: hnot_eq_compl
code: @[simp]
theorem hnot_eq_compl : ￢x = xᶜ 
goal: ￢x = xᶜ

full_name: top_sdiff
code: theorem top_sdiff : ⊤ \ x = xᶜ 
goal: ⊤ \ x = xᶜ

full_name: eq_compl_iff_isCompl
code: theorem eq_compl_iff_isCompl : x = yᶜ ↔ IsCompl x y 
goal: x = yᶜ ↔ IsCompl x y

full_name: compl_eq_iff_isCompl
code: theorem compl_eq_iff_isCompl : xᶜ = y ↔ IsCompl x y 
goal: xᶜ = y ↔ IsCompl x y

full_name: compl_eq_comm
code: theorem compl_eq_comm : xᶜ = y ↔ yᶜ = x 
goal: xᶜ = y ↔ yᶜ = x

full_name: eq_compl_comm
code: theorem eq_compl_comm : x = yᶜ ↔ y = xᶜ 
goal: x = yᶜ ↔ y = xᶜ

full_name: compl_compl
code: @[simp]
theorem compl_compl (x : α) : xᶜᶜ = x 
goal: xᶜᶜ = x

full_name: compl_comp_compl
code: theorem compl_comp_compl : compl ∘ compl = @id α 
goal: compl ∘ compl = id

full_name: compl_involutive
code: @[simp]
theorem compl_involutive : Function.Involutive (compl : α → α) 
goal: Function.Involutive compl

full_name: compl_bijective
code: theorem compl_bijective : Function.Bijective (compl : α → α) 
goal: Function.Bijective compl

full_name: compl_surjective
code: theorem compl_surjective : Function.Surjective (compl : α → α) 
goal: Function.Surjective compl

full_name: compl_injective
code: theorem compl_injective : Function.Injective (compl : α → α) 
goal: Function.Injective compl

full_name: compl_inj_iff
code: @[simp]
theorem compl_inj_iff : xᶜ = yᶜ ↔ x = y 
goal: xᶜ = yᶜ ↔ x = y

full_name: IsCompl.compl_eq_iff
code: theorem IsCompl.compl_eq_iff (h : IsCompl x y) : zᶜ = y ↔ z = x 
goal: zᶜ = y ↔ z = x

full_name: compl_eq_top
code: @[simp]
theorem compl_eq_top : xᶜ = ⊤ ↔ x = ⊥ 
goal: xᶜ = ⊤ ↔ x = ⊥

full_name: compl_eq_bot
code: @[simp]
theorem compl_eq_bot : xᶜ = ⊥ ↔ x = ⊤ 
goal: xᶜ = ⊥ ↔ x = ⊤

full_name: compl_inf
code: @[simp]
theorem compl_inf : (x ⊓ y)ᶜ = xᶜ ⊔ yᶜ 
goal: (x ⊓ y)ᶜ = xᶜ ⊔ yᶜ

full_name: compl_le_compl_iff_le
code: @[simp]
theorem compl_le_compl_iff_le : yᶜ ≤ xᶜ ↔ x ≤ y 
goal: yᶜ ≤ xᶜ ↔ x ≤ y

full_name: compl_lt_compl_iff_lt
code: @[simp] lemma compl_lt_compl_iff_lt : yᶜ < xᶜ ↔ x < y 
goal: yᶜ < xᶜ ↔ x < y

full_name: compl_le_of_compl_le
code: theorem compl_le_of_compl_le (h : yᶜ ≤ x) : xᶜ ≤ y 
goal: xᶜ ≤ y

full_name: compl_le_iff_compl_le
code: theorem compl_le_iff_compl_le : xᶜ ≤ y ↔ yᶜ ≤ x 
goal: xᶜ ≤ y ↔ yᶜ ≤ x

full_name: compl_le_self
code: @[simp] theorem compl_le_self : xᶜ ≤ x ↔ x = ⊤ 
goal: xᶜ ≤ x ↔ x = ⊤

full_name: compl_lt_self
code: @[simp] theorem compl_lt_self [Nontrivial α] : xᶜ < x ↔ x = ⊤ 
goal: xᶜ < x ↔ x = ⊤

full_name: sdiff_compl
code: @[simp]
theorem sdiff_compl : x \ yᶜ = x ⊓ y 
goal: x \ yᶜ = x ⊓ y

full_name: OrderDual.instBooleanAlgebra
code: instance OrderDual.instBooleanAlgebra : BooleanAlgebra αᵒᵈ 
goal: BooleanAlgebra αᵒᵈ

full_name: sup_inf_inf_compl
code: @[simp]
theorem sup_inf_inf_compl : x ⊓ y ⊔ x ⊓ yᶜ = x 
goal: x ⊓ y ⊔ x ⊓ yᶜ = x

full_name: compl_sdiff
code: theorem compl_sdiff : (x \ y)ᶜ = x ⇨ y 
goal: (x \ y)ᶜ = x ⇨ y

full_name: compl_himp
code: @[simp]
theorem compl_himp : (x ⇨ y)ᶜ = x \ y 
goal: (x ⇨ y)ᶜ = x \ y

full_name: compl_sdiff_compl
code: theorem compl_sdiff_compl : xᶜ \ yᶜ = y \ x 
goal: xᶜ \ yᶜ = y \ x

full_name: compl_himp_compl
code: @[simp]
theorem compl_himp_compl : xᶜ ⇨ yᶜ = y ⇨ x 
goal: xᶜ ⇨ yᶜ = y ⇨ x

full_name: disjoint_compl_left_iff
code: theorem disjoint_compl_left_iff : Disjoint xᶜ y ↔ y ≤ x 
goal: Disjoint xᶜ y ↔ y ≤ x

full_name: disjoint_compl_right_iff
code: theorem disjoint_compl_right_iff : Disjoint x yᶜ ↔ x ≤ y 
goal: Disjoint x yᶜ ↔ x ≤ y

full_name: codisjoint_himp_self_left
code: theorem codisjoint_himp_self_left : Codisjoint (x ⇨ y) x 
goal: Codisjoint (x ⇨ y) x

full_name: codisjoint_himp_self_right
code: theorem codisjoint_himp_self_right : Codisjoint x (x ⇨ y) 
goal: Codisjoint x (x ⇨ y)

full_name: himp_le
code: theorem himp_le : x ⇨ y ≤ z ↔ y ≤ z ∧ Codisjoint x z 
goal: x ⇨ y ≤ z ↔ y ≤ z ∧ Codisjoint x z

full_name: himp_le_iff
code: @[simp] lemma himp_le_iff : x ⇨ y ≤ x ↔ x = ⊤ 
goal: x ⇨ y ≤ x ↔ x = ⊤

full_name: himp_eq_left
code: @[simp] lemma himp_eq_left : x ⇨ y = x ↔ x = ⊤ ∧ y = ⊤ 
goal: x ⇨ y = x ↔ x = ⊤ ∧ y = ⊤

full_name: himp_ne_right
code: lemma himp_ne_right : x ⇨ y ≠ x ↔ x ≠ ⊤ ∨ y ≠ ⊤ 
goal: x ⇨ y ≠ x ↔ x ≠ ⊤ ∨ y ≠ ⊤

full_name: Prop.instBooleanAlgebra
code: instance Prop.instBooleanAlgebra : BooleanAlgebra Prop 
goal: BooleanAlgebra Prop

full_name: Prod.instBooleanAlgebra
code: instance Prod.instBooleanAlgebra [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) 
goal: BooleanAlgebra (α × β)

full_name: Pi.instBooleanAlgebra
code: instance Pi.instBooleanAlgebra {ι : Type u} {α : ι → Type v} [∀ i, BooleanAlgebra (α i)] :
    BooleanAlgebra (∀ i, α i) 
goal: BooleanAlgebra ((i : ι) → α i)

full_name: Bool.instBooleanAlgebra
code: instance Bool.instBooleanAlgebra : BooleanAlgebra Bool 
goal: BooleanAlgebra Bool

full_name: Bool.sup_eq_bor
code: @[simp]
theorem Bool.sup_eq_bor : (· ⊔ ·) = or 
goal: (fun x x_1 => x ⊔ x_1) = or

full_name: Bool.inf_eq_band
code: @[simp]
theorem Bool.inf_eq_band : (· ⊓ ·) = and 
goal: (fun x x_1 => x ⊓ x_1) = and

full_name: Bool.compl_eq_bnot
code: @[simp]
theorem Bool.compl_eq_bnot : HasCompl.compl = not 
goal: compl = not

full_name: Function.Injective.generalizedBooleanAlgebra
code: /-- Pullback a `GeneralizedBooleanAlgebra` along an injection. -/
protected abbrev Function.Injective.generalizedBooleanAlgebra [Sup α] [Inf α] [Bot α] [SDiff α]
    [GeneralizedBooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_bot : f ⊥ = ⊥) (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) :
    GeneralizedBooleanAlgebra α 
goal: GeneralizedBooleanAlgebra α

full_name: Function.Injective.booleanAlgebra
code: /-- Pullback a `BooleanAlgebra` along an injection. -/
protected abbrev Function.Injective.booleanAlgebra [Sup α] [Inf α] [Top α] [Bot α] [HasCompl α]
    [SDiff α] [HImp α] [BooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) (map_compl : ∀ a, f aᶜ = (f a)ᶜ)
    (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) (map_himp : ∀ a b, f (a ⇨ b) = f a ⇨ f b) :
    BooleanAlgebra α 
goal: BooleanAlgebra α

full_name: PUnit.instBooleanAlgebra
code: instance PUnit.instBooleanAlgebra : BooleanAlgebra PUnit 
goal: BooleanAlgebra PUnit.{u_2 + 1}

full_name: DistribLattice.booleanAlgebraOfComplemented
code: /--
An alternative constructor for boolean algebras:
a distributive lattice that is complemented is a boolean algebra.

This is not an instance, because it creates data using choice.
-/
noncomputable
def booleanAlgebraOfComplemented [BoundedOrder α] [ComplementedLattice α] : BooleanAlgebra α 
goal: BooleanAlgebra α