IsarMathLib

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

theory Order_ZF_1a imports Order_ZF
begin

This theory is a continuation of Order_ZF and talks about maximum and minimum of a set, supremum and infimum and strict (not reflexive) versions of order relations.

Maximum and minimum of a set

In this section we show that maximum and minimum are unique if they exist. We also show that union of sets that have maxima (minima) has a maximum (minimum). We also show that singletons have maximum and minimum. All this allows to show (in Finite_ZF) that every finite set has well-defined maximum and minimum.

A somewhat technical fact that allows to reduce the number of premises in some theorems: the assumption that a set has a maximum implies that it is not empty.

lemma set_max_not_empty:

assumes HasAmaximum(r,A)

shows A0 using assms unfolding HasAmaximum_def

If a set has a maximum implies that it is not empty.

lemma set_min_not_empty:

assumes HasAminimum(r,A)

shows A0 using assms unfolding HasAminimum_def

If a set has a supremum then it cannot be empty. We are probably using the fact that =, which makes me a bit anxious as this I think is just a convention.

lemma set_sup_not_empty:

assumes HasAsupremum(r,A)

shows A0proof

If a set has an infimum then it cannot be empty.

lemma set_inf_not_empty:

assumes HasAnInfimum(r,A)

shows A0proof

For antisymmetric relations maximum of a set is unique if it exists.

lemma Order_ZF_4_L1:

assumes A1: antisym(r) and A2: HasAmaximum(r,A)

shows !M. MA(xA. x,Mr)proof

For antisymmetric relations minimum of a set is unique if it exists.

lemma Order_ZF_4_L2:

assumes A1: antisym(r) and A2: HasAminimum(r,A)

shows !m. mA(xA. m,xr)proof

Maximum of a set has desired properties.

lemma Order_ZF_4_L3:

assumes A1: antisym(r) and A2: HasAmaximum(r,A)

shows Maximum(r,A)A, xA. x,Maximum(r,A)rproof

Minimum of a set has desired properties.

lemma Order_ZF_4_L4:

assumes A1: antisym(r) and A2: HasAminimum(r,A)

shows Minimum(r,A)A, xA. Minimum(r,A),xrproof

For total and transitive relations a union a of two sets that have maxima has a maximum.

lemma Order_ZF_4_L5:

assumes A1: r is total on (AB) and A2: trans(r) and A3: HasAmaximum(r,A), HasAmaximum(r,B)

shows HasAmaximum(r,AB)proof

For total and transitive relations A union a of two sets that have minima has a minimum.

lemma Order_ZF_4_L6:

assumes A1: r is total on (AB) and A2: trans(r) and A3: HasAminimum(r,A), HasAminimum(r,B)

shows HasAminimum(r,AB)proof

Set that has a maximum is bounded above.

lemma Order_ZF_4_L7:

assumes HasAmaximum(r,A)

shows IsBoundedAbove(A,r) using assms, HasAmaximum_def, IsBoundedAbove_def

Set that has a minimum is bounded below.

lemma Order_ZF_4_L8A:

assumes HasAminimum(r,A)

shows IsBoundedBelow(A,r) using assms, HasAminimum_def, IsBoundedBelow_def

A subset of a set that has a maximum is bounded above.

lemma max_subset_bounded:

assumes HasAmaximum(r,A) and BA

shows IsBoundedAbove(B,r)proof

A subset of a set that has a minimum is bounded below.

lemma min_subset_bounded:

assumes HasAminimum(r,A) and BA

shows IsBoundedBelow(B,r)proof

For reflexive relations singletons have a minimum and maximum.

lemma Order_ZF_4_L8:

assumes refl(X,r) and aX

shows HasAmaximum(r,{a}), HasAminimum(r,{a}) using assms, refl_def, HasAmaximum_def, HasAminimum_def

For total and transitive relations if we add an element to a set that has a maximum, the set still has a maximum.

lemma Order_ZF_4_L9:

assumes A1: r is total on X and A2: trans(r) and A3: AX and A4: aX and A5: HasAmaximum(r,A)

shows HasAmaximum(r,A{a})proof

For total and transitive relations if we add an element to a set that has a minimum, the set still has a minimum.

lemma Order_ZF_4_L10:

assumes A1: r is total on X and A2: trans(r) and A3: AX and A4: aX and A5: HasAminimum(r,A)

shows HasAminimum(r,A{a})proof

If the order relation has a property that every nonempty bounded set attains a minimum (for example integers are like that), then every nonempty set bounded below attains a minimum.

lemma Order_ZF_4_L11:

assumes A1: r is total on X and A2: trans(r) and A3: rX×X and A4: A. IsBounded(A,r)A0HasAminimum(r,A) and A5: B0 and A6: IsBoundedBelow(B,r)

shows HasAminimum(r,B)proof

A dual to Order_ZF_4_L11: If the order relation has a property that every nonempty bounded set attains a maximum (for example integers are like that), then every nonempty set bounded above attains a maximum.

lemma Order_ZF_4_L11A:

assumes A1: r is total on X and A2: trans(r) and A3: rX×X and A4: A. IsBounded(A,r)A0HasAmaximum(r,A) and A5: B0 and A6: IsBoundedAbove(B,r)

shows HasAmaximum(r,B)proof

If a set has a minimum and L is less or equal than all elements of the set, then L is less or equal than the minimum.

lemma Order_ZF_4_L12:

assumes antisym(r) and HasAminimum(r,A) and aA. L,ar

shows L,Minimum(r,A)r using assms, Order_ZF_4_L4

If a set has a maximum and all its elements are less or equal than M, then the maximum of the set is less or equal than M.

lemma Order_ZF_4_L13:

assumes antisym(r) and HasAmaximum(r,A) and aA. a,Mr

shows Maximum(r,A),Mr using assms, Order_ZF_4_L3

If an element belongs to a set and is greater or equal than all elements of that set, then it is the maximum of that set.

lemma Order_ZF_4_L14:

assumes A1: antisym(r) and A2: MA and A3: aA. a,Mr

shows Maximum(r,A)=Mproof

If an element belongs to a set and is less or equal than all elements of that set, then it is the minimum of that set.

lemma Order_ZF_4_L15:

assumes A1: antisym(r) and A2: mA and A3: aA. m,ar

shows Minimum(r,A)=mproof

If a set does not have a maximum, then for any its element we can find one that is (strictly) greater.

lemma Order_ZF_4_L16:

assumes A1: antisym(r) and A2: r is total on X and A3: AX and A4: ¬HasAmaximum(r,A) and A5: xA

shows yA. x,yryxproof

Supremum and Infimum

In this section we consider the notions of supremum and infimum a set.

Elements of the set of upper bounds are indeed upper bounds. Isabelle also thinks it is obvious.

lemma Order_ZF_5_L1:

assumes u(aA. r{a}) and aA

shows a,ur using assms

Elements of the set of lower bounds are indeed lower bounds. Isabelle also thinks it is obvious.

lemma Order_ZF_5_L2:

assumes l(aA. r1{a}) and aA

shows l,ar using assms

If the set of upper bounds has a minimum, then the supremum is less or equal than any upper bound. We can probably do away with the assumption that A is not empty, (ab)using the fact that intersection over an empty family is defined in Isabelle to be empty. This lemma is obsolete and will be removed in the future. Use sup_leq_up_bnd instead.

lemma Order_ZF_5_L3:

assumes A1: antisym(r) and A2: A0 and A3: HasAminimum(r,aA. r{a}) and A4: aA. a,ur

shows Supremum(r,A),urproof

Supremum is less or equal than any upper bound.

lemma sup_leq_up_bnd:

assumes antisym(r), HasAsupremum(r,A), aA. a,ur

shows Supremum(r,A),urproof

Infimum is greater or equal than any lower bound. This lemma is obsolete and will be removed. Use inf_geq_lo_bnd instead.

lemma Order_ZF_5_L4:

assumes A1: antisym(r) and A2: A0 and A3: HasAmaximum(r,aA. r1{a}) and A4: aA. l,ar

shows l,Infimum(r,A)rproof

Infimum is greater or equal than any upper bound.

lemma inf_geq_lo_bnd:

assumes antisym(r), HasAnInfimum(r,A), aA. u,ar

shows u,Infimum(r,A)rproof

If z is an upper bound for A and is less or equal than any other upper bound, then z is the supremum of A.

lemma Order_ZF_5_L5:

assumes A1: antisym(r) and A2: A0 and A3: xA. x,zr and A4: y. (xA. x,yr)z,yr

shows HasAminimum(r,aA. r{a}), z=Supremum(r,A)proof

The dual theorem to Order_ZF_5_L5: if z is an lower bound for A and is greater or equal than any other lower bound, then z is the infimum of A.

lemma inf_glb:

assumes antisym(r), A0, xA. z,xr, y. (xA. y,xr)y,zr

shows HasAmaximum(r,aA. r1{a}), z=Infimum(r,A)proof

Supremum and infimum of a singleton is the element.

lemma sup_inf_singl:

assumes antisym(r), refl(X,r), zX

shows HasAsupremum(r,{z}), Supremum(r,{z})=z and HasAnInfimum(r,{z}), Infimum(r,{z})=zproof

If a set has a maximum, then the maximum is the supremum. This lemma is obsolete, use max_is_sup instead.

lemma Order_ZF_5_L6:

assumes A1: antisym(r) and A2: A0 and A3: HasAmaximum(r,A)

shows HasAminimum(r,aA. r{a}), Maximum(r,A)=Supremum(r,A)proof

Another version of Order_ZF_5_L6 that: if a sat has a maximum then it has a supremum and the maximum is the supremum.

lemma max_is_sup:

assumes antisym(r), A0, HasAmaximum(r,A)

shows HasAsupremum(r,A) and Maximum(r,A)=Supremum(r,A)proof

Minimum is the infimum if it exists.

lemma min_is_inf:

assumes antisym(r), A0, HasAminimum(r,A)

shows HasAnInfimum(r,A) and Minimum(r,A)=Infimum(r,A)proof

For reflexive and total relations two-element set has a minimum and a maximum.

lemma min_max_two_el:

assumes r is total on X, xX, yX

shows HasAminimum(r,{x,y}) and HasAmaximum(r,{x,y}) using assms unfolding IsTotal_def, HasAminimum_def, HasAmaximum_def

For antisymmetric, reflexive and total relations two-element set has a supremum and infimum.

lemma inf_sup_two_el:

assumes antisym(r), r is total on X, xX, yX

shows HasAnInfimum(r,{x,y}), Minimum(r,{x,y})=Infimum(r,{x,y}), HasAsupremum(r,{x,y}), Maximum(r,{x,y})=Supremum(r,{x,y}) using assms, min_max_two_el, max_is_sup, min_is_inf

A sufficient condition for the supremum to be in the space.

lemma sup_in_space:

assumes rX×X, antisym(r), HasAminimum(r,aA. r{a})

shows Supremum(r,A)X and xA. x,Supremum(r,A)rproof

A sufficient condition for the infimum to be in the space.

lemma inf_in_space:

assumes rX×X, antisym(r), HasAmaximum(r,aA. r1{a})

shows Infimum(r,A)X and xA. Infimum(r,A),xrproof

Properties of supremum of a set for complete relations.

lemma Order_ZF_5_L7:

assumes A1: rX×X and A2: antisym(r) and A3: r is complete  and A4: A0 and A5: xX. yA. y,xr

shows Supremum(r,A)X and xA. x,Supremum(r,A)rproof

Infimum of the set of infima of a collection of sets is infimum of the union.

lemma inf_inf:

assumes rX×X, antisym(r), trans(r), TT. HasAnInfimum(r,T), HasAnInfimum(r,{Infimum(r,T). TT})

shows HasAnInfimum(r,T) and Infimum(r,{Infimum(r,T). TT})=Infimum(r,T)proof

Supremum of the set of suprema of a collection of sets is supremum of the union.

lemma sup_sup:

assumes rX×X, antisym(r), trans(r), TT. HasAsupremum(r,T), HasAsupremum(r,{Supremum(r,T). TT})

shows HasAsupremum(r,T) and Supremum(r,{Supremum(r,T). TT})=Supremum(r,T)proof

If the relation is a linear order then for any element y smaller than the supremum of a set we can find one element of the set that is greater than y.

lemma Order_ZF_5_L8:

assumes A1: rX×X and A2: IsLinOrder(X,r) and A3: r is complete  and A4: AX, A0 and A5: xX. yA. y,xr and A6: y,Supremum(r,A)r, ySupremum(r,A)

shows zA. y,zryzproof

Strict versions of order relations

One of the problems with translating formalized mathematics from Metamath to IsarMathLib is that Metamath uses strict orders (of the < type) while in IsarMathLib we mostly use nonstrict orders (of the type). This doesn't really make any difference, but is annoying as we have to prove many theorems twice. In this section we prove some theorems to make it easier to translate the statements about strict orders to statements about the corresponding non-strict order and vice versa.

We define a strict version of a relation by removing the y=x line from the relation.

definition

StrictVersion(r)r{x,x. xdomain(r)}

A reformulation of the definition of a strict version of an order.

lemma def_of_strict_ver:

shows x,yStrictVersion(r)x,yrxy using StrictVersion_def, domain_def

The next lemma is about the strict version of an antisymmetric relation.

lemma strict_of_antisym:

assumes A1: antisym(r) and A2: a,bStrictVersion(r)

shows b,aStrictVersion(r)proof

The strict version of totality.

lemma strict_of_tot:

assumes r is total on X and aX, bX, ab

shows a,bStrictVersion(r)b,aStrictVersion(r) using assms, IsTotal_def, def_of_strict_ver

A trichotomy law for the strict version of a total and antisymmetric relation. It is kind of interesting that one does not need the full linear order for this.

lemma strict_ans_tot_trich:

assumes A1: antisym(r) and A2: r is total on X and A3: aX, bX and A4: s=StrictVersion(r)

shows Exactly_1_of_3_holds(a,bs,a=b,b,as)proof

A trichotomy law for linear order. This is a special case of strict_ans_tot_trich.

corollary strict_lin_trich:

assumes A1: IsLinOrder(X,r) and A2: aX, bX and A3: s=StrictVersion(r)

shows Exactly_1_of_3_holds(a,bs,a=b,b,as) using assms, IsLinOrder_def, strict_ans_tot_trich

For an antisymmetric relation if a pair is in relation then the reversed pair is not in the strict version of the relation.

lemma geq_impl_not_less:

assumes A1: antisym(r) and A2: a,br

shows b,aStrictVersion(r)proof

If an antisymmetric relation is transitive, then the strict version is also transitive, an explicit version strict_of_transB below.

lemma strict_of_transA:

assumes A1: trans(r) and A2: antisym(r) and A3: s=StrictVersion(r) and A4: a,bs, b,cs

shows a,csproof

If an antisymmetric relation is transitive, then the strict version is also transitive.

lemma strict_of_transB:

assumes A1: trans(r) and A2: antisym(r)

shows trans(StrictVersion(r))proof

The next lemma provides a condition that is satisfied by the strict version of a relation if the original relation is a complete linear order.

lemma strict_of_compl:

assumes A1: rX×X and A2: IsLinOrder(X,r) and A3: r is complete  and A4: AX, A0 and A5: s=StrictVersion(r) and A6: uX. yA. y,us

shows xX. (yA. x,ys)(yX. y,xs(zA. y,zs))proof

Strict version of a relation on a set is a relation on that set.

lemma strict_ver_rel:

assumes A1: rA×A

shows StrictVersion(r)A×A using assms, StrictVersion_def
end