The areas / V04. Order and lattices
Mathlib.Order.Defs.Lattice
122 declarations. Mathlib docs · Source
(Semi-)lattices
Semilattices are partially ordered sets with join (least upper bound, or sup) or meet (greatest
lower bound, or inf) operations. Lattices are posets that are both join-semilattices and
meet-semilattices.
Distributive lattices are lattices which satisfy any of four equivalent distributivity properties,
of sup over inf, on the left or on the right.
Main declarations
SemilatticeSup: a type class for join semilatticesSemilatticeInf: a type class for meet semilatticesLattice: a type class for latticesDistribLattice: a type class for distributive lattices.
Notation
a ⊔ b: the supremum or join ofaandba ⊓ b: the infimum or meet ofaandb
Tags
semilattice, lattice
Semilattices
Lattices
Distributivity laws
Distributive lattices
def DistribLattice.ctorIdx E1 #
{α : Type u_1} → DistribLattice α → ℕ
def Lattice.ctorIdx E1 #
{α : Type u} → Lattice α → ℕ
def SemilatticeInf.ctorIdx E1 #
{α : Type u} → SemilatticeInf α → ℕ
def SemilatticeSup.ctorIdx E1 #
{α : Type u} → SemilatticeSup α → ℕ
class SemilatticeSup E3 #
Type u → Type u
A SemilatticeSup is a join-semilattice, that is, a partial order
with a join (a.k.a. lub / least upper bound, sup / supremum) operation
⊔ which is the least element larger than both factors.
ctor SemilatticeSup.mk E0 #
{α : Type u} →
[toPartialOrder : PartialOrder α] →
(sup : α → α → α) →
(∀ (a b : α), a ≤ sup a b) →
(∀ (a b : α), b ≤ sup a b) → (∀ (a b c : α), a ≤ c → b ≤ c → sup a b ≤ c) → SemilatticeSup α
instance SemilatticeSup.toPartialOrder E0 #
{α : Type u} → [self : SemilatticeSup α] → PartialOrder α
abbrev SemilatticeSup.sup E1 #
{α : Type u} → [self : SemilatticeSup α] → α → α → α
The binary supremum, used to derive Max α
theorem SemilatticeSup.le_sup_left E1 #
∀ {α : Type u} [self : SemilatticeSup α] (a b : α), a ≤ SemilatticeSup.sup a b
The supremum is an upper bound on the first argument
theorem SemilatticeSup.le_sup_right E1 #
∀ {α : Type u} [self : SemilatticeSup α] (a b : α), b ≤ SemilatticeSup.sup a b
The supremum is an upper bound on the second argument
theorem SemilatticeSup.sup_le E1 #
∀ {α : Type u} [self : SemilatticeSup α] (a b c : α), a ≤ c → b ≤ c → SemilatticeSup.sup a b ≤ c
The supremum is the least upper bound
class SemilatticeInf E3 #
Type u → Type u
A SemilatticeInf is a meet-semilattice, that is, a partial order
with a meet (a.k.a. glb / greatest lower bound, inf / infimum) operation
⊓ which is the greatest element smaller than both factors.
instance SemilatticeInf.toPartialOrder E0 #
{α : Type u} → [self : SemilatticeInf α] → PartialOrder α
ctor SemilatticeInf.mk E0 #
{α : Type u} →
[toPartialOrder : PartialOrder α] →
(inf : α → α → α) →
(∀ (a b : α), inf a b ≤ a) →
(∀ (a b : α), inf a b ≤ b) → (∀ (a b c : α), a ≤ b → a ≤ c → a ≤ inf b c) → SemilatticeInf α
abbrev SemilatticeInf.inf E1 #
{α : Type u} → [self : SemilatticeInf α] → α → α → α
The binary infimum, used to derive Min α
theorem SemilatticeInf.inf_le_left E2 #
∀ {α : Type u} [self : SemilatticeInf α] (a b : α), SemilatticeInf.inf a b ≤ a
The infimum is a lower bound on the first argument
theorem SemilatticeInf.inf_le_right E2 #
∀ {α : Type u} [self : SemilatticeInf α] (a b : α), SemilatticeInf.inf a b ≤ b
The infimum is a lower bound on the second argument
theorem SemilatticeInf.le_inf E2 #
∀ {α : Type u} [self : SemilatticeInf α] (a b c : α), a ≤ b → a ≤ c → a ≤ SemilatticeInf.inf b c
The infimum is the greatest lower bound
instance SemilatticeSup.toMax E0 #
{α : Type u} → [SemilatticeSup α] → Max α
instance SemilatticeInf.toMin E0 #
{α : Type u} → [SemilatticeInf α] → Min α
theorem le_sup_left E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ≤ a ⊔ b
theorem inf_le_left E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a ⊓ b ≤ a
theorem inf_le_right E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a ⊓ b ≤ b
theorem le_sup_right E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, b ≤ a ⊔ b
theorem le_inf E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {c a b : α}, c ≤ a → c ≤ b → c ≤ a ⊓ b
theorem sup_le E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b c : α}, a ≤ c → b ≤ c → a ⊔ b ≤ c
theorem le_sup_of_le_left E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b c : α}, c ≤ a → c ≤ a ⊔ b
theorem inf_le_of_left_le E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b c : α}, a ≤ c → a ⊓ b ≤ c
theorem inf_le_of_right_le E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b c : α}, b ≤ c → a ⊓ b ≤ c
theorem le_sup_of_le_right E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b c : α}, c ≤ b → c ≤ a ⊔ b
theorem lt_sup_of_lt_left E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b c : α}, c < a → c < a ⊔ b
theorem inf_lt_of_left_lt E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b c : α}, a < c → a ⊓ b < c
theorem lt_sup_of_lt_right E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b c : α}, c < b → c < a ⊔ b
theorem inf_lt_of_right_lt E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b c : α}, b < c → a ⊓ b < c
theorem le_inf_iff E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {c a b : α}, c ≤ a ⊓ b ↔ c ≤ a ∧ c ≤ b
theorem sup_le_iff E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b c : α}, a ⊔ b ≤ c ↔ a ≤ c ∧ b ≤ c
theorem sup_eq_left E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ⊔ b = a ↔ b ≤ a
theorem inf_eq_left E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a ⊓ b = a ↔ a ≤ b
theorem sup_eq_right E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ⊔ b = b ↔ a ≤ b
theorem inf_eq_right E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a ⊓ b = b ↔ b ≤ a
theorem left_eq_sup E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a = a ⊔ b ↔ b ≤ a
theorem left_eq_inf E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a = a ⊓ b ↔ a ≤ b
theorem right_eq_sup E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, b = a ⊔ b ↔ a ≤ b
theorem right_eq_inf E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, b = a ⊓ b ↔ b ≤ a
theorem le_of_sup_eq' E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ⊔ b = a → b ≤ a
Alias of the forward direction of sup_eq_left.
theorem sup_of_le_left E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, b ≤ a → a ⊔ b = a
Alias of the reverse direction of sup_eq_left.
theorem le_of_sup_eq E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ⊔ b = b → a ≤ b
Alias of the forward direction of sup_eq_right.
theorem sup_of_le_right E0 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ≤ b → a ⊔ b = b
Alias of the reverse direction of sup_eq_right.
theorem inf_of_le_left E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a ≤ b → a ⊓ b = a
Alias of the reverse direction of inf_eq_left.
theorem inf_of_le_right E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, b ≤ a → a ⊓ b = b
Alias of the reverse direction of inf_eq_right.
theorem le_of_inf_eq' E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a ⊓ b = b → b ≤ a
Alias of the forward direction of inf_eq_right.
theorem le_of_inf_eq E0 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α}, a ⊓ b = a → a ≤ b
Alias of the forward direction of inf_eq_left.
theorem sup_le_sup E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b c d : α}, a ≤ b → c ≤ d → a ⊔ c ≤ b ⊔ d
theorem inf_le_inf E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b c d : α}, b ≤ a → d ≤ c → b ⊓ d ≤ a ⊓ c
theorem sup_le_sup_left E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ≤ b → ∀ (c : α), c ⊔ a ≤ c ⊔ b
theorem inf_le_inf_left E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α} (c : α), b ≤ a → c ⊓ b ≤ c ⊓ a
theorem sup_le_sup_right E1 #
∀ {α : Type u} [inst : SemilatticeSup α] {a b : α}, a ≤ b → ∀ (c : α), a ⊔ c ≤ b ⊔ c
theorem inf_le_inf_right E1 #
∀ {α : Type u} [inst : SemilatticeInf α] {a b : α} (c : α), b ≤ a → b ⊓ c ≤ a ⊓ c
theorem sup_idem E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a : α), a ⊔ a = a
theorem inf_idem E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a : α), a ⊓ a = a
instance instIdempotentOpMin_mathlib E0 #
∀ {α : Type u} [inst : SemilatticeInf α], Std.IdempotentOp fun x1 x2 ↦ x1 ⊓ x2
instance instIdempotentOpMax_mathlib E0 #
∀ {α : Type u} [inst : SemilatticeSup α], Std.IdempotentOp fun x1 x2 ↦ x1 ⊔ x2
theorem inf_comm E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b : α), a ⊓ b = b ⊓ a
theorem sup_comm E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b : α), a ⊔ b = b ⊔ a
instance instCommutativeMax_mathlib E0 #
∀ {α : Type u} [inst : SemilatticeSup α], Std.Commutative fun x1 x2 ↦ x1 ⊔ x2
instance instCommutativeMin_mathlib E0 #
∀ {α : Type u} [inst : SemilatticeInf α], Std.Commutative fun x1 x2 ↦ x1 ⊓ x2
theorem sup_assoc E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
theorem inf_assoc E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
instance instAssociativeMax_mathlib E0 #
∀ {α : Type u} [inst : SemilatticeSup α], Std.Associative fun x1 x2 ↦ x1 ⊔ x2
instance instAssociativeMin_mathlib E0 #
∀ {α : Type u} [inst : SemilatticeInf α], Std.Associative fun x1 x2 ↦ x1 ⊓ x2
theorem sup_left_right_swap E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ b ⊔ c = c ⊔ b ⊔ a
theorem inf_left_right_swap E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ b ⊓ c = c ⊓ b ⊓ a
theorem inf_left_idem E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b : α), a ⊓ (a ⊓ b) = a ⊓ b
theorem sup_left_idem E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b : α), a ⊔ (a ⊔ b) = a ⊔ b
theorem sup_right_idem E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b : α), a ⊔ b ⊔ b = a ⊔ b
theorem inf_right_idem E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b : α), a ⊓ b ⊓ b = a ⊓ b
theorem sup_left_comm E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ (b ⊔ c) = b ⊔ (a ⊔ c)
theorem inf_left_comm E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ (b ⊓ c) = b ⊓ (a ⊓ c)
theorem inf_right_comm E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ b ⊓ c = a ⊓ c ⊓ b
theorem sup_right_comm E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ b ⊔ c = a ⊔ c ⊔ b
theorem sup_sup_sup_comm E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c d : α), a ⊔ b ⊔ (c ⊔ d) = a ⊔ c ⊔ (b ⊔ d)
theorem inf_inf_inf_comm E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c d : α), a ⊓ b ⊓ (c ⊓ d) = a ⊓ c ⊓ (b ⊓ d)
theorem inf_rotate E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ b ⊓ c = b ⊓ c ⊓ a
theorem sup_rotate E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ b ⊔ c = b ⊔ c ⊔ a
theorem inf_rotate' E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ (b ⊓ c) = b ⊓ (c ⊓ a)
theorem sup_rotate' E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ (b ⊔ c) = b ⊔ (c ⊔ a)
theorem inf_inf_distrib_left E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ (b ⊓ c) = a ⊓ b ⊓ (a ⊓ c)
theorem sup_sup_distrib_left E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ (b ⊔ c) = a ⊔ b ⊔ (a ⊔ c)
theorem inf_inf_distrib_right E1 #
∀ {α : Type u} [inst : SemilatticeInf α] (a b c : α), a ⊓ b ⊓ c = a ⊓ c ⊓ (b ⊓ c)
theorem sup_sup_distrib_right E1 #
∀ {α : Type u} [inst : SemilatticeSup α] (a b c : α), a ⊔ b ⊔ c = a ⊔ c ⊔ (b ⊔ c)
class Lattice E3 #
Type u → Type u
A lattice is a join-semilattice which is also a meet-semilattice.
instance Lattice.toSemilatticeSup E0 #
{α : Type u} → [self : Lattice α] → SemilatticeSup α
ctor Lattice.mk E0 #
{α : Type u} →
[toSemilatticeSup : SemilatticeSup α] →
(inf : α → α → α) →
(∀ (a b : α), inf a b ≤ a) → (∀ (a b : α), inf a b ≤ b) → (∀ (a b c : α), a ≤ b → a ≤ c → a ≤ inf b c) → Lattice α
theorem Lattice.inf_le_left E2 #
∀ {α : Type u} [self : Lattice α] (a b : α), Lattice.inf a b ≤ a
The infimum is a lower bound on the first argument
theorem Lattice.le_inf E2 #
∀ {α : Type u} [self : Lattice α] (a b c : α), a ≤ b → a ≤ c → a ≤ Lattice.inf b c
The infimum is the greatest lower bound
abbrev Lattice.inf E1 #
{α : Type u} → [self : Lattice α] → α → α → α
The binary infimum, used to derive Min α
instance Lattice.toSemilatticeInf E0 #
{α : Type u} → [self : Lattice α] → SemilatticeInf α
theorem Lattice.inf_le_right E2 #
∀ {α : Type u} [self : Lattice α] (a b : α), Lattice.inf a b ≤ b
The infimum is a lower bound on the second argument
theorem inf_le_sup E1 #
∀ {α : Type u} [inst : Lattice α] {a b : α}, a ⊓ b ≤ a ⊔ b
theorem sup_le_inf E1 #
∀ {α : Type u} [inst : Lattice α] {a b : α}, a ⊔ b ≤ a ⊓ b ↔ a = b
theorem inf_right_le_sup_left E0 #
∀ {α : Type u} [inst : Lattice α] {a b c : α}, b ⊓ c ≤ a ⊔ b
theorem inf_left_le_sup_right E0 #
∀ {α : Type u} [inst : Lattice α] {a b c : α}, a ⊓ b ≤ b ⊔ c
theorem inf_right_le_sup_right E0 #
∀ {α : Type u} [inst : Lattice α] {a b c : α}, b ⊓ a ≤ b ⊔ c
theorem inf_left_le_sup_left E0 #
∀ {α : Type u} [inst : Lattice α] {a b c : α}, a ⊓ b ≤ c ⊔ b
theorem le_inf_sup E1 #
∀ {α : Type u} [inst : Lattice α] {a b c : α}, a ⊓ b ⊔ a ⊓ c ≤ a ⊓ (b ⊔ c)
theorem sup_inf_le E1 #
∀ {α : Type u} [inst : Lattice α] {a b c : α}, a ⊔ b ⊓ c ≤ (a ⊔ b) ⊓ (a ⊔ c)
theorem inf_sup_self E1 #
∀ {α : Type u} [inst : Lattice α] {a b : α}, a ⊓ (a ⊔ b) = a
theorem sup_inf_self E1 #
∀ {α : Type u} [inst : Lattice α] {a b : α}, a ⊔ a ⊓ b = a
theorem sup_eq_iff_inf_eq E0 #
∀ {α : Type u} [inst : Lattice α] {a b : α}, a ⊔ b = b ↔ a ⊓ b = a
theorem inf_eq_iff_sup_eq E0 #
∀ {α : Type u} [inst : Lattice α] {a b : α}, a ⊓ b = b ↔ a ⊔ b = a
class DistribLattice E3 #
Type u_1 → Type u_1
A distributive lattice is a lattice that satisfies any of four
equivalent distributive properties (of sup over inf or inf over sup,
on the left or right).
The definition here chooses le_sup_inf: (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ (y ⊓ z). To prove distributivity
from the dual law, use DistribLattice.ofInfSupLe.
A classic example of a distributive lattice is the lattice of subsets of a set, and in fact this example is generic in the sense that every distributive lattice is realizable as a sublattice of a powerset lattice.
instance DistribLattice.toLattice E0 #
{α : Type u_1} → [self : DistribLattice α] → Lattice α
ctor DistribLattice.mk E0 #
{α : Type u_1} → [toLattice : Lattice α] → (∀ (x y z : α), (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ y ⊓ z) → DistribLattice α
theorem DistribLattice.le_sup_inf E1 #
∀ {α : Type u_1} [self : DistribLattice α] (x y z : α), (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ y ⊓ z
The infimum distributes over the supremum
abbrev DistribLattice.ofInfSupLe E1 #
{α : Type u} → [inst : Lattice α] → (∀ (a b c : α), a ⊓ (b ⊔ c) ≤ a ⊓ b ⊔ a ⊓ c) → DistribLattice α
Prove distributivity of an existing lattice from the dual distributive law.
theorem le_sup_inf E1 #
∀ {α : Type u} [inst : DistribLattice α] {x y z : α}, (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ y ⊓ z
theorem sup_inf_left E1 #
∀ {α : Type u} [inst : DistribLattice α] (a b c : α), a ⊔ b ⊓ c = (a ⊔ b) ⊓ (a ⊔ c)
theorem sup_inf_right E1 #
∀ {α : Type u} [inst : DistribLattice α] (a b c : α), a ⊓ b ⊔ c = (a ⊔ c) ⊓ (b ⊔ c)
theorem inf_sup_left E1 #
∀ {α : Type u} [inst : DistribLattice α] (a b c : α), a ⊓ (b ⊔ c) = a ⊓ b ⊔ a ⊓ c
theorem inf_sup_le E1 #
∀ {α : Type u} [inst : DistribLattice α] {x y z : α}, x ⊓ (y ⊔ z) ≤ x ⊓ y ⊔ x ⊓ z
theorem inf_sup_right E1 #
∀ {α : Type u} [inst : DistribLattice α] (a b c : α), (a ⊔ b) ⊓ c = a ⊓ c ⊔ b ⊓ c
theorem le_of_inf_le_sup_le E1 #
∀ {α : Type u} [inst : DistribLattice α] {x y z : α}, x ⊓ z ≤ y ⊓ z → x ⊔ z ≤ y ⊔ z → x ≤ y