Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit b8b18fa

Browse files
committed
feat(order/complete_boolean_algebra): A frame is distributive (#15340)
`frame α`/`coframe α` imply `distrib_lattice α`.
1 parent 11bfd9c commit b8b18fa

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/order/complete_boolean_algebra.lean

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ instance pi.frame {ι : Type*} {π : ι → Type*} [Π i, frame (π i)] : frame
142142
← supr_subtype''],
143143
..pi.complete_lattice }
144144

145+
@[priority 100] -- see Note [lower instance priority]
146+
instance frame.to_distrib_lattice : distrib_lattice α :=
147+
distrib_lattice.of_inf_sup_le $ λ a b c,
148+
by rw [←Sup_pair, ←Sup_pair, inf_Sup_eq, ←Sup_image, image_pair]
149+
145150
end frame
146151

147152
section coframe
@@ -189,6 +194,11 @@ instance pi.coframe {ι : Type*} {π : ι → Type*} [Π i, coframe (π i)] : co
189194
by simp only [←sup_infi_eq, Inf_apply, ←infi_subtype'', infi_apply, pi.sup_apply],
190195
..pi.complete_lattice }
191196

197+
@[priority 100] -- see Note [lower instance priority]
198+
instance coframe.to_distrib_lattice : distrib_lattice α :=
199+
{ le_sup_inf := λ a b c, by rw [←Inf_pair, ←Inf_pair, sup_Inf_eq, ←Inf_image, image_pair],
200+
..‹coframe α› }
201+
192202
end coframe
193203

194204
section complete_distrib_lattice
@@ -202,12 +212,6 @@ instance pi.complete_distrib_lattice {ι : Type*} {π : ι → Type*}
202212

203213
end complete_distrib_lattice
204214

205-
@[priority 100] -- see Note [lower instance priority]
206-
instance complete_distrib_lattice.to_distrib_lattice [d : complete_distrib_lattice α] :
207-
distrib_lattice α :=
208-
{ le_sup_inf := λ x y z, by rw [← Inf_pair, ← Inf_pair, sup_Inf_eq, ← Inf_image, set.image_pair],
209-
..d }
210-
211215
/-- A complete Boolean algebra is a completely distributive Boolean algebra. -/
212216
class complete_boolean_algebra α extends boolean_algebra α, complete_distrib_lattice α
213217

src/order/lattice.lean

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ end lattice
553553
equivalent distributive properties (of `sup` over `inf` or `inf` over `sup`,
554554
on the left or right).
555555
556-
The definition here chooses `le_sup_inf`: `(x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ (y ⊓ z)`.
556+
The definition here chooses `le_sup_inf`: `(x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ (y ⊓ z)`. To prove distributivity
557+
from the dual law, use `distrib_lattice.of_inf_sup_le`.
557558
558559
A classic example of a distributive lattice
559560
is the lattice of subsets of a set, and in fact this example is
@@ -562,9 +563,6 @@ as a sublattice of a powerset lattice. -/
562563
class distrib_lattice α extends lattice α :=
563564
(le_sup_inf : ∀x y z : α, (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ (y ⊓ z))
564565

565-
/- TODO: alternative constructors from the other distributive properties,
566-
and perhaps a `tfae` statement -/
567-
568566
section distrib_lattice
569567
variables [distrib_lattice α] {x y z : α}
570568

@@ -608,6 +606,13 @@ le_antisymm
608606

609607
end distrib_lattice
610608

609+
/-- Prove distributivity of an existing lattice from the dual distributive law. -/
610+
@[reducible] -- See note [reducible non-instances]
611+
def distrib_lattice.of_inf_sup_le [lattice α]
612+
(inf_sup_le : ∀ a b c : α, a ⊓ (b ⊔ c) ≤ (a ⊓ b) ⊔ (a ⊓ c)) : distrib_lattice α :=
613+
{ ..‹lattice α›,
614+
..@order_dual.distrib_lattice αᵒᵈ { le_sup_inf := inf_sup_le, ..order_dual.lattice _ } }
615+
611616
/-!
612617
### Lattices derived from linear orders
613618
-/

0 commit comments

Comments
 (0)