IsarMathLib

Proofs by humans, for humans, formally verified by Isabelle/ZF proof assistant

theory Lattice_ZF imports Order_ZF_1a func1
begin

Lattices can be introduced in algebraic way as commutative idempotent (xx=x) semigroups or as partial orders with some additional properties. These two approaches are equivalent. In this theory we will use the order-theoretic approach.

Semilattices

We start with a relation r which is a partial order on a set L. Such situation is defined in Order_ZF as the predicate IsPartOrder(L,r).

A partially ordered (L,r) set is a join-semilattice if each two-element subset of L has a supremum (i.e. the least upper bound).

definition

IsJoinSemilattice(L,r) rL×LIsPartOrder(L,r)(xL. yL. HasAsupremum(r,{x,y}))

A partially ordered (L,r) set is a meet-semilattice if each two-element subset of L has an infimum (i.e. the greatest lower bound).

definition

IsMeetSemilattice(L,r) rL×LIsPartOrder(L,r)(xL. yL. HasAnInfimum(r,{x,y}))

A partially ordered (L,r) set is a lattice if it is both join and meet-semilattice, i.e. if every two element set has a supremum (least upper bound) and infimum (greatest lower bound).

definition

r is a lattice on LIsJoinSemilattice(L,r)IsMeetSemilattice(L,r)

Join is a binary operation whose value on a pair x,y is defined as the supremum of the set {x,y}.

definition

Join(L,r){p,Supremum(r,{fst(p),snd(p)}). pL×L}

Meet is a binary operation whose value on a pair x,y is defined as the infimum of the set {x,y}.

definition

Meet(L,r){p,Infimum(r,{fst(p),snd(p)}). pL×L}

Linear order is a lattice.

lemma lin_is_latt:

assumes rL×L and IsLinOrder(L,r)

shows r is a lattice on Lproof

In a join-semilattice join is indeed a binary operation.

lemma join_is_binop:

assumes IsJoinSemilattice(L,r)

shows Join(L,r):L×LLproof

The value of Join(L,r) on a pair x,y is the supremum of the set {x,y}, hence its is greater or equal than both.

lemma join_val:

assumes IsJoinSemilattice(L,r), xL, yL

defines jJoin(L,r)x,y

shows jL, j=Supremum(r,{x,y}), x,jr, y,jrproof

In a meet-semilattice meet is indeed a binary operation.

lemma meet_is_binop:

assumes IsMeetSemilattice(L,r)

shows Meet(L,r):L×LLproof

The value of Meet(L,r) on a pair x,y is the infimum of the set {x,y}, hence is less or equal than both.

lemma meet_val:

assumes IsMeetSemilattice(L,r), xL, yL

defines mMeet(L,r)x,y

shows mL, m=Infimum(r,{x,y}), m,xr, m,yrproof

In a (nonempty) meet semi-lattice the relation down-directs the set.

lemma meet_down_directs:

assumes IsMeetSemilattice(L,r), L0

shows r down-directs Lproof

In a (nonempty) join semi-lattice the relation up-directs the set.

lemma join_up_directs:

assumes IsJoinSemilattice(L,r), L0

shows r up-directs Lproof

The next locale defines a a notation for join-semilattice. We will use the symbol rather than more common to avoid confusion with logical "or".

locale join_semilatt

assumes joinLatt: IsJoinSemilattice(L,r)

defines xyJoin(L,r)x,y

defines supASupremum(r,A)

Join of the elements of the lattice is in the lattice.

lemma (in join_semilatt) join_props:

assumes xL, yL

shows xyL and xy=sup{x,y}proof

Join is associative.

lemma (in join_semilatt) join_assoc:

assumes xL, yL, zL

shows x(yz)=xyzproof

Join is idempotent.

lemma (in join_semilatt) join_idempotent:

assumes xL

shows xx=x using joinLatt, assms, join_val(2), IsJoinSemilattice_def, IsPartOrder_def, sup_inf_singl(2)

The meet_semilatt locale is the dual of the join-semilattice locale defined above. We will use the symbol to denote join, giving it ab bit higher precedence.

locale meet_semilatt

assumes meetLatt: IsMeetSemilattice(L,r)

defines xyMeet(L,r)x,y

defines infAInfimum(r,A)

Meet of the elements of the lattice is in the lattice.

lemma (in meet_semilatt) meet_props:

assumes xL, yL

shows xyL and xy=inf{x,y}proof

Meet is associative.

lemma (in meet_semilatt) meet_assoc:

assumes xL, yL, zL

shows x(yz)=xyzproof

Meet is idempotent.

lemma (in meet_semilatt) meet_idempotent:

assumes xL

shows xx=x using meetLatt, assms, meet_val, IsMeetSemilattice_def, IsPartOrder_def, sup_inf_singl(4)
end