In this theory we consider some properties of functions related to order relations
This section deals with functions between ordered sets.
If every value of a function on a set is bounded below by a constant, then the image of the set is bounded below.
lemma func_ZF_8_L1:
assumes \( f:X\rightarrow Y \) and \( A\subseteq X \) and \( \forall x\in A.\ \langle L,f(x)\rangle \in r \)
shows \( \text{IsBoundedBelow}(f(A),r) \)proofIf every value of a function on a set is bounded above by a constant, then the image of the set is bounded above.
lemma func_ZF_8_L2:
assumes \( f:X\rightarrow Y \) and \( A\subseteq X \) and \( \forall x\in A.\ \langle f(x),U\rangle \in r \)
shows \( \text{IsBoundedAbove}(f(A),r) \)proofIdentity is an order isomorphism.
lemma id_ord_iso:
shows \( id(X) \in ord\_iso(X,r,X,r) \) using id_bij, id_def, ord_iso_defIdentity is the only order automorphism of a singleton.
lemma id_ord_auto_singleton:
shows \( ord\_iso(\{x\},r,\{x\},r) = \{id(\{x\})\} \) using id_ord_iso, ord_iso_def, single_bij_idThe image of a maximum by an order isomorphism is a maximum. Note that from the fact the \(r\) is antisymmetric and \(f\) is an order isomorphism between \((A,r)\) and \((B,R)\) we can not conclude that \(R\) is antisymmetric (we can only show that \(R\cap (B\times B)\) is).
lemma max_image_ord_iso:
assumes A1: \( \text{antisym}(r) \) and A2: \( \text{antisym}(R) \) and A3: \( f \in ord\_iso(A,r,B,R) \) and A4: \( \text{HasAmaximum}(r,A) \)
shows \( \text{HasAmaximum}(R,B) \) and \( \text{Maximum}(R,B) = f( \text{Maximum}(r,A)) \)proofMaximum is a fixpoint of order automorphism.
lemma max_auto_fixpoint:
assumes \( \text{antisym}(r) \) and \( f \in ord\_iso(A,r,A,r) \) and \( \text{HasAmaximum}(r,A) \)
shows \( \text{Maximum}(r,A) = f( \text{Maximum}(r,A)) \) using assms, max_image_ord_isoIf two sets are order isomorphic and we remove \(x\) and \(f(x)\), respectively, from the sets, then they are still order isomorphic.
lemma ord_iso_rem_point:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( a \in A \)
shows \( \text{restrict}(f,A-\{a\}) \in ord\_iso(A-\{a\},r,B-\{f(a)\},R) \)proofIf two sets are order isomorphic and we remove maxima from the sets, then they are still order isomorphic.
corollary ord_iso_rem_max:
assumes A1: \( \text{antisym}(r) \) and \( f \in ord\_iso(A,r,B,R) \) and A4: \( \text{HasAmaximum}(r,A) \) and A5: \( M = \text{Maximum}(r,A) \)
shows \( \text{restrict}(f,A-\{M\}) \in ord\_iso(A-\{M\}, r, B-\{f(M)\},R) \) using assms, Order_ZF_4_L3, ord_iso_rem_pointLemma about extending order isomorphisms by adding one point to the domain.
lemma ord_iso_extend:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( M_A \notin A \), \( M_B \notin B \) and A3: \( \forall a\in A.\ \langle a, M_A\rangle \in r \), \( \forall b\in B.\ \langle b, M_B\rangle \in R \) and A4: \( \text{antisym}(r) \), \( \text{antisym}(R) \) and A5: \( \langle M_A,M_A\rangle \in r \longleftrightarrow \langle M_B,M_B\rangle \in R \)
shows \( f \cup \{\langle M_A,M_B\rangle \} \in ord\_iso(A\cup \{M_A\} ,r,B\cup \{M_B\} ,R) \)proofA kind of converse to ord_iso_rem_max: if two linearly ordered sets sets are order isomorphic after removing the maxima, then they are order isomorphic.
lemma rem_max_ord_iso:
assumes A1: \( \text{IsLinOrder}(X,r) \), \( \text{IsLinOrder}(Y,R) \) and A2: \( \text{HasAmaximum}(r,X) \), \( \text{HasAmaximum}(R,Y) \), \( ord\_iso(X - \{ \text{Maximum}(r,X)\},r,Y - \{ \text{Maximum}(R,Y)\},R) \neq 0 \)
shows \( ord\_iso(X,r,Y,R) \neq 0 \)proofIn this section we consider maps arising naturally in cartesian products.
There is a natural bijection etween \(X=Y\times \{ y\}\) (a "slice") and \(Y\). We will call this the \( \text{SliceProjection}(Y\times \{y\}) \). This is really the ZF equivalent of the meta-function \( \text{fst}(x) \).
definition
\( \text{SliceProjection}(X) \equiv \{\langle p,\text{fst}(p)\rangle .\ p \in X \} \)
A slice projection is a bijection between \(X\times\{ y\}\) and \(X\).
lemma slice_proj_bij:
shows \( \text{SliceProjection}(X\times \{y\}): X\times \{y\} \rightarrow X \), \( domain( \text{SliceProjection}(X\times \{y\})) = X\times \{y\} \), \( \forall p\in X\times \{y\}.\ \text{SliceProjection}(X\times \{y\})(p) = \text{fst}(p) \), \( \text{SliceProjection}(X\times \{y\}) \in \text{bij}(X\times \{y\},X) \)proofGiven 2 functions \(f:A\to B\) and \(g:C\to D\) , we can consider a function \(h:A\times C \to B\times D\) such that \(h(x,y)=\langle f(x),g(y)\rangle\)
definition
\( \text{ProdFunction}(f,g) \equiv \{\langle z,\langle f(\text{fst}(z)),g(\text{snd}(z))\rangle \rangle .\ z\in domain(f)\times domain(g)\} \)
For given functions \(f:A\to B\) and \(g:C\to D\) the function \( \text{ProdFunction}(f,g) \) maps \(A\times C\) to \(B\times D\).
lemma prodFunction:
assumes \( f:A\rightarrow B \), \( g:C\rightarrow D \)
shows \( \text{ProdFunction}(f,g):(A\times C)\rightarrow (B\times D) \)proofFor given functions \(f:A\to B\) and \(g:C\to D\) and points \(x\in A\), \(y\in C\) the value of the function \( \text{ProdFunction}(f,g) \) on \(\langle x,y \rangle\) is \(\langle f(x),g(y) \rangle\).
lemma prodFunctionApp:
assumes \( f:A\rightarrow B \), \( g:C\rightarrow D \), \( x\in A \), \( y\in C \)
shows \( \text{ProdFunction}(f,g)\langle x,y\rangle = \langle f(x),g(y)\rangle \)proofSomewhat technical lemma about inverse image of a set by a \( \text{ProdFunction}(f,f) \).
lemma prodFunVimage:
assumes \( x\in X \), \( f:X\rightarrow Y \)
shows \( \langle x,t\rangle \in \text{ProdFunction}(f,f)^{-1}(V) \longleftrightarrow t\in X \wedge \langle fx,ft\rangle \in V \)proofWhen we have two sets \(X,Y\), function \(f:X\rightarrow Y\) and a relation \(R\) on \(Y\) we can define a relation \(r\) on \(X\) by saying that \(x\ r\ y\) if and only if \(f(x) \ R \ f(y)\). This is especially interesting when \(f\) is a bijection as all reasonable properties of \(R\) are inherited by \(r\). This section treats mostly the case when \(R\) is an order relation and \(f\) is a bijection. The standard Isabelle's Order theory defines the notion of a space of order isomorphisms between two sets relative to a relation. We expand that material proving that order isomrphisms preserve interesting properties of the relation.
We call the relation created by a relation on \(Y\) and a mapping \(f:X\rightarrow Y\) the \( \text{InducedRelation}(f,R) \).
definition
\( \text{InducedRelation}(f,R) \equiv \) \( \{p \in domain(f)\times domain(f).\ \langle f(\text{fst}(p)),f(\text{snd}(p))\rangle \in R\} \)
A reformulation of the definition of the relation induced by a function.
lemma def_of_ind_relA:
assumes \( \langle x,y\rangle \in \text{InducedRelation}(f,R) \)
shows \( \langle f(x),f(y)\rangle \in R \) using assms, InducedRelation_defA reformulation of the definition of the relation induced by a function, kind of converse of def_of_ind_relA.
lemma def_of_ind_relB:
assumes \( f:A\rightarrow B \) and \( x\in A \), \( y\in A \) and \( \langle f(x),f(y)\rangle \in R \)
shows \( \langle x,y\rangle \in \text{InducedRelation}(f,R) \) using assms, func1_1_L1, InducedRelation_defA property of order isomorphisms that is missing from standard Isabelle's Order.thy.
lemma ord_iso_apply_conv:
assumes \( f \in ord\_iso(A,r,B,R) \) and \( \langle f(x),f(y)\rangle \in R \) and \( x\in A \), \( y\in A \)
shows \( \langle x,y\rangle \in r \) using assms, ord_iso_defThe next lemma tells us where the induced relation is defined
lemma ind_rel_domain:
assumes \( R \subseteq B\times B \) and \( f:A\rightarrow B \)
shows \( \text{InducedRelation}(f,R) \subseteq A\times A \) using assms, func1_1_L1, InducedRelation_defA bijection is an order homomorphisms between a relation and the induced one.
lemma bij_is_ord_iso:
assumes A1: \( f \in \text{bij}(A,B) \)
shows \( f \in ord\_iso(A, \text{InducedRelation}(f,R),B,R) \)proofAn order isomoprhism preserves antisymmetry.
lemma ord_iso_pres_antsym:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \) and A3: \( \text{antisym}(R) \)
shows \( \text{antisym}(r) \)proofOrder isomoprhisms preserve transitivity.
lemma ord_iso_pres_trans:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \) and A3: \( \text{trans}(R) \)
shows \( \text{trans}(r) \)proofOrder isomorphisms preserve totality.
lemma ord_iso_pres_tot:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \) and A3: \( R \text{ is total on } B \)
shows \( r \text{ is total on } A \)proofOrder isomorphisms preserve linearity.
lemma ord_iso_pres_lin:
assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \) and \( \text{IsLinOrder}(B,R) \)
shows \( \text{IsLinOrder}(A,r) \) using assms, ord_iso_pres_antsym, ord_iso_pres_trans, ord_iso_pres_tot, IsLinOrder_defIf a relation is a linear order, then the relation induced on another set by a bijection is also a linear order.
lemma ind_rel_pres_lin:
assumes A1: \( f \in \text{bij}(A,B) \) and A2: \( \text{IsLinOrder}(B,R) \)
shows \( \text{IsLinOrder}(A, \text{InducedRelation}(f,R)) \)proofThe image by an order isomorphism of a bounded above and nonempty set is bounded above.
lemma ord_iso_pres_bound_above:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \) and A3: \( \text{IsBoundedAbove}(C,r) \), \( C\neq 0 \)
shows \( \text{IsBoundedAbove}(f(C),R) \), \( f(C) \neq 0 \)proofOrder isomorphisms preserve the property of having a minimum.
lemma ord_iso_pres_has_min:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \) and A3: \( C\subseteq A \) and A4: \( \text{HasAminimum}(R,f(C)) \)
shows \( \text{HasAminimum}(r,C) \)proofOrder isomorhisms preserve the images of relations. In other words taking the image of a point by a relation commutes with the function.
lemma ord_iso_pres_rel_image:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \), \( R \subseteq B\times B \) and A3: \( a\in A \)
shows \( f(r\{a\}) = R\{f(a)\} \)proofOrder isomorphisms preserve collections of upper bounds.
lemma ord_iso_pres_up_bounds:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \), \( R \subseteq B\times B \) and A3: \( C\subseteq A \)
shows \( \{f(r\{a\}).\ a\in C\} = \{R\{b\}.\ b \in f(C)\} \)proofThe image of the set of upper bounds is the set of upper bounds of the image.
lemma ord_iso_pres_min_up_bounds:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \), \( R \subseteq B\times B \) and A3: \( C\subseteq A \) and A4: \( C\neq 0 \)
shows \( f(\bigcap a\in C.\ r\{a\}) = (\bigcap b\in f(C).\ R\{b\}) \)proofOrder isomorphisms preserve completeness.
lemma ord_iso_pres_compl:
assumes A1: \( f \in ord\_iso(A,r,B,R) \) and A2: \( r \subseteq A\times A \), \( R \subseteq B\times B \) and A3: \( R \text{ is complete } \)
shows \( r \text{ is complete } \)proofIf the original relation is complete, then the induced one is complete.
lemma ind_rel_pres_compl:
assumes A1: \( f \in \text{bij}(A,B) \) and A2: \( R \subseteq B\times B \) and A3: \( R \text{ is complete } \)
shows \( \text{InducedRelation}(f,R) \text{ is complete } \)proofassumes \( f:X\rightarrow Y \) and \( A\subseteq X \)
shows \( f(A) = \{f(x).\ x \in A\} \)assumes \( \forall a\in A.\ \langle l,a\rangle \in r \)
shows \( \text{IsBoundedBelow}(A,r) \)assumes \( \forall a\in A.\ \langle a,u\rangle \in r \)
shows \( \text{IsBoundedAbove}(A,r) \)assumes \( \text{antisym}(r) \) and \( \text{HasAmaximum}(r,A) \)
shows \( \text{Maximum}(r,A) \in A \), \( \forall x\in A.\ \langle x, \text{Maximum}(r,A)\rangle \in r \)assumes \( \text{antisym}(r) \) and \( M \in A \) and \( \forall a\in A.\ \langle a,M\rangle \in r \)
shows \( \text{Maximum}(r,A) = M \)assumes \( \text{antisym}(r) \) and \( \text{antisym}(R) \) and \( f \in ord\_iso(A,r,B,R) \) and \( \text{HasAmaximum}(r,A) \)
shows \( \text{HasAmaximum}(R,B) \) and \( \text{Maximum}(R,B) = f( \text{Maximum}(r,A)) \)assumes \( f \in \text{inj}(A,B) \) and \( C \subseteq A \)
shows \( f(A\setminus C) = f(A)\setminus f(C) \)assumes \( f \in \text{surj}(A,B) \)
shows \( f(A) = B \)assumes \( f\in X\rightarrow Y \) and \( x\in X \)
shows \( f\{x\} = \{f(x)\} \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( a \in A \)
shows \( \text{restrict}(f,A-\{a\}) \in ord\_iso(A-\{a\},r,B-\{f(a)\},R) \)assumes \( f:X\rightarrow Y \) and \( a\notin X \) and \( g = f \cup \{\langle a,b\rangle \} \)
shows \( g : X\cup \{a\} \rightarrow Y\cup \{b\} \), \( \forall x\in X.\ g(x) = f(x) \), \( g(a) = b \)assumes \( f \in \text{bij}(X,Y) \), \( a\notin X \), \( b\notin Y \)
shows \( (f \cup \{\langle a,b\rangle \}) \in \text{bij}(X\cup \{a\},Y\cup \{b\}) \)assumes \( r \text{ is total on } X \)
shows \( \text{refl}(X,r) \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( M_A \notin A \), \( M_B \notin B \) and \( \forall a\in A.\ \langle a, M_A\rangle \in r \), \( \forall b\in B.\ \langle b, M_B\rangle \in R \) and \( \text{antisym}(r) \), \( \text{antisym}(R) \) and \( \langle M_A,M_A\rangle \in r \longleftrightarrow \langle M_B,M_B\rangle \in R \)
shows \( f \cup \{\langle M_A,M_B\rangle \} \in ord\_iso(A\cup \{M_A\} ,r,B\cup \{M_B\} ,R) \)assumes \( \forall x\in X.\ b(x) \in Y \)
shows \( \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y \)assumes \( f:X\rightarrow Y \), \( x\in X \) and \( f = \{\langle x,b(x)\rangle .\ x\in X\} \)
shows \( f(x) = b(x) \) and \( b(x)\in Y \)assumes \( f:A\rightarrow C \)
shows \( domain(f) = A \)assumes \( f:A\rightarrow B \), \( g:C\rightarrow D \)
shows \( \text{ProdFunction}(f,g):(A\times C)\rightarrow (B\times D) \)assumes \( f:X\rightarrow Y \)
shows \( f^{-1}(A) = \{x\in X.\ f(x) \in A\} \)assumes \( f:A\rightarrow B \), \( g:C\rightarrow D \), \( x\in A \), \( y\in C \)
shows \( \text{ProdFunction}(f,g)\langle x,y\rangle = \langle f(x),g(y)\rangle \)assumes \( \langle x,y\rangle \in \text{InducedRelation}(f,R) \)
shows \( \langle f(x),f(y)\rangle \in R \)assumes \( f:A\rightarrow B \) and \( x\in A \), \( y\in A \) and \( \langle f(x),f(y)\rangle \in R \)
shows \( \langle x,y\rangle \in \text{InducedRelation}(f,R) \)assumes \( \text{antisym}(r) \) and \( \langle a,b\rangle \in r \), \( \langle b,a\rangle \in r \)
shows \( a=b \)assumes \( \text{trans}(r) \) and \( \langle a,b\rangle \in r \wedge \langle b,c\rangle \in r \)
shows \( \langle a,c\rangle \in r \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( \langle f(x),f(y)\rangle \in R \) and \( x\in A \), \( y\in A \)
shows \( \langle x,y\rangle \in r \)assumes \( \forall x y z.\ \langle x, y\rangle \in r \wedge \langle y, z\rangle \in r \longrightarrow \langle x, z\rangle \in r \)
shows \( \text{trans}(r) \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \) and \( \text{antisym}(R) \)
shows \( \text{antisym}(r) \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \) and \( \text{trans}(R) \)
shows \( \text{trans}(r) \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \) and \( R \text{ is total on } B \)
shows \( r \text{ is total on } A \)assumes \( f \in \text{bij}(A,B) \)
shows \( f \in ord\_iso(A, \text{InducedRelation}(f,R),B,R) \)assumes \( f \in \text{bij}(X,Y) \)
shows \( domain(f) = X \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \) and \( \text{IsLinOrder}(B,R) \)
shows \( \text{IsLinOrder}(A,r) \)assumes \( r \subseteq X\times X \) and \( \text{IsBoundedAbove}(A,r) \)
shows \( A\subseteq X \)assumes \( f: X\rightarrow Y \) and \( A\subseteq X \) and \( A\neq \emptyset \)
shows \( f(A) \neq \emptyset \)assumes \( f \in \text{inj}(A,B) \) and \( C\subseteq A \) and \( y \in f(C) \)
shows \( converse(f)(y) \in C \), \( f(converse(f)(y)) = y \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \), \( R \subseteq B\times B \) and \( a\in A \)
shows \( f(r\{a\}) = R\{f(a)\} \)assumes \( f \in \text{inj}(A,B) \) and \( I\neq \emptyset \) and \( \forall i\in I.\ P(i) \subseteq A \)
shows \( f(\bigcap i\in I.\ P(i)) = ( \bigcap i\in I.\ f(P(i)) ) \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \), \( R \subseteq B\times B \) and \( C\subseteq A \)
shows \( \{f(r\{a\}).\ a\in C\} = \{R\{b\}.\ b \in f(C)\} \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \) and \( \text{IsBoundedAbove}(C,r) \), \( C\neq 0 \)
shows \( \text{IsBoundedAbove}(f(C),R) \), \( f(C) \neq 0 \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \), \( R \subseteq B\times B \) and \( C\subseteq A \) and \( C\neq 0 \)
shows \( f(\bigcap a\in C.\ r\{a\}) = (\bigcap b\in f(C).\ R\{b\}) \)assumes \( I\neq \emptyset \) and \( \forall i\in I.\ P(i) \subseteq X \)
shows \( ( \bigcap i\in I.\ P(i) ) \subseteq X \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \) and \( C\subseteq A \) and \( \text{HasAminimum}(R,f(C)) \)
shows \( \text{HasAminimum}(r,C) \)assumes \( R \subseteq B\times B \) and \( f:A\rightarrow B \)
shows \( \text{InducedRelation}(f,R) \subseteq A\times A \)assumes \( f \in ord\_iso(A,r,B,R) \) and \( r \subseteq A\times A \), \( R \subseteq B\times B \) and \( R \text{ is complete } \)
shows \( r \text{ is complete } \)