%%%%%% Positive rational numbers %%%%%% John Boyland %%%%%% Anyone may use, copy or modify this software without restriction %%%%% This file requires the "nat.elf" signature. %{% This is an "adequate" representation of the positive rationals: Every instance represents a unique positive rational number, and every positive rational number has a representation. The "obvious" representation using a pair of natural numbers does not have this property, even if one is careful to avoid zero numerators or denominators because 2/4 is the same number as 1/2. Here, adequacy is enabled through the use of a "continued fraction" representation built on top of the natural numbers. %}% %{% For uniformity, most relations here are three characters long: equ,inc,abs,rep,add,mul,grt,cmp etc. %}% %{% The rational numbers signature comes in several pieces, all of which are concatenated in rat.elf: - rat-base.elf (basic definitions, relations and operations) - rat-comp.elf (composed orders: gre, neq) - rat-inv.elf (inverse operationd: sub and div) - rat-less.elf (inverse orders: lst, lse) - rat-inv-comp.elf (theorems about sub/div and composed relations) - rat-inv-less.elf (theorems about sub/div and inverse orders) With the exception of the rat-inv-XXX.elf files, all later files depend on (require) only the rat-base.elf file. The rat-inv-XXX.elf files depend also on rat-inv.elf and rat-XXX.elf. %}% %{% The theorems in this signature mostly fall into the same groups as those of the natural signature. That list is repeated here: false-implies-XXX: one can derive XXX after a contradiction XXX-respects-eq: one can substitute equal terms in a relation XXX XXX-total: effectiveness lemma for XXX XXX-deterministic: uniqueness lemma for XXX XXX-reflexive, XXX-symmetric, XXX-transitive: properties of an equivalence XXX-anti-reflexive, XXX-anti-symmetric: properties of a partial order XXX-commutative, XXX-associative: properties of a binary operation XXX-left/right-distributes-over-YYY: distribution theorem XXX-left/right-factors-over-YYY: converse of distribution theorem XXX-left/right-preserves-ORD: If X ORD Y then we can apply Z to both sides XXX-left/right-cancels: cancellation property of binary operator XXX XXX-left/right-cancels-ORD: cancellation property w.r.t. order ORD XXX-contradiction: case where XXX can never happen XXX-implies-YYY: if XXX is true, we show YYY is true TTT-converse: converse of theorem TTT Additionally there are varieties of theorems with star appended to the name. These versions of the theorems typically require more inputs. %}% %%%%% rat-base.elf %%%%% Basic definitions, operations and theorems %%%%% This file is part of the rat.elf signature %%%% Imports %abbrev eq = nat`eq. %abbrev eq/ = nat`eq/. %abbrev eq-symmetric = nat`eq-symmetric. %abbrev eq-transitive = nat`eq-transitive. %%%% Definitions %%% Positive rationals: rat : type. whole : nat -> rat. %% q = 1 + N frac : nat -> rat -> rat. %% q = N + 1/(1 + q_1) %% We define the three basic positive rationals: %abbrev one = whole z. %abbrev two = whole (s z). %abbrev half = frac z one. equ : rat -> rat -> type. equ/ : equ Q Q. %%%% Internal definitions %{% Users of this package will never need to use "inc" (use "add one X" instead) and rarely need to use "abs" and "rep", and then only to convert the continued fraction representation to and from natural pairs. %}% inc : rat -> rat -> type. inc/whole : inc (whole N) (whole (s N)). inc/frac : inc (frac N R) (frac (s N) R). %{% My apologies if my use of the terms "abs" and "rep" do not conform with your expectation. In particular they are misnomers since users of this signature can access the continued fraction representation directly. Furthermore, their names seem swapped since the main operations call abs first and then rep at the end, the opposite of the normal ADT usage. On the other hand, the operations do not operate on the continued fraction representation, and instead act like users that only understand the NUM/DEN representation. %}% %% Give the numerator and denominator of a rational number. %% Both numerator and denominator will be positive (non-zero) naturals. abs : rat -> nat -> nat -> type. abs/whole : abs (whole N) (s N) (s z). %% recall that whole(N) means N+1 abs/frac : abs (frac N R) NUM DEN <- abs R X Y <- plus X Y DEN <- times N DEN Z <- plus Z Y NUM. %% Given a numerator and denominator, return the rational. rep : nat -> nat -> rat -> type. rep/= : rep (s M) (s M) one. rep/> : rep (s M) (s N) R <- minus (s M) (s N) D <- rep D (s N) R' <- inc R' R. rep/< : rep (s M) (s N) (frac z R') <- minus (s N) (s M) D <- rep D (s M) R'. %%%% Basic operations and relations %% The basic relations follow. %% Derived relations (sub, div, gre, neq, lst, lse) are defined later. grt : rat -> rat -> type. grt/ : grt Q1 Q2 <- abs Q1 M1 N1 <- abs Q2 M2 N2 <- times M1 N2 P12 <- times M2 N1 P21 <- gt P12 P21. cmp : rat -> rat -> comp -> type. cmp/= : cmp Q Q equal. cmp/< : cmp Q Q' less <- grt Q' Q. cmp/> : cmp Q Q' greater <- grt Q Q'. add : rat -> rat -> rat -> type. add/ : add Q1 Q2 Q3 <- abs Q1 M1 N1 <- abs Q2 M2 N2 <- times M1 N2 P12 <- times M2 N1 P21 <- times N1 N2 N12 <- plus P12 P21 P12+P21 <- rep P12+P21 N12 Q3. mul : rat -> rat -> rat -> type. mul/ : mul Q1 Q2 Q3 <- abs Q1 M1 N1 <- abs Q2 M2 N2 <- times M1 M2 M12 <- times N1 N2 N12 <- rep M12 N12 Q3. %%%% Theorems %%% Theorems about equ %theorem false-implies-equ: forall* {Q} {Q'} forall {F:void} exists {E:equ Q Q'} true. %worlds () (false-implies-equ _ %{=>}% Q1=Q2). %total {} (false-implies-equ _ _). %% trivial, but included for completeness %theorem equ-reflexive : forall {Q} exists {E:equ Q Q} true. - : equ-reflexive _ equ/. %worlds () (equ-reflexive Q %{=>}% Q=Q). %total {} (equ-reflexive _ _). %theorem equ-symmetric: forall* {Q} {Q'} forall {E1:equ Q Q'} exists {E2:equ Q' Q} true. - : equ-symmetric equ/ equ/. %worlds () (equ-symmetric Q=Q' %{=>}% Q'=Q). %total {} (equ-symmetric _ _). %theorem equ-transitive : forall* {Q} {Q'} {Q''} forall {E1:equ Q Q'} {E2:equ Q' Q''} exists {E3:equ Q Q''} true. - : equ-transitive equ/ equ/ equ/. %worlds () (equ-transitive Q=Q' Q'=Q'' %{=>}% Q=Q''). %total {} (equ-transitive _ _ _). %theorem whole-preserves-eq : forall* {N} {N'} forall {E1:nat`eq N N'} exists {E3:equ (whole N) (whole N')} true. - : whole-preserves-eq nat`eq/ equ/. %worlds () (whole-preserves-eq _ _). %total { } (whole-preserves-eq _ _). %theorem frac-preserves-equ : forall* {Q} {Q'} {N} {N'} forall {E1:eq N N'} {E2:equ Q Q'} exists {E3:equ (frac N Q) (frac N' Q')} true. - : frac-preserves-equ eq/ equ/ equ/. %worlds () (frac-preserves-equ _ _ _). %total {} (frac-preserves-equ _ _ _). %%% Theorems about inc %theorem inc-respects-equ: forall* {Q1} {Q2} {Q1'} {Q2'} forall {I1:inc Q1 Q2} {E1:equ Q1 Q1'} {E2:equ Q2 Q2'} exists {I2:inc Q1' Q2'} true. - : inc-respects-equ I equ/ equ/ I. %worlds () (inc-respects-equ Q1+1=Q2 Q1=Q1' Q2=Q2' %{=>}% Q1'+1=Q2'). %total {} (inc-respects-equ _ _ _ _). %theorem inc-total*: forall {R} exists {R'} {I:inc R R'} true. - : inc-total* (whole N) (whole (s N)) inc/whole. - : inc-total* (frac N R) (frac (s N) R) inc/frac. %worlds () (inc-total* R %{=>}% R' R+1=R'). %total {} (inc-total* _ _ _). %abbrev inc-total = inc-total* _ _. %theorem inc-deterministic : forall* {Q1} {Q1'} {Q2} {Q2'} forall {I1:inc Q1 Q2} {I2:inc Q1' Q2'} {E1:equ Q1 Q1'} exists {E2:equ Q2 Q2'} true. - : inc-deterministic inc/whole inc/whole equ/ equ/. - : inc-deterministic inc/frac inc/frac equ/ equ/. %worlds () (inc-deterministic Q1+1=Q2 Q1'+1=Q2' Q1=Q1' %{=>}% Q2=Q2'). %total {} (inc-deterministic _ _ _ _ ). %%% Theorems about abs %theorem abs-respects-equ : forall* {M} {N} {Q} {M'} {N'} {Q'} forall {R1:abs Q M N} {E3:equ Q Q'} {E1:eq M M'} {E2:eq N N'} exists {R2:abs Q' M' N'} true. - : abs-respects-equ R equ/ eq/ eq/ R. %worlds () (abs-respects-equ Q<-M/N Q=Q' M=M' N=N' %{=>}% Q'<-M'/N'). %total {} (abs-respects-equ _ _ _ _ _). %theorem abs-deterministic : forall* {Q} {Q'} {M} {M'} {N} {N'} forall {A:abs Q M N} {A':abs Q' M' N'} {E:equ Q Q'} exists {EM:eq M M'} {EN:eq N N'} true. - : abs-deterministic (abs/whole) (abs/whole) equ/ eq/ eq/. - : abs-deterministic (abs/frac P3 T2 P1 A) (abs/frac P3' T2' P1' A') equ/ NUM=NUM' DEN=DEN' <- abs-deterministic A A' equ/ X=X' Y=Y' <- plus-deterministic P1 P1' X=X' Y=Y' DEN=DEN' <- times-deterministic T2 T2' eq/ DEN=DEN' Z=Z' <- plus-deterministic P3 P3' Z=Z' Y=Y' NUM=NUM'. %worlds () (abs-deterministic Q->M/N Q'->M'/N' Q=Q' %{=>}% M=M' N=N'). %total A (abs-deterministic A _ _ _ _). %theorem abs-total* : forall {Q} exists {M} {N} {A:abs Q (s M) (s N)} true. - : abs-total* (whole N) N z abs/whole. - : abs-total* (frac N Q') NUM- DEN- (abs/frac P3 T2 P1 A') <- abs-total* Q' M' N' A' <- plus-total* M' (s N') DEN- P1' <- plus-left-increase P1' P1 <- times-total* N (s DEN-) Z T2 <- plus-total* Z N' NUM- P3' <- plus-right-increase P3' P3. %worlds () (abs-total* Q %{=>}% M N Q<-M/N). %total Q (abs-total* Q _ _ _). %abbrev abs-total = abs-total* _ _ _. %theorem abs-yields-positive: forall* {Q} {M} {N} forall {A:abs Q M N} exists {M'} {EM:eq M (s M')} {N'} {EN:eq N (s N')} true. - : abs-yields-positive A M' M+ N' N+ <- abs-total* Q M' N' A' <- abs-deterministic A A' equ/ M+ N+. %worlds () (abs-yields-positive Q->M/N %{=>}% M-1 M=sM-1 N-1 N=sN-1). %total {} (abs-yields-positive _ _ _ _ _). %%% Theorems about rep %theorem false-implies-rep : forall* {M} {N} {Q} forall {F:void} exists {R:rep M N Q} true. %worlds () (false-implies-rep _ %{=>}% M/N->Q). %total {} (false-implies-rep _ _). %theorem rep-respects-equ : forall* {M} {N} {Q} {M'} {N'} {Q'} forall {R1:rep M N Q} {E1:eq M M'} {E2:eq N N'} {E3:equ Q Q'} exists {R2:rep M' N' Q'} true. - : rep-respects-equ R eq/ eq/ equ/ R. %worlds () (rep-respects-equ M/N->Q M=M' N=N' Q=Q' %{=>}% M'/N'=Q'). %total {} (rep-respects-equ _ _ _ _ _). %reduces R = R' (rep-respects-equ R _ _ _ R'). %theorem rep-implies-positive : forall* {M} {N} {Q} forall {R:rep M N Q} exists {M'} {EM:eq M (s M')} {N'} {EN:eq N (s N')} true. - : rep-implies-positive rep/= _ eq/ _ eq/. - : rep-implies-positive (rep/> _ _ _) _ eq/ _ eq/. - : rep-implies-positive (rep/< _ _) _ eq/ _ eq/. %worlds () (rep-implies-positive M/N->Q %{=>}% M- M+ N- N+). %total {} (rep-implies-positive _ _ _ _ _). %theorem rep-inf-contradiction : forall* {M} {N} {Q} forall {R:rep M N Q} {E:eq N z} exists {F:void} true. %worlds () (rep-inf-contradiction M/N->Q N=0 %{=>}% _). %total {} (rep-inf-contradiction _ _ _). %theorem rep-zero-contradiction : forall* {M} {N} {Q} forall {R:rep M N Q} {E:eq M z} exists {F:void} true. %worlds () (rep-zero-contradiction M/N->Q M=0 %{=>}% _). %total {} (rep-zero-contradiction _ _ _). %theorem rep-deterministic : forall* {M} {N} {Q} {M'} {N'} {Q'} forall {R:rep M N Q} {R':rep M' N' Q'} {EM:eq M M'} {EN:eq N N'} exists {E:equ Q Q'} true. %% three normal cases - : rep-deterministic rep/= rep/= eq/ eq/ equ/. - : rep-deterministic (rep/> Q1+1=Q D/N->Q1 (plus/s D-+N=M-)) (rep/> Q1'+1=Q' D'/N->Q1' M-N=D') eq/ eq/ Q=Q' <- plus-right-cancels (plus/s D-+N=M-) M-N=D' eq/ eq/ SD-=D' <- rep-deterministic D/N->Q1 D'/N->Q1' SD-=D' eq/ Q1=Q1' <- inc-deterministic Q1+1=Q Q1'+1=Q' Q1=Q1' Q=Q'. - : rep-deterministic (rep/< D/M->Q1 (plus/s D-+M=N-)) (rep/< D'/M->Q1' (plus/s D'-+M=N-)) eq/ eq/ Q=Q' <- plus-right-cancels (plus/s D-+M=N-) (plus/s D'-+M=N-) eq/ eq/ D=D' <- rep-deterministic D/M->Q1 D'/M->Q1' D=D' eq/ Q1=Q1' <- frac-preserves-equ eq/ Q1=Q1' Q=Q'. %% all remaining cases are contradiction cases - : rep-deterministic rep/= (rep/> _ D'/M->Q' M-M=D') eq/ eq/ Q=Q' <- plus-right-cancels M-M=D' plus/z eq/ eq/ D'=0 <- rep-zero-contradiction D'/M->Q' D'=0 F <- false-implies-equ F Q=Q'. - : rep-deterministic rep/= (rep/< D'/M->Q' D'+M=M) eq/ eq/ Q=Q' <- plus-right-cancels D'+M=M plus/z eq/ eq/ D'=0 <- rep-zero-contradiction D'/M->Q' D'=0 F <- false-implies-equ F Q=Q'. - : rep-deterministic (rep/> Q1+1=Q D/M->Q1 M-M=D) rep/= eq/ eq/ Q=Q' <- plus-right-cancels M-M=D plus/z eq/ eq/ D=0 <- rep-zero-contradiction D/M->Q1 D=0 F <- false-implies-equ F Q=Q'. - : rep-deterministic (rep/> _ _ D+N=M) (rep/< D'/M->Q1 D'+M=N) eq/ eq/ Q=Q' <- plus-associative-converse D+N=M D'+M=N D'D D'+D=D'D D'D+N=N <- plus-right-cancels D'D+N=N plus/z eq/ eq/ D'D=0 <- plus-is-zero-implies-zero D'+D=D'D D'D=0 D'=0 _ <- rep-zero-contradiction D'/M->Q1 D'=0 F <- false-implies-equ F Q=Q'. - : rep-deterministic (rep/< D/M->Q1 D+M=M) rep/= eq/ eq/ Q=Q' <- plus-right-cancels D+M=M plus/z eq/ eq/ D=0 <- rep-zero-contradiction D/M->Q1 D=0 F <- false-implies-equ F Q=Q'. - : rep-deterministic (rep/< _ D+M=N) (rep/> _ D'/M->Q1' D'+N=M) eq/ eq/ Q=Q' <- plus-associative-converse D+M=N D'+N=M D'D D'+D=D'D D'D+M=M <- plus-right-cancels D'D+M=M (plus/z) eq/ eq/ D'D=0 <- plus-is-zero-implies-zero D'+D=D'D D'D=0 D'=0 _ <- rep-zero-contradiction D'/M->Q1' D'=0 F <- false-implies-equ F Q=Q'. %worlds () (rep-deterministic M/N->Q M'/N'->Q' M=M' N=N' %{=>}% Q=Q'). %total R (rep-deterministic R _ _ _ _). %theorem rep-total**: forall {M} {N} {CMP} {C:compare (s M) (s N) CMP} exists {Q} {R:rep (s M) (s N) Q} true. - : rep-total** M M' equal C one R <- equal-implies-eq C M=M' <- rep-respects-equ rep/= eq/ M=M' equ/ R. - : rep-total** M N greater C Q (rep/> I R' P) <- greater-implies-gt C G <- gt-implies-plus G D (P:plus (s D) (s N) (s M)) <- plus-commutative P Pc <- plus-implies-gt Pc eq/ (G':gt (s M) (s D)) <- succ-preserves-gt-converse G' G'' <- meta-gt M D G'' <- compare-total* (s D) (s N) CMP' C' <- rep-total** D N CMP' C' Q' R' <- inc-total* Q' Q I. - : rep-total** M N less C (frac z Q') (rep/< R' P) <- less-implies-lt C G <- gt-implies-plus G D (P:plus (s D) (s M) (s N)) <- plus-implies-gt P eq/ (G':gt (s N) (s M)) <- succ-preserves-gt-converse G' G'' <- meta-gt N M G'' <- compare-total* (s D) (s M) CMP' C' <- rep-total** D M CMP' C' Q' R'. %worlds () (rep-total** M N M<=>N R<=> %{=>}% Q M+1/N+1=Q). %total {N M} (rep-total** M N _ _ _ _). %theorem rep-total* : forall {M} {N} exists {Q} {R:rep (s M) (s N) Q} true. - : rep-total* M N Q M+1/N+1->Q <- compare-total* (s M) (s N) CMP M<=>N <- rep-total** M N CMP M<=>N Q M+1/N+1->Q. %worlds () (rep-total* M N Q M+1/N+1->Q). %total {} (rep-total* _ _ _ _). %abbrev rep-total = rep-total** _ _ _. %theorem rep-times-right : forall* {M} {N} {Q} {X} {X'} {MX} {NX} forall {RX:rep M N Q} {E:eq X (s X')} {TM:times M X MX} {TN:times N X NX} exists {R:rep MX NX Q} true. - : rep-times-right rep/= eq/ M*X=MX M*X=NX MX/NX->1 <- times-preserves-positive M X MX- M*X=sMX- <- times-deterministic M*X=sMX- M*X=MX eq/ eq/ SMX-=MX <- times-deterministic M*X=sMX- M*X=NX eq/ eq/ SMX-=NX <- rep-respects-equ rep/= SMX-=MX SMX-=NX equ/ MX/NX->1. - : rep-times-right (rep/> Q1+1=Q D/N->Q1 D+N=M) eq/ M*X=MX N*X=NX MX/NX->Q <- times-preserves-positive M X MX- M*X=sMX- <- times-preserves-positive N X NX- N*X=sNX- <- times-deterministic M*X=sMX- M*X=MX eq/ eq/ SMX-=MX <- times-deterministic N*X=sNX- N*X=NX eq/ eq/ SNX-=NX <- times-total D*X=DX <- times-right-distributes-over-plus* D+N=M M*X=sMX- D*X=DX N*X=sNX- DX+sNX-=sMX- <- rep-times-right D/N->Q1 eq/ D*X=DX N*X=sNX- DX/sNX-->Q1 <- rep-respects-equ (rep/> Q1+1=Q DX/sNX-->Q1 DX+sNX-=sMX-) SMX-=MX SNX-=NX equ/ MX/NX->Q. - : rep-times-right (rep/< D/M->Q1 D+M=N) eq/ M*X=MX N*X=NX MX/NX->Q <- times-preserves-positive M X MX- M*X=sMX- <- times-preserves-positive N X NX- N*X=sNX- <- times-deterministic M*X=sMX- M*X=MX eq/ eq/ SMX-=MX <- times-deterministic N*X=sNX- N*X=NX eq/ eq/ SNX-=NX <- times-total D*X=DX <- times-right-distributes-over-plus* D+M=N N*X=sNX- D*X=DX M*X=sMX- DX+sMX-=sNX- <- rep-times-right D/M->Q1 eq/ D*X=DX M*X=sMX- DX/sMX-->Q1 <- rep-respects-equ (rep/< DX/sMX-->Q1 DX+sMX-=sNX-) SMX-=MX SNX-=NX equ/ MX/NX->Q. %worlds () (rep-times-right M/N->Q X+ M*X=MX N*X=NX %{=>}% MX/NX->Q). %total R (rep-times-right R _ _ _ _). %theorem rep-times-left : forall* {M} {N} {Q} {X} {X'} {XM} {XN} forall {RX:rep M N Q} {E:eq X (s X')} {TM:times X M XM} {TN:times X N XN} exists {RX:rep XM XN Q} true. - : rep-times-left M/N->Q X+ X*M=XM X*N=XN XM/XN->Q <- times-commutative X*M=XM M*X=XM <- times-commutative X*N=XN N*X=XN <- rep-times-right M/N->Q X+ M*X=XM N*X=XN XM/XN->Q. %worlds () (rep-times-left M/N->Q X+ X*M=XM X*N=XN %{=>}% XM/XN->Q). %total {} (rep-times-left _ _ _ _ _). %theorem rep-right-cancels : forall* {M} {N} {Q} {X} {MX} {NX} forall {RX:rep MX NX Q} {TM:times M X MX} {TN:times N X NX} exists {R:rep M N Q} true. - : rep-right-cancels rep/= M*X=MX N*X=MX M/N->Q <- times-right-cancels** M*X=MX N*X=MX eq/ eq/ M=N <- rep-respects-equ rep/= eq/ M=N equ/ M/N->Q. - : rep-right-cancels (rep/> Q1+1=Q DX/NX->Q1 DX+NX=MX) M*X=MX N*X=NX (rep/> Q1+1=Q D/N->Q1 D+N=M) <- times-right-factors-over-minus M*X=MX N*X=NX DX+NX=MX eq/ D D+N=M D*X=DX <- rep-right-cancels DX/NX->Q1 D*X=DX N*X=NX D/N->Q1. - : rep-right-cancels (rep/< DX/MX->Q1 DX+MX=NX) M*X=MX N*X=NX (rep/< D/M->Q1 D+M=N) <- times-right-factors-over-minus N*X=NX M*X=MX DX+MX=NX eq/ D D+M=N D*X=DX <- rep-right-cancels DX/MX->Q1 D*X=DX M*X=MX D/M->Q1. %% contradiction case - : rep-right-cancels (R:rep (s _) (s _) _) M*0=sY _ R' <- times-right-zero _ M*0=0 <- times-deterministic M*0=0 M*0=sY eq/ eq/ ZERO=sY <- succ-implies-gt ZERO=sY ZERO>Y <- gt-contradiction ZERO>Y F <- false-implies-rep F R'. %worlds () (rep-right-cancels MX/NX->Q M*X=MX N*X=NX %{=>}% M/N->Q). %total R (rep-right-cancels R _ _ _). %theorem rep-left-cancels : forall* {M} {N} {Q} {X} {XM} {XN} forall {RX:rep XM XN Q} {TM:times X M XM} {TN:times X N XN} exists {R:rep M N Q} true. - : rep-left-cancels XM/XN->Q X*M=XM X*N=XN M/N->Q <- times-commutative X*M=XM M*X=XM <- times-commutative X*N=XN N*X=XN <- rep-right-cancels XM/XN->Q M*X=XM N*X=XN M/N->Q. %worlds () (rep-left-cancels XM/XN->Q X*M=XM X*N=XN %{=>}% M/N->Q). %total {} (rep-left-cancels _ _ _ _). %%% Lemmas for proving that abs and rep are inverses: %theorem rep-whole : forall {N} exists {R:rep (s N) (s z) (whole N)} true. - : rep-whole z rep/=. - : rep-whole (s N) (rep/> (inc/whole:inc (whole N) (whole (s N))) R SN+1=ssN) <- plus-commutative (plus/s (plus/z:plus z (s N) (s N))) SN+1=ssN <- rep-whole N (R:rep (s N) (s z) (whole N)). %worlds () (rep-whole _ _). %total N (rep-whole N _). %theorem rep-frac : forall* {X} {Y} {Z} {DEN} {NUM} forall {N} {Q} {R1:rep X Y Q} {P1:plus X Y DEN} {T2:times N DEN Z} {P3:plus Z Y NUM} exists {R2:rep NUM DEN (frac N Q)} true. - : rep-frac z Q R1 P1 (times/z) (plus/z) (rep/< R1 P1). - : rep-frac (s N) Q R1 P1 (times/s N*DEN=T T+DEN=Z) Z+Y=NUM (rep/> (inc/frac:inc (frac N Q) (frac (s N) Q)) R- P-) <- plus-commutative T+DEN=Z DEN+T=Z <- plus-associative DEN+T=Z Z+Y=NUM NUM- T+Y=NUM- DEN+NUM-=NUM <- plus-commutative DEN+NUM-=NUM P- <- rep-frac N Q R1 P1 N*DEN=T T+Y=NUM- R-. %worlds () (rep-frac _ _ _ _ _ _ _). %total N (rep-frac N _ _ _ _ _ _). %theorem rep-inverse-of-abs : forall* {Q} {M} {N} forall {A:abs Q M N} exists {R:rep M N Q} true. - : rep-inverse-of-abs (abs/whole: abs (whole N) (s N) (s z)) R <- rep-whole N R. - : rep-inverse-of-abs (abs/frac P3 T2 P1 A') R <- rep-inverse-of-abs A' R' <- rep-frac _ _ R' P1 T2 P3 R. %worlds () (rep-inverse-of-abs Q->M/N %{=>}% M/N->Q). %total A (rep-inverse-of-abs A _). %% converse of this theorem is false because (rep 2 4 1/2) but (abs 1/2 1 2) %theorem abs-inverse-of-rep-mult* : forall* {Q} {M} {N} {MX} {NX} forall {R:rep MX NX Q} {A:abs Q M N} exists {X} {TM:times M (s X) MX} {TN:times N (s X) NX} true. - : abs-inverse-of-rep-mult* rep/= abs/whole X- ONE*X=X ONE*X=X <- times-left-identity (s X-) ONE*X=X. - : abs-inverse-of-rep-mult* (rep/> inc/whole DX/NX->wM- DX+NX=SMX) (abs/whole:abs (whole (s M-)) (s (s M-)) (s z)) X- SM*X=SMX ONE*X=NX <- abs-inverse-of-rep-mult* DX/NX->wM- (abs/whole:abs (whole M-) (s M-) (s z)) X- M*X=DX ONE*X=NX <- times-left-identity (s X-) ONE*X=X <- times-deterministic ONE*X=NX ONE*X=X eq/ eq/ NX=X <- plus-respects-eq DX+NX=SMX eq/ NX=X eq/ DX+X=SMX <- times-left-increase M*X=DX DX+X=SMX SM*X=SMX. - : abs-inverse-of-rep-mult* (rep/> inc/frac DV/NV->FF1Q1 DV+NV=MV) (abs/frac Z+Y=M F*N=Z X+Y=N Q1->X/Y) V- M*V=MV N*V=NV <- times-left-decrease F*N=Z T F1*N=T T+N=Z <- plus-total T+Y=M1 <- abs-inverse-of-rep-mult* DV/NV->FF1Q1 (abs/frac T+Y=M1 F1*N=T X+Y=N Q1->X/Y) V- M1*V=DV N*V=NV <- times-right-distributes-over-plus T+Y=M1 M1*V=DV TV YV T*V=TV Y*V=YV TV+YV=DV <- plus-commutative TV+YV=DV YV+TV=DV <- plus-associative YV+TV=DV DV+NV=MV ZV TV+NV=ZV YV+ZV=MV <- times-right-factors-over-plus* T*V=TV N*V=NV TV+NV=ZV T+N=Z Z*V=ZV <- plus-commutative YV+ZV=MV ZV+YV=MV <- times-right-factors-over-plus* Z*V=ZV Y*V=YV ZV+YV=MV Z+Y=M M*V=MV. - : abs-inverse-of-rep-mult* (rep/< DX/MX->Q1 DX+MX=NX) (abs/frac plus/z times/z D+M=N Q1->D/M) X- M*X=MX N*X=NX <- abs-inverse-of-rep-mult* DX/MX->Q1 Q1->D/M X- D*X=DX M*X=MX <- times-right-factors-over-plus* D*X=DX M*X=MX DX+MX=NX D+M=N N*X=NX. %worlds () (abs-inverse-of-rep-mult* MX/NX->Q Q->M/N %{=>}% X- M*X=MX N*X=NX). %total R (abs-inverse-of-rep-mult* R _ _ _ _). %theorem abs-inverse-of-rep-mult : forall* {Q} {M} {N} {MX} {NX} forall {R:rep MX NX Q} {A:abs Q M N} exists {X} {TM:times M X MX} {TN:times N X NX} true. - : abs-inverse-of-rep-mult MX/NX->Q Q->M/N (s X-) M*X=MX N*X=NX <- abs-inverse-of-rep-mult* MX/NX->Q Q->M/N X- M*X=MX N*X=NX. %worlds () (abs-inverse-of-rep-mult MX/NX->Q Q->M/N %{=>}% X M*X=MX N*X=NX). %total R (abs-inverse-of-rep-mult R _ _ _ _). %theorem reps-comparable : forall* {Q} {M} {N} {Q'} {M'} {N'} forall {R:rep M N Q} {R':rep M' N' Q'} {E:equ Q Q'} exists {X} {T:times M N' X} {T':times M' N X} true. - : reps-comparable M/N->Q M'/N'->Q equ/ X'' M*N'=X'' M'*N=X'' <- abs-total Q->M''/N'' <- abs-inverse-of-rep-mult M/N->Q Q->M''/N'' X M''*X=M N''*X=N <- abs-inverse-of-rep-mult M'/N'->Q Q->M''/N'' X' M''*X'=M' N''*X'=N' <- times-total M*N'=X'' <- times-total M''*N''=Y <- times-total X*X'=Z <- times-double-associative* M''*X=M N''*X'=N' M*N'=X'' M''*N''=Y X*X'=Z Y*Z=X'' <- times-commutative M''*N''=Y N''*M''=Y <- times-double-associative* N''*M''=Y X*X'=Z Y*Z=X'' N''*X=N M''*X'=M' N*M'=X'' <- times-commutative N*M'=X'' M'*N=X''. %worlds () (reps-comparable M/N->Q M'/N'->Q' Q=Q' %{=>}% X M*N'=X M'*N=X). %total {} (reps-comparable _ _ _ _ _ _). %%% Theorems about grt %theorem false-implies-grt : forall* {Q1} {Q2} forall {F:void} exists {G:grt Q1 Q2} true. %worlds () (false-implies-grt _ %{=>}% Q1>Q2). %total {} (false-implies-grt _ _). %theorem grt-respects-equ : forall* {Q1} {Q2} {Q1'} {Q2'} forall {G:grt Q1 Q2} {E1:equ Q1 Q1'} {E2:equ Q2 Q2'} exists {G':grt Q1' Q2'} true. - : grt-respects-equ Q1>Q2 equ/ equ/ Q1>Q2. %worlds () (grt-respects-equ Q1>Q2 Q1=Q1' Q2=Q2' %{=>}% Q1'>Q2'). %total {} (grt-respects-equ _ _ _ _). %theorem grt-anti-reflexive : forall* {Q} forall {G:grt Q Q} exists {F:void} true. - : grt-anti-reflexive (grt/ P11'>P1'1 T1'1 T11' A1' A1) F <- abs-deterministic A1' A1 equ/ M1'=M1 N1'=N1 <- eq-symmetric N1'=N1 N1=N1' <- times-deterministic T1'1 T11' M1'=M1 N1=N1' P1'1=P11' <- gt-respects-eq P11'>P1'1 eq/ P1'1=P11' P11'>P11' <- gt-anti-reflexive P11'>P11' F. %worlds () (grt-anti-reflexive Q>Q %{=>}% _). %total {} (grt-anti-reflexive _ _). %theorem grt-transitive: forall* {Q1} {Q2} {Q3} forall {G1:grt Q1 Q2} {G2:grt Q2 Q3} exists {G3:grt Q1 Q3} true. - : grt-transitive (grt/ P12>P21 T21 T12 A2 A1) (grt/ P23>P32 T32' T23' A3 A2') (grt/ P13>P31 T31 T13 A3 A1) <- abs-deterministic A2' A2 equ/ M2'=M2 N2'=N2 <- times-respects-eq T23' M2'=M2 eq/ eq/ T23 <- times-respects-eq T32' eq/ N2'=N2 eq/ T32 <- times-total (TL:times P12 P23 P1223) <- times-total (TR:times P32 P21 P3221) <- times-commutative TR TRc <- times-preserves-gt P12>P21 P23>P32 TL TRc P1223>P3221 <- times-total T13 <- times-total T31 <- times-total (T22c:times N2 M2 P22) <- times-commutative T23 T23c <- times-double-associative* T12 T23c TL T13 T22c P13*P22=P1223 <- times-commutative T21 T21c <- times-double-associative* T32 T21c TR T31 T22c P31*P22=P3221 <- times-right-cancels-gt P13*P22=P1223 P31*P22=P3221 eq/ P1223>P3221 P13>P31. %worlds () (grt-transitive Q1>Q2 Q2>Q3 %{=>}% Q1>Q3). %total {} (grt-transitive _ _ _). %theorem grt-anti-symmetric : forall* {Q1} {Q2} forall {G1:grt Q1 Q2} {G2:grt Q2 Q1} exists {F:void} true. - : grt-anti-symmetric Q1>Q2 Q2>Q1 F <- grt-transitive Q1>Q2 Q2>Q1 Q1>Q1 <- grt-anti-reflexive Q1>Q1 F. %worlds () (grt-anti-symmetric Q1>Q2 Q2>Q1 %{=>}% _). %total {} (grt-anti-symmetric _ _ _). %theorem grt-implies-add : forall* {Q1} {Q2} forall {G:grt Q1 Q2} exists {Q3} {A:add Q3 Q2 Q1} true. - : {TN12:times N1 N2 N12} {R12:rep (s M12-) (s N12-) Q3} {N3*X3=N12: times (s N3-) X3 N12} grt-implies-add (grt/ P12>P21 T21 T12 A2 A1) Q3 (add/ R1' PM32 TN32 T23 T32 A2 A3) <- gt-implies-plus P12>P21 M12- M12+P21=P12 %% M12 equiv (s M12-) <- abs-yields-positive A1 _ M1+ _ N1+ <- abs-yields-positive A2 _ M2+ _ N2+ <- times-total* N1 N2 N12 TN12 <- times-preserves-positive* TN12 N1+ N2+ N12- N12+ <- rep-total* M12- N12- Q3 R12 <- abs-total* Q3 M3- N3- A3 %% M3 equiv (s M3-), N3 equiv (s N3-) <- abs-inverse-of-rep-mult R12 A3 X3 M3*X3=M12 N3*X3=sN12- <- eq-symmetric N12+ SN12-=N12 <- times-respects-eq N3*X3=sN12- eq/ eq/ SN12-=N12 N3*X3=N12 %% naming of "23" and "32" variables *X3 here reflects forward thinking. %% we have not shown they have this value yet. <- times-total P12*N2=M32*X3 <- times-right-distributes-over-plus M12+P21=P12 P12*N2=M32*X3 P32*X3 P23*X3 M12*N2=P32*X3 P21*N2=P23*X3 P32*X3+P23*X3=M32*X3 %% first for P32*X3: <- times-commutative M3*X3=M12 X3*M3=M12 <- times-associative X3*M3=M12 M12*N2=P32*X3 P32 T32 T32-3c <- times-commutative T32-3c (T32-3:times P32 X3 P32*X3) %% now for P23*X3: <- times-associative* T21 P21*N2=P23*X3 TN12 M2*N12=P23*X3 <- times-associative-converse N3*X3=N12 M2*N12=P23*X3 P23 T23 T23-3 %% now for M32*X3 <- times-right-factors-over-plus T32-3 T23-3 P32*X3+P23*X3=M32*X3 M32 PM32 (T-3:times M32 X3 M32*X3) %% Now we create TN32 <- times-total N12*N2=N32*X3 <- times-commutative N3*X3=N12 X3*N3=N12 <- times-associative X3*N3=N12 N12*N2=N32*X3 N32 TN32 TN32-3c <- times-commutative TN32-3c (TN32-3:times N32 X3 N32*X3) %% Now we show that M32 and N32 are connected to M1 N1: <- times-associative T12 P12*N2=M32*X3 N22 TN22 M1*N22=M32*X3 <- times-associative* TN12 N12*N2=N32*X3 TN22 N1*N22=N32*X3 %% now we convert A1 -> R1 to R1': <- rep-inverse-of-abs A1 R1 <- times-preserves-positive* TN22 N2+ N2+ _ N22+ <- rep-times-right R1 N22+ M1*N22=M32*X3 N1*N22=N32*X3 R1a <- rep-right-cancels R1a T-3 TN32-3 R1'. %worlds () (grt-implies-add Q1>Q2 %{=>}% Q3 Q3+Q2=Q1). %total {} (grt-implies-add _ _ _). %%% Theorems about cmp %theorem false-implies-cmp : forall* {Q1} {Q2} {R} forall {F:void} exists {CMP:cmp Q1 Q2 R} true. %worlds () (false-implies-cmp _ %{=>}% Q1<=>Q2). %total {} (false-implies-cmp _ _). %theorem cmp-respects-equ : forall* {Q1} {Q2} {R} {Q1'} {Q2'} forall {CMP:cmp Q1 Q2 R} {E1:equ Q1 Q1'} {E2:equ Q2 Q2'} exists {CMP:cmp Q1' Q2' R} true. - : cmp-respects-equ C equ/ equ/ C. %worlds () (cmp-respects-equ Q1<=>Q2 Q1=Q1' Q2=Q2' %{=>}% Q1'<=>Q2'). %total {} (cmp-respects-equ _ _ _ _). %theorem cmp-total** : forall* {Q1} {Q2} {M1} {N1} {M2} {N2} {P12} {P21} forall {A1:abs Q1 M1 N1} {A2:abs Q2 M2 N2} {T12:times M1 N2 P12} {T21:times M2 N1 P21} {R} {COMP:compare P12 P21 R} exists {CMP:cmp Q1 Q2 R} true. - : cmp-total** A1 A2 T12 T21 greater COMP (cmp/> (grt/ P12>P21 T21 T12 A2 A1)) <- greater-implies-gt COMP P12>P21. - : cmp-total** A1 A2 T12 T21 less COMP (cmp/< (grt/ P21>P12 T12 T21 A1 A2)) <- less-implies-lt COMP P21>P12. - : cmp-total** A1 A2 T12 T21 equal COMP CMP <- abs-yields-positive A1 _ M1+ _ N1+ <- abs-yields-positive A2 _ M2+ _ N2+ <- equal-implies-eq COMP P12=P21 <- rep-inverse-of-abs A1 R1 <- rep-inverse-of-abs A2 R2 <- times-total TM12 <- times-commutative T21 T21c <- rep-times-right R1 M2+ TM12 T21c R1*M2 <- times-respects-eq T12 eq/ eq/ P12=P21 T12' <- rep-left-cancels R1*M2 TM12 T12' R1' <- rep-deterministic R1' R2 eq/ eq/ Q1=Q2 <- cmp-respects-equ cmp/= equ/ Q1=Q2 CMP. %worlds () (cmp-total** _ _ _ _ _ _ _). %total {} (cmp-total** _ _ _ _ _ _ _). %theorem cmp-total* : forall {Q1} {Q2} exists {R} {CMP:cmp Q1 Q2 R} true. - : cmp-total* Q1 Q2 _ Q1<=>Q2 <- abs-total* Q1 M1- N1- A1 <- abs-total* Q2 M2- N2- A2 <- times-total T12 <- times-total T21 <- compare-total COMP <- cmp-total** A1 A2 T12 T21 _ COMP Q1<=>Q2. %worlds () (cmp-total* Q1 Q2 %{=>}% R Q1Q2). %total {} (cmp-total* _ _ _ _). %abbrev cmp-total = cmp-total* _ _ _. %theorem greater-implies-grt : forall* {Q1} {Q2} forall {CMP:cmp Q1 Q2 greater} exists {G:grt Q1 Q2} true. - : greater-implies-grt (cmp/> Q1>Q2) Q1>Q2. %worlds () (greater-implies-grt _ _). %total {} (greater-implies-grt _ _). %theorem less-implies-lst : forall* {Q1} {Q2} forall {CMP:cmp Q1 Q2 less} exists {G:grt Q2 Q1} true. - : less-implies-lst (cmp/< Q1}% X+Y=Z). %total {} (false-implies-add _ _). %theorem add-respects-equ : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {A:add Q1 Q2 Q3} {E1:equ Q1 Q1'} {E2:equ Q2 Q2'} {E3:equ Q3 Q3'} exists {A':add Q1' Q2' Q3'} true. - : add-respects-equ A equ/ equ/ equ/ A. %worlds () (add-respects-equ Q1+Q2=Q3 Q1=R1 Q2=R2 Q3=R3 %{=>}% R1+R2=R3). %total {} (add-respects-equ _ _ _ _ _). %theorem add-total* : forall {Q1} {Q2} exists {Q3} {A:add Q1 Q2 Q3} true. - : add-total* Q1 Q2 Q3 (add/ R7 (plus/s P6-) T5 T4 T3 A2 A1) <- abs-total* Q1 M1- N1- A1 <- abs-total* Q2 M2- N2- A2 <- times-preserves-positive M1- N2- P12- T3 <- times-preserves-positive M2- N1- P21- T4 <- times-preserves-positive N1- N2- N12- T5 <- plus-total* P12- (s P21-) P12-+P21 P6- <- rep-total* P12-+P21 N12- _ R7. %worlds () (add-total* Q1 Q2 %{=>}% Q3 Q1+Q2=Q3). %total {} (add-total* _ _ _ _). %abbrev add-total = add-total* _ _ _. %theorem add-deterministic : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {A:add Q1 Q2 Q3} {A':add Q1' Q2' Q3'} {E1:equ Q1 Q1'} {E2:equ Q2 Q2'} exists {E3:equ Q3 Q3'} true. - : add-deterministic (add/ R PM12 TN12 T21 T12 A2 A1) (add/ R' PM12' TN12' T21' T12' A2' A1') equ/ equ/ Q3=Q3' <- abs-deterministic A1 A1' equ/ M1=M1' N1=N1' <- abs-deterministic A2 A2' equ/ M2=M2' N2=N2' <- times-deterministic T12 T12' M1=M1' N2=N2' P12=P12' <- times-deterministic T21 T21' M2=M2' N1=N1' P21=P21' <- times-deterministic TN12 TN12' N1=N1' N2=N2' N12=N12' <- plus-deterministic PM12 PM12' P12=P12' P21=P21' M12=M12' <- rep-deterministic R R' M12=M12' N12=N12' Q3=Q3'. %worlds () (add-deterministic Q1+Q2=Q3 Q1'+Q2'=Q3' Q1=Q1' Q2=Q2' %{=>}% Q3=Q3'). %total {} (add-deterministic _ _ _ _ _). %theorem add-commutative : forall* {Q1} {Q2} {Q3} forall {A1:add Q1 Q2 Q3} exists {A2:add Q2 Q1 Q3} true. - : add-commutative (add/ (R:rep M3 N12 Q3) (PM12:plus P12 P21 M3) (TN12:times N1 N2 N12) (T21:times M2 N1 P21) (T12:times M1 N2 P12) (A2:abs Q2 M2 N2) (A1:abs Q1 M1 N1) ) (add/ R PM21 TN21 T12 T21 A1 A2) <- times-commutative TN12 TN21 <- plus-commutative PM12 PM21. %worlds () (add-commutative Q1+Q2=Q3 %{=>}% Q2+Q1=Q3). %total {} (add-commutative _ _). %theorem add-associative : forall* {Q1} {Q2} {Q12} {Q3} {Q123} forall {A12:add Q1 Q2 Q12} {A12-3:add Q12 Q3 Q123} exists {Q23} {A23:add Q2 Q3 Q23} {A1-23:add Q1 Q23 Q123} true. %% add Q1 + Q2 to get Q3 and then add Q3 + Q4 to get Q7. %% replace with Q2 + Q4 = Q6 and Q1+Q6=Q7. - : {PM24:plus P24 P42 M24} {TN24:times N2 N4 N24} {T-5:times X3 N34 N34*X3} {T-6:times M34 X3 M34*X3} {A3:abs Q3 M3 N3} add-associative (add/ R12 PM12 TN12 T21 T12 A2 A1) (add/ R34 PM34 TN34 T43 T34 A4 A3) Q6 (add/ R24 PM24 TN24 T42 T24 A4 A2) (add/ R16 PM16 TN16 T61 T16 A6 A1) <- abs-inverse-of-rep-mult R12 A3 X3 M3*X3=M12 N3*X3=N12 %% we start by getting the new add/ for Q2+Q4 into place: %% P34 = M3*N4 M3*X3=M12 M12=P12+P21. We need to move the X3 inside: <- times-total* X3 P34 P34*X3 T-1 <- times-commutative M3*X3=M12 X3*M3=M12 <- times-associative-converse* T34 T-1 X3*M3=M12 (T-1a:times M12 N4 P34*X3) <- times-right-distributes-over-plus PM12 T-1a P12*N4 P21*N4 T-2 T-3 (P-1:plus P12*N4 P21*N4 P34*X3) <- times-associative T12 T-2 N24 TN24 (T-2a:times M1 N24 P12*N4) <- times-commutative T21 T21c <- times-associative T21c T-3 P24 T24 (T-3a:times N1 P24 P21*N4) <- times-commutative T-3a T-3ac <- times-total* P43 X3 P43*X3 T-4 <- times-associative* T43 T-4 N3*X3=N12 (T-4a:times M4 N12 P43*X3) <- times-commutative TN12 TN21 <- times-associative-converse TN21 T-4a P42 T42 (T-4b:times P42 N1 P43*X3) <- plus-total* P21*N4 P43*X3 P24-1 P24-1f <- times-right-factors-over-plus T-3ac T-4b P24-1f M24 PM24 T24-1 <- times-total* X3 N34 N34*X3 T-5 <- times-commutative N3*X3=N12 X3*N3=N12 <- times-associative-converse* TN34 T-5 X3*N3=N12 (T-5a:times N12 N4 N34*X3) <- times-associative* TN12 T-5a TN24 (T-5b:times N1 N24 N34*X3) %% now we have to prove that PM24 and N24 are greater than zero and create Q6 <- abs-yields-positive A2 _ M2+ _ N2+ <- abs-yields-positive A4 _ M4+ _ N4+ <- times-preserves-positive* T24 M2+ N4+ _ P24+ <- plus-left-preserves-positive PM24 P24+ M24- M24+ <- times-preserves-positive* TN24 N2+ N4+ N24- N24+ <- rep-total* M24- N24- Q6 R24' <- eq-symmetric M24+ SM24-=M24 <- eq-symmetric N24+ SN24-=N24 <- rep-respects-equ R24' SM24-=M24 SN24-=N24 equ/ R24 %% now we start doing the new add/ for Q1+Q6 <- abs-total* Q6 M6- N6- A6 %% NB: "M6" and "N6" are actually (s M6-) and (s N6-) <- abs-inverse-of-rep-mult R24 A6 X6 M6*X6=M24 N6*X6=N24 <- times-associative-converse N6*X6=N24 T-2a P16 T16 P16*X6=P12*N4 <- times-commutative M6*X6=M24 X6*M6=M24 <- times-associative X6*M6=M24 T24-1 P61 T61 X6*P61=P24-1 <- times-commutative X6*P61=P24-1 P61*X6=P24-1 <- times-associative-converse N6*X6=N24 T-5b N16 TN16 N16*X6=N34*X3 <- times-commutative T-1 T-1c <- plus-total* P34*X3 P43*X3 M34*X3 P-6 <- times-right-factors-over-plus* T-1c T-4 P-6 PM34 (T-6:times M34 X3 M34*X3) <- plus-associative* P-1 P-6 P24-1f (P-6a:plus P12*N4 P24-1 M34*X3) <- times-right-factors-over-plus P16*X6=P12*N4 P61*X6=P24-1 P-6a M16 PM16 (T-7:times M16 X6 M34*X3) %% Now use rep for 34 to transfer to 16 <- rep-implies-positive R12 _ M12+ _ N12+ <- times-positive-implies-positive M3*X3=M12 M12+ _ M3+ _ X3+ <- times-commutative T-5 T-5c <- rep-times-right R34 X3+ T-6 T-5c R34*X3 <- rep-right-cancels R34*X3 T-7 N16*X6=N34*X3 R16 . %worlds () (add-associative Q1+Q2=Q12 Q12+Q3=Q123 %{=>}% Q23 Q2+Q3=Q23 Q1+Q23=Q123). %total {} (add-associative _ _ _ _ _). %theorem add-associative* : forall* {X1} {X2} {X12} {X3} {X23} {X123} forall {OP12:add X1 X2 X12} {OP12-3:add X12 X3 X123} {OP23:add X2 X3 X23} exists {OP1-23:add X1 X23 X123} true. - : add-associative* X1+X2=X3 X3+X4=X7 X2+X4=X6 X1+X6=X7 <- add-associative X1+X2=X3 X3+X4=X7 Y6 X2+X4=Y6 X1+Y6=X7 <- add-deterministic X2+X4=Y6 X2+X4=X6 equ/ equ/ Y6=X6 <- add-respects-equ X1+Y6=X7 equ/ Y6=X6 equ/ X1+X6=X7. %worlds () (add-associative* _ _ _ _). %total {} (add-associative* _ _ _ _). %theorem add-associative-converse : forall* {X1} {X2} {X4} {X6} {X7} forall {OP24:add X2 X4 X6} {OP16:add X1 X6 X7} exists {X3} {OP12:add X1 X2 X3} {OP34:add X3 X4 X7} true. - : add-associative-converse X2+X4=X6 X1+X6=X7 _ X1+X2=X3 X3+X4=X7 <- add-commutative X2+X4=X6 X4+X2=X6 <- add-commutative X1+X6=X7 X6+X1=X7 <- add-associative X4+X2=X6 X6+X1=X7 _ X2+X1=X3 X4+X3=X7 <- add-commutative X2+X1=X3 X1+X2=X3 <- add-commutative X4+X3=X7 X3+X4=X7. %worlds () (add-associative-converse X2+X4=X6 X1+X6=X7 X3 X1+X2=X3 X3+X4=X7). %total {} (add-associative-converse _ _ _ _ _). %theorem add-associative-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {OP24:add X2 X4 X6} {OP16:add X1 X6 X7} {OP12:add X1 X2 X3} exists {OP34:add X3 X4 X7} true. - : add-associative-converse* X2+X4=X6 X1+X6=X7 X1+X2=X3 X3+X4=X7 <- add-associative-converse X2+X4=X6 X1+X6=X7 X3P X1+X2=X3P X3P+X4=X7 <- add-deterministic X1+X2=X3P X1+X2=X3 equ/ equ/ X3P=X3 <- add-respects-equ X3P+X4=X7 X3P=X3 equ/ equ/ X3+X4=X7. %worlds () (add-associative-converse* X2+X4=X6 X1+X6=X7 X1+X2=X3 %{=>}% X3+X4=X7). %total {} (add-associative-converse* _ _ _ _). %% The following two theorems are useful for reordering elements %% is a left-associative sequence of operations. %theorem add-assoc-commutative* : forall* {X1} {X2} {X3} {X4} {X5} {X7} forall {OP1:add X1 X2 X3} {OP2:add X3 X4 X7} {OP3:add X1 X4 X5} exists {OP4:add X5 X2 X7} true. - : add-assoc-commutative* X1+X2=X3 X3+X4=X7 X1+X4=X5 X5+X2=X7 <- add-associative X1+X2=X3 X3+X4=X7 X6 X2+X4=X6 X1+X6=X7 <- add-commutative X2+X4=X6 X4+X2=X6 <- add-associative-converse* X4+X2=X6 X1+X6=X7 X1+X4=X5 X5+X2=X7. %worlds () (add-assoc-commutative* X1+X2=X3 X3+X4=X7 X1+X4=X5 %{=>}% X5+X2=X7). %total {} (add-assoc-commutative* _ _ _ _). %theorem add-assoc-commutative : forall* {X1} {X2} {X3} {X4} {X7} forall {OP1:add X1 X2 X3} {OP2:add X3 X4 X7} exists {X5} {OP3:add X1 X4 X5} {OP4:add X5 X2 X7} true. - : add-assoc-commutative X1+X2=X3 X3+X4=X7 X5 X1+X4=X5 X5+X2=X7 <- add-associative X1+X2=X3 X3+X4=X7 X6 X2+X4=X6 X1+X6=X7 <- add-commutative X2+X4=X6 X4+X2=X6 <- add-associative-converse X4+X2=X6 X1+X6=X7 X5 X1+X4=X5 X5+X2=X7. %worlds () (add-assoc-commutative X1+X2=X3 X3+X4=X7 %{=>}% X5 X1+X4=X5 X5+X2=X7). %total {} (add-assoc-commutative _ _ _ _ _). %% The following theorem is a useful shortcut to %% re-associate (AB)(CD) to (AC)(BD): %theorem add-double-associative* : forall* {A} {B} {C} {D} {A+B} {C+D} {A+C} {B+D} {X} forall {AB:add A B A+B} {CD:add C D C+D} {ABCD:add A+B C+D X} {AC:add A C A+C} {BD:add B D B+D} exists {ACBD:add A+C B+D X} true. - : add-double-associative* X1+X2=X3 X4+X8=XC X3+XC=XF X1+X4=X5 X2+X8=XA X5+XA=XF <- add-associative X1+X2=X3 X3+XC=XF XE X2+XC=XE X1+XE=XF <- add-commutative X4+X8=XC X8+X4=XC <- add-associative-converse* X8+X4=XC X2+XC=XE X2+X8=XA XA+X4=XE <- add-commutative XA+X4=XE X4+XA=XE <- add-associative-converse* X4+XA=XE X1+XE=XF X1+X4=X5 X5+XA=XF. %worlds () (add-double-associative* X1+X2=X3 X4+X8=XC X3+XC=XF X1+X4=X5 X2+X8=XA %{=>}% X5+XA=XF). %total {} (add-double-associative* _ _ _ _ _ _). %theorem add-double-associative : forall* {A} {B} {C} {D} {A+B} {C+D} {X} forall {AB:add A B A+B} {CD:add C D C+D} {ABCD:add A+B C+D X} exists {A+C} {B+D} {AC:add A C A+C} {BD:add B D B+D} {ACBD:add A+C B+D X} true. - : add-double-associative X1+X2=X3 X4+X8=XC X3+XC=XF X5 XA X1+X4=X5 X2+X8=XA X5+XA=XF <- add-associative X1+X2=X3 X3+XC=XF XE X2+XC=XE X1+XE=XF <- add-commutative X4+X8=XC X8+X4=XC <- add-associative-converse X8+X4=XC X2+XC=XE XA X2+X8=XA XA+X4=XE <- add-commutative XA+X4=XE X4+XA=XE <- add-associative-converse X4+XA=XE X1+XE=XF X5 X1+X4=X5 X5+XA=XF. %worlds () (add-double-associative _ _ _ _ _ _ _ _). %total { } (add-double-associative _ _ _ _ _ _ _ _). %theorem add-left-cancels : forall* {Q1} {R1} {S1} {Q2} {R2} {S2} forall {A1:add Q1 R1 S1} {A2:add Q2 R2 S2} {E:equ Q1 Q2} {ES:equ S1 S2} exists {ER:equ R1 R2} true. - : add-left-cancels (add/ R12 PM12 TN12 T21 T12 A2 A1) (add/ R12' PM12' TN12'' T21'' T12'' A2' A1') equ/ equ/ Q2=Q2' <- abs-deterministic A1' A1 equ/ M1'=M1 N1'=N1 <- times-respects-eq T12'' M1'=M1 eq/ eq/ T12' <- times-respects-eq T21'' eq/ N1'=N1 eq/ T21' <- times-respects-eq TN12'' N1'=N1 eq/ eq/ TN12' <- reps-comparable R12 R12' equ/ X M12*N12'=X M12'*N12=X <- times-right-distributes-over-plus PM12 M12*N12'=X X1a X1b P12*N12'=X1a P21*N12'=X1b X1a+X1b=X <- times-right-distributes-over-plus PM12' M12'*N12=X X2a X2b P12'*N12=X2a P21'*N12=X2b X2a+X2b=X <- times-total T11 <- times-total TN22' <- times-double-associative* T12 TN12' P12*N12'=X1a T11 TN22' P11*N22'=X1a <- times-commutative TN22' TN2'2 <- times-double-associative* T12' TN12 P12'*N12=X2a T11 TN2'2 P11*N22'=X2a <- times-deterministic P11*N22'=X2a P11*N22'=X1a eq/ eq/ X2a=X1a <- plus-left-cancels X2a+X2b=X X1a+X1b=X X2a=X1a eq/ X2b=X1b <- times-total T22' <- times-total T2'2 <- times-total TN11 <- times-commutative TN12' TN2'1 <- times-double-associative* T21 TN2'1 P21*N12'=X1b T22' TN11 P22'*N11=X1b <- times-commutative TN12 TN21 <- times-double-associative* T21' TN21 P21'*N12=X2b T2'2 TN11 P2'2*N11=X2b <- abs-yields-positive A1 _ _ _ N1+ <- times-preserves-positive* TN11 N1+ N1+ _ N11+ <- times-right-cancels* P2'2*N11=X2b P22'*N11=X1b N11+ X2b=X1b P2'2=P22' <- abs-yields-positive A2 _ M2+ _ N2+ <- times-total M2*N2=P22 <- times-commutative M2*N2=P22 N2*M2=P22 <- times-preserves-positive* M2*N2=P22 M2+ N2+ _ P22+ <- rep-inverse-of-abs A2 R2 <- rep-inverse-of-abs A2' R2' <- times-total M2'*P22=M4 <- times-total N2'*P22=N4 <- rep-times-right R2' P22+ M2'*P22=M4 N2'*P22=N4 M4/N4->Q2' <- times-commutative T22' N2'*M2=P22' <- times-associative-converse* N2*M2=P22 M2'*P22=M4 T2'2 P2'2*M2=M4 <- times-associative-converse* M2*N2=P22 N2'*P22=N4 N2'*M2=P22' P22'*N2=N4 <- times-respects-eq P2'2*M2=M4 P2'2=P22' eq/ eq/ P22'*M2=M4 <- rep-left-cancels M4/N4->Q2' P22'*M2=M4 P22'*N2=N4 M2/N2->Q2' <- rep-deterministic R2 M2/N2->Q2' eq/ eq/ Q2=Q2'. %worlds () (add-left-cancels Q1+Q2=Q3 Q1'+Q2'=Q3' Q1=Q1' Q3=Q3' %{=>}% Q2=Q2'). %total {} (add-left-cancels _ _ _ _ _). %theorem add-right-cancels : forall* {Q1} {R1} {S1} {Q2} {R2} {S2} forall {A1:add Q1 R1 S1} {A2:add Q2 R2 S2} {ER:equ R1 R2} {ES:equ S1 S2} exists {E:equ Q1 Q2} true. - : add-right-cancels Q1+Q2=Q3 Q1'+Q2'=Q3' Q2=Q2' Q3=Q3' Q1=Q1' <- add-commutative Q1+Q2=Q3 Q2+Q1=Q3 <- add-commutative Q1'+Q2'=Q3' Q2'+Q1'=Q3' <- add-left-cancels Q2+Q1=Q3 Q2'+Q1'=Q3' Q2=Q2' Q3=Q3' Q1=Q1'. %worlds () (add-right-cancels Q1+Q2=Q3 Q1'+Q2'=Q3' Q2=Q2' Q3=Q3' %{=>}% Q1=Q1'). %total {} (add-right-cancels _ _ _ _ _). %theorem add-implies-grt* : forall* {Q1} {Q2} {Q3} forall {A:add Q1 Q2 Q3} exists {G1:grt Q3 Q1} true. - : {TN12:times N1 N2 N12} {TN21:times N2 N1 N12} {A2:abs Q2 M2 N2} {A1:abs Q1 M1 N1} {P12*N1=P13*X:times P12 N1 P13*X} add-implies-grt* (add/ R12 PM12 TN12 T21 T12 A2 A1) (grt/ P31>P13 T13 T31 A1 A3) <- abs-total A3 <- abs-inverse-of-rep-mult R12 A3 X M3*X=M12 N3*X=N12 <- times-total M12*N1=P31*X <- times-commutative M3*X=M12 X*M3=M12 <- times-associative X*M3=M12 M12*N1=P31*X P31 T31 T31-Xc <- times-commutative T31-Xc (T31-X:times P31 X P31*X) <- times-total M1*N12=P13*X <- times-associative-converse N3*X=N12 M1*N12=P13*X P13 T13 (T13-X:times P13 X P13*X) <- times-commutative TN12 TN21 <- times-associative-converse* TN21 M1*N12=P13*X T12 P12*N1=P13*X <- times-total P21*N1=Y <- times-right-distributes-over-plus* PM12 M12*N1=P31*X P12*N1=P13*X P21*N1=Y P13*X+Y=P31*X <- abs-yields-positive A1 _ M1+ _ N1+ <- abs-yields-positive A2 _ M2+ _ N2+ <- times-preserves-positive* T21 M2+ N1+ _ P21+ <- times-preserves-positive* P21*N1=Y P21+ N1+ _ Y+ <- plus-commutative P13*X+Y=P31*X Y+P13*X=P31*X <- plus-implies-gt Y+P13*X=P31*X Y+ P31*X>P13*X <- times-right-cancels-gt T31-X T13-X eq/ P31*X>P13*X P31>P13. %worlds () (add-implies-grt* Q1+Q2=Q3 %{=>}% Q3>Q1). %total {} (add-implies-grt* _ _). %theorem add-implies-grt : forall* {Q1} {Q2} {Q3} forall {A:add Q1 Q2 Q3} exists {G1:grt Q3 Q1} {G2:grt Q3 Q2} true. - : add-implies-grt Q1+Q2=Q3 Q3>Q1 Q3>Q2 <- add-implies-grt* Q1+Q2=Q3 Q3>Q1 <- add-commutative Q1+Q2=Q3 Q2+Q1=Q3 <- add-implies-grt* Q2+Q1=Q3 Q3>Q2. %worlds () (add-implies-grt Q1+Q2=Q3 %{=>}% Q3>Q1 Q3>Q2). %total {} (add-implies-grt _ _ _). %theorem add-no-left-identity : forall* {Q1} {Q2} forall {A:add Q1 Q2 Q2} exists {F:void} true. - : add-no-left-identity Q1+Q2=Q2 F <- add-implies-grt Q1+Q2=Q2 _ Q2>Q2 <- grt-anti-reflexive Q2>Q2 F. %worlds () (add-no-left-identity Q1+Q2=Q2 %{=>}% _). %total {} (add-no-left-identity _ _). %theorem add-no-right-identity : forall* {Q1} {Q2} forall {A:add Q1 Q2 Q1} exists {F:void} true. - : add-no-right-identity Q1+Q2=Q1 F <- add-implies-grt* Q1+Q2=Q1 Q1>Q1 <- grt-anti-reflexive Q1>Q1 F. %worlds () (add-no-right-identity Q1+Q2=Q1 %{=>}% _). %total {} (add-no-right-identity _ _). %theorem add-left-preserves-grt* : forall* {Q1} {Q2} {Q3} {Q4} {Q5} forall {G:grt Q2 Q4} {A1:add Q1 Q2 Q3} {A2:add Q1 Q4 Q5} exists {G':grt Q3 Q5} true. - : {T24:times M2 N4 P24} {T42:times M4 N2 P42} {P24>P42: gt P24 P42} add-left-preserves-grt* (grt/ P24>P42 T42 T24 A4 A2) (add/ R12 PM12 TN12' T21' T12' A2' A1) (add/ R14 PM14 TN14'' T41'' T14'' A4' A1') (grt/ P35>P53 T53 T35 A5 A3) %% use determinism to force equality: <- abs-deterministic A1' A1 equ/ M1'=M1 N1'=N1 <- abs-deterministic A2' A2 equ/ M2'=M2 N2'=N2 <- abs-deterministic A4' A4 equ/ M4'=M4 N4'=N4 <- times-respects-eq T12' eq/ N2'=N2 eq/ T12 <- times-respects-eq T21' M2'=M2 eq/ eq/ T21 <- times-respects-eq TN12' eq/ N2'=N2 eq/ TN12 <- times-respects-eq T14'' M1'=M1 N4'=N4 eq/ T14 <- times-respects-eq T41'' M4'=M4 N1'=N1 eq/ T41 <- times-respects-eq TN14'' N1'=N1 N4'=N4 eq/ TN14 %% Now connext 1+2=3, 1+4=5 <- abs-total A3 <- abs-inverse-of-rep-mult R12 A3 X3 M3*X3=M12 N3*X3=N12 <- abs-total A5 <- abs-inverse-of-rep-mult R14 A5 X5 M5*X5=M14 N5*X5=N14 %% Create T35 <- times-total* M12 N14 P35*X35 M12*N14=P35*X35 <- times-total T35 <- times-total TX35 <- times-double-associative* M3*X3=M12 N5*X5=N14 M12*N14=P35*X35 T35 TX35 (T35-X:times P35 X35 P35*X35) <- times-right-distributes-over-plus PM12 M12*N14=P35*X35 Y1a Y1b P12*N14=Y1a P21*N14=Y1b Y1a+Y1b=P35*X35 <- times-total T11 <- times-total TN24 <- times-total TN11 <- times-double-associative* T12 TN14 P12*N14=Y1a T11 TN24 P11*N24=Y1a <- times-commutative TN14 TN41 <- times-double-associative* T21 TN41 P21*N14=Y1b T24 TN11 P24*N11=Y1b %% Create T53 <- times-total* M14 N12 P53*X35 M14*N12=P53*X35 <- times-total T53 <- times-commutative TX35 TX53 <- times-double-associative* M5*X5=M14 N3*X3=N12 M14*N12=P53*X35 T53 TX53 (T53-X:times P53 X35 P53*X35) <- times-commutative TN24 TN42 <- times-double-associative* T11 TN42 P11*N24=Y1a T14 TN12 P14*N12=Y1a <- times-total P41*N12=Y2b <- times-right-distributes-over-plus* PM14 M14*N12=P53*X35 P14*N12=Y1a P41*N12=Y2b Y1a+Y2b=P53*X35 <- times-commutative TN12 TN21 <- times-double-associative* T41 TN21 P41*N12=Y2b T42 TN11 P42*N11=Y2b %% now cancel, simplify to get the desired result <- abs-yields-positive A1 _ M1+ _ N1+ <- times-preserves-positive* TN11 N1+ N1+ _ N11+ <- times-right-preserves-gt* P24>P42 P24*N11=Y1b P42*N11=Y2b N11+ Y1b>Y2b <- plus-left-preserves-gt* Y1b>Y2b Y1a+Y1b=P35*X35 Y1a+Y2b=P53*X35 P35*X35>P53*X35 <- times-right-cancels-gt T35-X T53-X eq/ P35*X35>P53*X35 P35>P53. %worlds () (add-left-preserves-grt* Q2>Q4 Q1+Q2=Q3 Q1+Q4=Q5 %{=>}% Q3>Q5). %total {} (add-left-preserves-grt* _ _ _ _). %theorem add-left-cancels-grt : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {A:add Q1 Q2 Q3} {A':add Q1' Q2' Q3'} {E:equ Q1 Q1'} {G:grt Q3 Q3'} exists {G':grt Q2 Q2'} true. - : {TN14:times N1 N4 N14} {T11:times M1 N1 P11} {TN11:times N1 N1 N11} add-left-cancels-grt (add/ R12 PM12 TN12 T21 T12 A2 A1) (add/ R14 PM14 TN14' T41' T14' A4 A1') equ/ (grt/ P35>P53 T53 T35 A5 A3) (grt/ P24>P42 T42 T24 A4 A2) %% use determinism to force equality: <- abs-deterministic A1' A1 equ/ M1'=M1 N1'=N1 <- times-respects-eq T14' M1'=M1 eq/ eq/ T14 <- times-respects-eq T41' eq/ N1'=N1 eq/ T41 <- times-respects-eq TN14' N1'=N1 eq/ eq/ TN14 %% now connect 1+2=3, 1+4=5 <- abs-inverse-of-rep-mult* R12 A3 X3- M3*X3=M12 N3*X3=N12 <- abs-inverse-of-rep-mult* R14 A5 X5- M5*X5=M14 N5*X5=N14 %% Now create T24 <- times-total TX35 <- times-total P35*X35=X <- times-double-associative* T35 TX35 P35*X35=X M3*X3=M12 N5*X5=N14 M12*N14=X <- times-right-distributes-over-plus PM12 M12*N14=X X1 X2 P12*N14=X1 P21*N14=X2 X1+X2=X <- times-total T11 <- times-total TN24 <- times-total T24 <- times-total TN11 <- times-double-associative* T12 TN14 P12*N14=X1 T11 TN24 P11*N24=X1 <- times-commutative TN14 TN41 <- times-double-associative* T21 TN41 P21*N14=X2 T24 TN11 P24*N11=X2 %% Next T42 <- times-total P53*X35=Y <- times-commutative TX35 TX53 <- times-double-associative* T53 TX53 P53*X35=Y M5*X5=M14 N3*X3=N12 M14*N12=Y <- times-commutative TN24 TN42 <- times-double-associative* T11 TN42 P11*N24=X1 T14 TN12 P14*N12=X1 <- times-total P41*N12=Y2 <- times-right-distributes-over-plus* PM14 M14*N12=Y P14*N12=X1 P41*N12=Y2 X1+Y2=Y <- times-total T42 <- times-commutative TN12 TN21 <- times-double-associative* T41 TN21 P41*N12=Y2 T42 TN11 P42*N11=Y2 %% now prove that X35 is positive <- rep-implies-positive R12 _ M12+ _ N12+ <- rep-implies-positive R14 _ M14+ _ N14+ <- times-preserves-positive* TX35 eq/ eq/ _ X35+ %% now put the pieces together <- times-right-preserves-gt* P35>P53 P35*X35=X P53*X35=Y X35+ X>Y <- plus-left-cancels-gt X1+X2=X X1+Y2=Y eq/ X>Y X2>Y2 <- times-right-cancels-gt P24*N11=X2 P42*N11=Y2 eq/ X2>Y2 P24>P42. %worlds () (add-left-cancels-grt Q1+Q2=Q3 Q1'+Q2'=Q3' Q1=Q1' Q3>Q3' %{=>}% Q2>Q2'). %total {} (add-left-cancels-grt _ _ _ _ _). %theorem add-left-preserves-grt : forall* {X1} {X2} {X4} forall {G:grt X2 X4} exists {X3} {X5} {O1:add X1 X2 X3} {O2:add X1 X4 X5} {G2:grt X3 X5} true. - : add-left-preserves-grt X2>X4 X3 X5 X1+X2=A3 X1+X4=X5 X3>X5 <- add-total X1+X2=A3 <- add-total X1+X4=X5 <- add-left-preserves-grt* X2>X4 X1+X2=A3 X1+X4=X5 X3>X5. %worlds () (add-left-preserves-grt X2>X4 %{=>}% X3 X5 X1+X2=A3 X1+X4=X5 X3>X5). %total {} (add-left-preserves-grt _ _ _ _ _ _). %theorem add-right-preserves-grt* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:grt X1 X2} {O1:add X1 X3 X4} {O2:add X2 X3 X5} exists {G2:grt X4 X5} true. - : add-right-preserves-grt* X1>X2 X1+X3=X4 X2+X3=X5 X4>X5 <- add-commutative X1+X3=X4 X3+X1=X4 <- add-commutative X2+X3=X5 X3+X2=X5 <- add-left-preserves-grt* X1>X2 X3+X1=X4 X3+X2=X5 X4>X5. %worlds () (add-right-preserves-grt* X1>X2 X1+X3=X4 X2+X3=X5 %{=>}% X4>X5). %total {} (add-right-preserves-grt* _ _ _ _). %theorem add-right-preserves-grt : forall* {X1} {X2} {X3} forall {G1:grt X1 X2} exists {X4} {X5} {O1:add X1 X3 X4} {O2:add X2 X3 X5} {G2:grt X4 X5} true. - : add-right-preserves-grt X1>X2 X4 X5 X1+X3=X4 X2+X3=X5 X4>X5 <- add-total X1+X3=X4 <- add-total X2+X3=X5 <- add-right-preserves-grt* X1>X2 X1+X3=X4 X2+X3=X5 X4>X5. %worlds () (add-right-preserves-grt X1>X2 %{=>}% X4 X5 X1+X3=X4 X2+X3=X5 X4>X5). %total {} (add-right-preserves-grt _ _ _ _ _ _). %theorem add-preserves-grt* : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {G1:grt X1 Y1} {G2:grt X2 Y2} {MX:add X1 X2 X3} {MY:add Y1 Y2 Y3} exists {G3:grt X3 Y3} true. - : add-preserves-grt* X1>Y1 X2>Y2 X1+X2=X3 Y1+Y2=Y3 X3>Y3 <- add-total Y1+X2=X <- add-right-preserves-grt* X1>Y1 X1+X2=X3 Y1+X2=X X3>X <- add-left-preserves-grt* X2>Y2 Y1+X2=X Y1+Y2=Y3 X>Y3 <- grt-transitive X3>X X>Y3 X3>Y3. %worlds () (add-preserves-grt* X1>Y1 X2>Y2 X1+X2=X3 Y1+Y2=Y3 %{=>}% X3>Y3). %total {} (add-preserves-grt* _ _ _ _ _). %theorem add-preserves-grt : forall* {X1} {X2} {Y1} {Y2} forall {G1:grt X1 Y1} {G2:grt X2 Y2} exists {X3} {Y3} {MX:add X1 X2 X3} {MY:add Y1 Y2 Y3} {G3:grt X3 Y3} true. - : add-preserves-grt X1>Y1 X2>Y2 X3 Y3 X1+X2=X3 Y1+Y2=Y3 X3>Y3 <- add-total X1+X2=X3 <- add-total Y1+Y2=Y3 <- add-preserves-grt* X1>Y1 X2>Y2 X1+X2=X3 Y1+Y2=Y3 X3>Y3. %worlds () (add-preserves-grt X1>Y1 X2>Y2 %{=>}% X3 Y3 X1+X2=X3 Y1+Y2=Y3 X3>Y3). %total {} (add-preserves-grt _ _ _ _ _ _ _). %theorem add-right-cancels-grt : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:add X1 X2 X3} {OP2:add Y1 Y2 Y3} {E2:equ X2 Y2} {G3:grt X3 Y3} exists {G1:grt X1 Y1} true. - : add-right-cancels-grt X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3>Y3 X1>Y1 <- add-commutative X1+X2=X3 X2+X1=X3 <- add-commutative Y1+Y2=Y3 Y2+Y1=Y3 <- add-left-cancels-grt X2+X1=X3 Y2+Y1=Y3 X2=Y2 X3>Y3 X1>Y1. %worlds () (add-right-cancels-grt X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3>Y3 %{=>}% X1>Y1). %total {} (add-right-cancels-grt _ _ _ _ _). %%% Theorems about mul %theorem false-implies-mul: forall* {X} {Y} {Z} forall {F:void} exists {M:mul X Y Z} true. %worlds () (false-implies-mul _ %{=>}% Q1*Q2=Q3). %total {} (false-implies-mul _ _). %theorem mul-respects-equ : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {M:mul Q1 Q2 Q3} {E1:equ Q1 Q1'} {E2:equ Q2 Q2'} {E3:equ Q3 Q3'} exists {M':mul Q1' Q2' Q3'} true. - : mul-respects-equ A equ/ equ/ equ/ A. %worlds () (mul-respects-equ Q1*Q2=Q3 Q1=Q1' Q2=Q2' Q3=Q3' %{=>}% Q1'*Q2'=Q3'). %total {} (mul-respects-equ _ _ _ _ _). %theorem mul-total* : forall {Q1} {Q2} exists {Q3} {M:mul Q1 Q2 Q3} true. - : mul-total* Q1 Q2 Q3 (mul/ R12 TN12 TM12 A2 A1) <- abs-total* Q1 M1- N1- A1 <- abs-total* Q2 M2- N2- A2 <- times-preserves-positive M1- M2- M12- TM12 <- times-preserves-positive N1- N2- N12- TN12 <- rep-total* M12- N12- _ R12. %worlds () (mul-total* Q1 Q2 %{=>}% Q3 Q1*Q2=Q3). %total {} (mul-total* _ _ _ _). %abbrev mul-total = mul-total* _ _ _. %theorem mul-deterministic : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {M:mul Q1 Q2 Q3} {M':mul Q1' Q2' Q3'} {E1:equ Q1 Q1'} {E2:equ Q2 Q2'} exists {E3:equ Q3 Q3'} true. - : mul-deterministic (mul/ R12 TN12 TM12 A2 A1) (mul/ R12' TN12' TM12' A2' A1') equ/ equ/ Q3=Q3' <- abs-deterministic A1 A1' equ/ M1=M1' N1=N1' <- abs-deterministic A2 A2' equ/ M2=M2' N2=N2' <- times-deterministic TM12 TM12' M1=M1' M2=M2' M12=M12' <- times-deterministic TN12 TN12' N1=N1' N2=N2' N12=N12' <- rep-deterministic R12 R12' M12=M12' N12=N12' Q3=Q3'. %worlds () (mul-deterministic Q1*Q2=Q3 Q1'*Q2'=Q3' Q1=Q1' Q2=Q2' %{=>}% Q3=Q3'). %total {} (mul-deterministic _ _ _ _ _). %theorem mul-commutative : forall* {Q1} {Q2} {Q3} forall {M1:mul Q1 Q2 Q3} exists {M2:mul Q2 Q1 Q3} true. - : mul-commutative (mul/ R TN12 TM12 A2 A1) (mul/ R TN21 TM21 A1 A2) <- times-commutative TM12 TM21 <- times-commutative TN12 TN21. %worlds () (mul-commutative Q1*Q2=Q3 %{=>}% Q2*Q1=Q3). %total {} (mul-commutative _ _). %theorem mul-left-identity : forall {Q} exists {M:mul one Q Q} true. - : mul-left-identity Q (mul/ R12 TN12 TM12 A2 (abs/whole)) <- abs-total A2 <- times-left-identity _ TM12 <- times-left-identity _ TN12 <- rep-inverse-of-abs A2 R12. %worlds () (mul-left-identity Q %{=>}% ONE*Q=Q). %total {} (mul-left-identity _ _). %theorem mul-right-identity : forall {Q} exists {M:mul Q one Q} true. - : mul-right-identity Q Q*1=Q <- mul-left-identity Q ONE*Q=Q <- mul-commutative ONE*Q=Q Q*1=Q. %worlds () (mul-right-identity Q %{=>}% Q*1=Q). %total {} (mul-right-identity _ _). %theorem mul-associative : forall* {Q1} {Q2} {Q12} {Q3} {Q123} forall {M12:mul Q1 Q2 Q12} {M12-3:mul Q12 Q3 Q123} exists {Q23} {M23:mul Q2 Q3 Q23} {M1-23:mul Q1 Q23 Q123} true. - : mul-associative (mul/ R12 TN12 TM12 A2 A1) (mul/ R34 TN34 TM34 A4 A3) Q6 (mul/ R24 TN24 TM24 A4 A2) (mul/ R16 TN16 TM16 A6 A1) <- abs-yields-positive A1 _ M1+ _ N1+ <- abs-yields-positive A2 _ M2+ _ N2+ <- abs-yields-positive A4 _ M4+ _ N4+ <- abs-inverse-of-rep-mult* R12 A3 X3- M3*X3=M12 N3*X3=N12 %% <- times-total* (s X3-) M34 X3*M34 T-1 <- times-commutative M3*X3=M12 X3*M3=M12 <- times-associative-converse* TM34 T-1 X3*M3=M12 M12*M4=X3*M34 <- times-associative TM12 M12*M4=X3*M34 M24 TM24 M1*M24=X3*M34 <- times-preserves-positive* TM24 M2+ M4+ M24- M24+ %% <- times-total* (s X3-) N34 X3*N34 T-2 <- times-commutative N3*X3=N12 X3*N3=N12 <- times-associative-converse* TN34 T-2 X3*N3=N12 N12*N4=X3*N34 <- times-associative TN12 N12*N4=X3*N34 N24 TN24 N1*N24=X3*N34 <- times-preserves-positive* TN24 N2+ N4+ N24- N24+ %% <- rep-total* M24- N24- Q6 R24' <- eq-symmetric M24+ SM24-=M24 <- eq-symmetric N24+ SN24-=N24 <- rep-respects-equ R24' SM24-=M24 SN24-=N24 equ/ R24 <- abs-total* Q6 M6- N6- A6 <- abs-inverse-of-rep-mult R24 A6 X6 M6*X6=M24 N6*X6=N24 %% <- times-associative-converse M6*X6=M24 M1*M24=X3*M34 M16 TM16 M16*X6=X3*M34 <- times-associative-converse N6*X6=N24 N1*N24=X3*N34 N16 TN16 N16*X6=X3*N34 <- rep-times-left R34 eq/ T-1 T-2 RX34 <- rep-right-cancels RX34 M16*X6=X3*M34 N16*X6=X3*N34 R16. %worlds () (mul-associative Q1*Q2=Q1Q2 Q12*Q3=Q123 %{=>}% Q23 Q2*Q3=Q23 Q1*Q23=Q123). %total {} (mul-associative _ _ _ _ _). %theorem mul-associative* : forall* {X1} {X2} {X12} {X3} {X23} {X123} forall {OP12:mul X1 X2 X12} {OP12-3:mul X12 X3 X123} {OP23:mul X2 X3 X23} exists {OP1-23:mul X1 X23 X123} true. - : mul-associative* X1*X2=X3 X3*X4=X7 X2*X4=X6 X1*X6=X7 <- mul-associative X1*X2=X3 X3*X4=X7 Y6 X2*X4=Y6 X1*Y6=X7 <- mul-deterministic X2*X4=Y6 X2*X4=X6 equ/ equ/ Y6=X6 <- mul-respects-equ X1*Y6=X7 equ/ Y6=X6 equ/ X1*X6=X7. %worlds () (mul-associative* _ _ _ _). %total {} (mul-associative* _ _ _ _). %theorem mul-associative-converse : forall* {X1} {X2} {X4} {X6} {X7} forall {OP24:mul X2 X4 X6} {OP16:mul X1 X6 X7} exists {X3} {OP12:mul X1 X2 X3} {OP34:mul X3 X4 X7} true. - : mul-associative-converse X2*X4=X6 X1*X6=X7 _ X1*X2=X3 X3*X4=X7 <- mul-commutative X2*X4=X6 X4*X2=X6 <- mul-commutative X1*X6=X7 X6*X1=X7 <- mul-associative X4*X2=X6 X6*X1=X7 _ X2*X1=X3 X4*X3=X7 <- mul-commutative X2*X1=X3 X1*X2=X3 <- mul-commutative X4*X3=X7 X3*X4=X7. %worlds () (mul-associative-converse X2*X4=X6 X1*X6=X7 X3 X1*X2=X3 X3*X4=X7). %total {} (mul-associative-converse _ _ _ _ _). %theorem mul-associative-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {OP24:mul X2 X4 X6} {OP16:mul X1 X6 X7} {OP12:mul X1 X2 X3} exists {OP34:mul X3 X4 X7} true. - : mul-associative-converse* X2*X4=X6 X1*X6=X7 X1*X2=X3 X3*X4=X7 <- mul-associative-converse X2*X4=X6 X1*X6=X7 X3P X1*X2=X3P X3P*X4=X7 <- mul-deterministic X1*X2=X3P X1*X2=X3 equ/ equ/ X3P=X3 <- mul-respects-equ X3P*X4=X7 X3P=X3 equ/ equ/ X3*X4=X7. %worlds () (mul-associative-converse* X2*X4=X6 X1*X6=X7 X1*X2=X3 %{=>}% X3*X4=X7). %total {} (mul-associative-converse* _ _ _ _). %theorem mul-assoc-commutative* : forall* {X1} {X2} {X3} {X4} {X5} {X7} forall {OP1:mul X1 X2 X3} {OP2:mul X3 X4 X7} {OP3:mul X1 X4 X5} exists {OP4:mul X5 X2 X7} true. - : mul-assoc-commutative* X1*X2=X3 X3*X4=X7 X1*X4=X5 X5*X2=X7 <- mul-associative X1*X2=X3 X3*X4=X7 X6 X2*X4=X6 X1*X6=X7 <- mul-commutative X2*X4=X6 X4*X2=X6 <- mul-associative-converse* X4*X2=X6 X1*X6=X7 X1*X4=X5 X5*X2=X7. %worlds () (mul-assoc-commutative* X1*X2=X3 X3*X4=X7 X1*X4=X5 %{=>}% X5*X2=X7). %total {} (mul-assoc-commutative* _ _ _ _). %theorem mul-assoc-commutative : forall* {X1} {X2} {X3} {X4} {X7} forall {OP1:mul X1 X2 X3} {OP2:mul X3 X4 X7} exists {X5} {OP3:mul X1 X4 X5} {OP4:mul X5 X2 X7} true. - : mul-assoc-commutative X1*X2=X3 X3*X4=X7 X5 X1*X4=X5 X5*X2=X7 <- mul-associative X1*X2=X3 X3*X4=X7 X6 X2*X4=X6 X1*X6=X7 <- mul-commutative X2*X4=X6 X4*X2=X6 <- mul-associative-converse X4*X2=X6 X1*X6=X7 X5 X1*X4=X5 X5*X2=X7. %worlds () (mul-assoc-commutative X1*X2=X3 X3*X4=X7 %{=>}% X5 X1*X4=X5 X5*X2=X7). %total {} (mul-assoc-commutative _ _ _ _ _). %theorem mul-double-associative* : forall* {A} {B} {C} {D} {A+B} {C+D} {A+C} {B+D} {X} forall {AB:mul A B A+B} {CD:mul C D C+D} {ABCD:mul A+B C+D X} {AC:mul A C A+C} {BD:mul B D B+D} exists {ACBD:mul A+C B+D X} true. - : mul-double-associative* X1*X2=X3 X4*X8=XC X3*XC=XF X1*X4=X5 X2*X8=XA X5*XA=XF <- mul-associative X1*X2=X3 X3*XC=XF XE X2*XC=XE X1*XE=XF <- mul-commutative X4*X8=XC X8*X4=XC <- mul-associative-converse* X8*X4=XC X2*XC=XE X2*X8=XA XA*X4=XE <- mul-commutative XA*X4=XE X4*XA=XE <- mul-associative-converse* X4*XA=XE X1*XE=XF X1*X4=X5 X5*XA=XF. %worlds () (mul-double-associative* X1*X2=X3 X4*X8=XC X3*XC=XF X1*X4=X5 X2*X8=XA %{=>}% X5*XA=XF). %total {} (mul-double-associative* _ _ _ _ _ _). %theorem mul-double-associative : forall* {A} {B} {C} {D} {A+B} {C+D} {X} forall {AB:mul A B A+B} {CD:mul C D C+D} {ABCD:mul A+B C+D X} exists {A+C} {B+D} {AC:mul A C A+C} {BD:mul B D B+D} {ACBD:mul A+C B+D X} true. - : mul-double-associative X1*X2=X3 X4*X8=XC X3*XC=XF X5 XA X1*X4=X5 X2*X8=XA X5*XA=XF <- mul-associative X1*X2=X3 X3*XC=XF XE X2*XC=XE X1*XE=XF <- mul-commutative X4*X8=XC X8*X4=XC <- mul-associative-converse X8*X4=XC X2*XC=XE XA X2*X8=XA XA*X4=XE <- mul-commutative XA*X4=XE X4*XA=XE <- mul-associative-converse X4*XA=XE X1*XE=XF X5 X1*X4=X5 X5*XA=XF. %worlds () (mul-double-associative _ _ _ _ _ _ _ _). %total { } (mul-double-associative _ _ _ _ _ _ _ _). %theorem mul-right-distributes-over-add : forall* {Q1} {Q2} {Q3} {Q4} {Q7} forall {A12:add Q1 Q2 Q3} {M34:mul Q3 Q4 Q7} exists {Q5} {Q6} {M14:mul Q1 Q4 Q5} {M24:mul Q2 Q4 Q6} {A56:add Q5 Q6 Q7} true. - : {TN14:times N1 N4 N14} {TN24:times N2 N4 N24} mul-right-distributes-over-add (add/ R12 PM12 TN12 T21 T12 A2 A1) (mul/ R34 TN34 TM34 A4 A3) Q5 Q6 (mul/ R14 TN14 TM14 A4 A1) (mul/ R24 TN24 TM24 A4 A2) (add/ R56 PM56 TN56 T65 T56 A6 A5) %% connect R12 and A3: <- abs-inverse-of-rep-mult* R12 A3 X3- M3*X3=M12 N3*X3=N12 %% work TM34 forward to using M12 <- times-total* (s X3-) M34 XM34 T-1 <- times-commutative M3*X3=M12 X3*M3=M12 <- times-associative-converse* TM34 T-1 X3*M3=M12 M12*M4=XM34 %% work forward from TN34 <- times-total* (s X3-) N34 XN34 T-2 <- times-commutative N3*X3=N12 X3*N3=N12 <- times-associative-converse* TN34 T-2 X3*N3=N12 N12*N4=XN34 %% get Q1*Q4 and Q2*Q4: <- abs-yields-positive A1 _ M1+ _ N1+ <- abs-yields-positive A2 _ M2+ _ N2+ <- abs-yields-positive A4 _ M4+ _ N4+ <- times-total TM14 <- times-total TN14 <- times-preserves-positive* TM14 M1+ M4+ M14- M14+ <- times-preserves-positive* TN14 N1+ N4+ N14- N14+ <- rep-total* M14- N14- Q5 R14' <- eq-symmetric M14+ SM14-=M14 <- eq-symmetric N14+ SN14-=N14 <- rep-respects-equ R14' SM14-=M14 SN14-=N14 equ/ R14 <- times-total TM24 <- times-total TN24 <- times-preserves-positive* TM24 M2+ M4+ M24- M24+ <- times-preserves-positive* TN24 N2+ N4+ N24- N24+ <- rep-total* M24- N24- Q6 R24' <- eq-symmetric M24+ SM24-=M24 <- eq-symmetric N24+ SN24-=N24 <- rep-respects-equ R24' SM24-=M24 SN24-=N24 equ/ R24 %% rephrase in terms of 5 and 6: <- abs-total A5 <- abs-inverse-of-rep-mult R14 A5 X5 M5*X5=M14 N5*X5=N14 <- abs-total A6 <- abs-inverse-of-rep-mult R24 A6 X6 M6*X6=M24 N6*X6=N24 %% work T56 back to T12 <- times-total TX56 <- times-total T56 <- times-total T56-XX <- times-double-associative* T56 TX56 T56-XX M5*X5=M14 N6*X6=N24 M14*N24=P56XX <- times-total T44 <- times-double-associative* TM14 TN24 M14*N24=P56XX T12 T44 P12*P44=P56XX %% work T65 back to T21 <- times-total T65 <- times-total T65-XX <- times-commutative TX56 TX65 <- times-double-associative* T65 TX65 T65-XX M6*X6=M24 N5*X5=N14 M24*N14=P65XX <- times-double-associative* TM24 TN14 M24*N14=P65XX T21 T44 P21*P44=P65XX %% work TN56 back to TN12 <- times-total TN56 <- times-total TN56-XX <- times-total TN44 <- times-double-associative* TN56 TX56 TN56-XX N5*X5=N14 N6*X6=N24 N21*N24=N56XX <- times-double-associative* TN14 TN24 N21*N24=N56XX TN12 TN44 N12*N44=N56XX %% work PM56 back to PM12 <- plus-total (PM56:plus P56 P65 M56) <- times-total (PM56-XX:times M56 X56 M56XX) <- times-right-distributes-over-plus* PM56 PM56-XX T56-XX T65-XX (P-1:plus P56XX P65XX M56XX) <- times-right-factors-over-plus* P12*P44=P56XX P21*P44=P65XX P-1 PM12 M12*P44=M56XX %% connect with earlier facts: <- times-associative-converse* T44 M12*P44=M56XX M12*M4=XM34 XM34*N4=M56XX <- times-associative-converse* TN44 N12*N44=N56XX N12*N4=XN34 XN34*N4=N56XX <- rep-times-left R34 eq/ T-1 T-2 XR34 <- rep-times-right XR34 N4+ XM34*N4=M56XX XN34*N4=N56XX R56XX <- rep-right-cancels R56XX PM56-XX TN56-XX R56. %worlds () (mul-right-distributes-over-add Q1+Q2=Q3 Q3*Q4=Q7 %{=>}% Q5 Q6 Q1*Q4=Q5 Q2*Q4=Q6 Q5+Q6=Q7). %total {} (mul-right-distributes-over-add _ _ _ _ _ _ _). %theorem mul-right-distributes-over-add* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {A12:add X1 X2 X3} {M34:mul X3 X4 X7} {M14:mul X1 X4 X5} {M24:mul X2 X4 X6} exists {A56:add X5 X6 X7} true. - : mul-right-distributes-over-add* X1+X2=X3 X3*X4=X7 X1*X4=X5 X2*X4=X6 X5+X6=X7 <- mul-right-distributes-over-add X1+X2=X3 X3*X4=X7 Y5 Y6 X1*X4=Y5 X2*X4=Y6 Y5+Y6=X7 <- mul-deterministic X1*X4=Y5 X1*X4=X5 equ/ equ/ Y5=X5 <- mul-deterministic X2*X4=Y6 X2*X4=X6 equ/ equ/ Y6=X6 <- add-respects-equ Y5+Y6=X7 Y5=X5 Y6=X6 equ/ X5+X6=X7. %worlds () (mul-right-distributes-over-add* X1+X2=X3 X3*X4=X7 X1*X4=X5 X2*X4=X6 %{=>}% X5+X6=X7). %total {} (mul-right-distributes-over-add* _ _ _ _ _). %theorem mul-left-distributes-over-add* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {A12:add X2 X4 X6} {M34:mul X1 X6 X7} {M14:mul X1 X2 X3} {M24:mul X1 X4 X5} exists {A56:add X3 X5 X7} true. - : mul-left-distributes-over-add* X2+X4=X6 X1*X6=X7 X1*X2=X3 X1*X4=X5 X3+X5=X7 <- mul-commutative X1*X6=X7 X6*X1=X7 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative X1*X4=X5 X4*X1=X5 <- mul-right-distributes-over-add* X2+X4=X6 X6*X1=X7 X2*X1=X3 X4*X1=X5 X3+X5=X7. %worlds () (mul-left-distributes-over-add* X2+X4=X6 X1*X6=X7 X1*X2=X3 X1*X4=X5 %{=>}% X3+X5=X7). %total {} (mul-left-distributes-over-add* _ _ _ _ _). %theorem mul-left-distributes-over-add : forall* {X1} {X2} {X4} {X6} {X7} forall {A12:add X2 X4 X6} {M34:mul X1 X6 X7} exists {X3} {X5} {M14:mul X1 X2 X3} {M24:mul X1 X4 X5} {A56:add X3 X5 X7} true. - : mul-left-distributes-over-add X2+X4=X6 X1*X6=X7 X3 X5 X1*X2=X3 X1*X4=X5 X3+X5=X7 <- mul-total X1*X2=X3 <- mul-total X1*X4=X5 <- mul-left-distributes-over-add* X2+X4=X6 X1*X6=X7 X1*X2=X3 X1*X4=X5 X3+X5=X7. %worlds () (mul-left-distributes-over-add X2+X4=X6 X1*X6=X7 %{=>}% X3 X5 X1*X2=X3 X1*X4=X5 X3+X5=X7). %total {} (mul-left-distributes-over-add _ _ _ _ _ _ _). %theorem mul-right-factors-over-add : forall* {X1} {X2} {X4} {X5} {X6} {X7} forall {M14:mul X1 X4 X5} {M24:mul X2 X4 X6} {A56:add X5 X6 X7} exists {X3} {A12:add X1 X2 X3} {M34:mul X3 X4 X7} true. - : mul-right-factors-over-add X1*X4=X5 X2*X4=X6 X5+X6=X7 X3 X1+X2=X3 X3*X4=X7 <- add-total X1+X2=X3 <- mul-total X3*X4=Y7 <- mul-right-distributes-over-add* X1+X2=X3 X3*X4=Y7 X1*X4=X5 X2*X4=X6 X5+X6=Y7 <- add-deterministic X5+X6=Y7 X5+X6=X7 equ/ equ/ Y7=X7 <- mul-respects-equ X3*X4=Y7 equ/ equ/ Y7=X7 X3*X4=X7. %worlds () (mul-right-factors-over-add X1*X4=X5 X2*X4=X6 X5+X6=X7 %{=>}% X3 X1+X2=X3 X3*X4=X7 ). %total {} (mul-right-factors-over-add _ _ _ _ _ _). %theorem mul-right-factors-over-add* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {M14:mul X1 X4 X5} {M24:mul X2 X4 X6} {A56:add X5 X6 X7} {A12:add X1 X2 X3} exists {M34:mul X3 X4 X7} true. - : mul-right-factors-over-add* X1*X4=X5 X2*X4=X6 X5+X6=X7 X1+X2=X3 X3*X4=X7 <- mul-total X3*X4=Y7 <- mul-right-distributes-over-add* X1+X2=X3 X3*X4=Y7 X1*X4=X5 X2*X4=X6 X5+X6=Y7 <- add-deterministic X5+X6=Y7 X5+X6=X7 equ/ equ/ Y7=X7 <- mul-respects-equ X3*X4=Y7 equ/ equ/ Y7=X7 X3*X4=X7. %worlds () (mul-right-factors-over-add* X1*X4=X5 X2*X4=X6 X5+X6=X7 X1+X2=X3 %{=>}% X3*X4=X7 ). %total {} (mul-right-factors-over-add* _ _ _ _ _). %theorem mul-left-factors-over-add : forall* {X1} {X2} {X3} {X4} {X5} {X7} forall {M12:mul X1 X2 X3} {M14:mul X1 X4 X5} {A35:add X3 X5 X7} exists {X6} {A24:add X2 X4 X6} {M16:mul X1 X6 X7} true. - : mul-left-factors-over-add X1*X2=X3 X1*X4=X5 X3+X5=X7 X6 X2+X4=X6 X1*X6=X7 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative X1*X4=X5 X4*X1=X5 <- mul-right-factors-over-add X2*X1=X3 X4*X1=X5 X3+X5=X7 X6 X2+X4=X6 X6*X1=X7 <- mul-commutative X6*X1=X7 X1*X6=X7. %worlds () (mul-left-factors-over-add X1*X2=X3 X1*X4=X5 X3+X5=X7 %{=>}% X6 X2+X4=X6 X1*X6=X7). %total {} (mul-left-factors-over-add _ _ _ _ _ _). %theorem mul-left-factors-over-add* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {M12:mul X1 X2 X3} {M14:mul X1 X4 X5} {A35:add X3 X5 X7} {A24:add X2 X4 X6} exists {M16:mul X1 X6 X7} true. - : mul-left-factors-over-add* X1*X2=X3 X1*X4=X5 X3+X5=X7 X2+X4=X6 X1*X6=X7 <- mul-total X1*X6=Y7 <- mul-left-distributes-over-add* X2+X4=X6 X1*X6=Y7 X1*X2=X3 X1*X4=X5 X3+X5=Y7 <- add-deterministic X3+X5=Y7 X3+X5=X7 equ/ equ/ Y7=X7 <- mul-respects-equ X1*X6=Y7 equ/ equ/ Y7=X7 X1*X6=X7. %worlds () (mul-left-factors-over-add* X1*X2=X3 X1*X4=X5 X3+X5=X7 X2+X4=X6 %{=>}% X1*X6=X7). %total {} (mul-left-factors-over-add* _ _ _ _ _). %theorem mul-left-cancels : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {M:mul Q1 Q2 Q3} {M':mul Q1' Q2' Q3'} {E1:equ Q1 Q1'} {E3: equ Q3 Q3'} exists {E2:equ Q2 Q2'} true. - : {A1:abs Q1 M1 N1} {A2:abs Q2 M2 N2} {TM12:times M1 M2 M12} {T24:times M2 N4 P24} {T42:times M4 N2 P42} {A4:abs Q4 M4 N4} {TM24:times M2 M4 M24} {TM42:times M4 M2 M24} {R2':rep M2 N2 Q4} {T11:times M1 N1 P11} mul-left-cancels (mul/ R12 TN12 TM12 A2 A1) (mul/ R14 TN14' TM14' A4 A1') equ/ equ/ Q2=Q4 <- abs-deterministic A1' A1 equ/ M1'=M1 N1'=N1 <- times-respects-eq TM14' M1'=M1 eq/ eq/ TM14 <- times-respects-eq TN14' N1'=N1 eq/ eq/ TN14 <- reps-comparable R12 R14 equ/ X M12*N14=X M14*N12=X <- times-total T11 <- times-total T24 <- times-double-associative* TM12 TN14 M12*N14=X T11 T24 P11*P24=X <- times-total T42 <- times-double-associative* TM14 TN12 M14*N12=X T11 T42 P11*P42=X <- abs-yields-positive A1 M1- M1+ N1- N1+ <- times-preserves-positive* T11 M1+ N1+ _ P11+ <- times-left-cancels* P11*P24=X P11*P42=X P11+ eq/ P24=P42 <- rep-inverse-of-abs A4 R4 <- abs-yields-positive A2 M2- M2+ N2- N2+ <- times-total TM24 <- rep-times-left R4 M2+ TM24 T24 M2*R4 <- rep-respects-equ M2*R4 eq/ P24=P42 equ/ R4' <- times-commutative TM24 TM42 <- rep-left-cancels R4' TM42 T42 R2' <- rep-inverse-of-abs A2 R2 <- rep-deterministic R2 R2' eq/ eq/ Q2=Q4. %worlds () (mul-left-cancels Q1*Q2=Q3 Q1'*Q2'=Q3' Q1=Q1' Q3=Q3' %{=>}% Q2=Q2'). %total {} (mul-left-cancels _ _ _ _ _). %theorem mul-right-cancels : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {M:mul Q1 Q2 Q3} {M':mul Q1' Q2' Q3'} {E1:equ Q2 Q2'} {E3: equ Q3 Q3'} exists {E2:equ Q1 Q1'} true. - : mul-right-cancels Q1*Q2=Q3 Q1'*Q2'=Q3' Q2=Q2' Q3=Q3' Q1=Q1' <- mul-commutative Q1*Q2=Q3 Q2*Q1=Q3 <- mul-commutative Q1'*Q2'=Q3' Q2'*Q1'=Q3' <- mul-left-cancels Q2*Q1=Q3 Q2'*Q1'=Q3' Q2=Q2' Q3=Q3' Q1=Q1'. %worlds () (mul-right-cancels Q1*Q2=Q3 Q1'*Q2'=Q3' Q2=Q2' Q3=Q3' %{=>}% Q1=Q1'). %total {} (mul-right-cancels _ _ _ _ _). %theorem mul-left-preserves-grt* : forall* {Q1} {Q2} {Q3} {Q4} {Q5} forall {G:grt Q2 Q4} {A1:mul Q1 Q2 Q3} {A2:mul Q1 Q4 Q5} exists {G':grt Q3 Q5} true. - : mul-left-preserves-grt* (grt/ P24>P42 T42 T24 A4 A2) (mul/ R12 TN12' TM12' A2' A1) (mul/ R14 TN14' TM14' A4' A1') (grt/ P35>P53 T53 T35 A5 A3) %% use determinism to force equality: <- abs-deterministic A1' A1 equ/ M1'=M1 N1'=N1 <- abs-deterministic A2' A2 equ/ M2'=M2 N2'=N2 <- abs-deterministic A4' A4 equ/ M4'=M4 N4'=N4 <- times-respects-eq TM12' eq/ M2'=M2 eq/ TM12 <- times-respects-eq TN12' eq/ N2'=N2 eq/ TN12 <- times-respects-eq TM14' M1'=M1 M4'=M4 eq/ TM14 <- times-respects-eq TN14' N1'=N1 N4'=N4 eq/ TN14 %% Now connext 1*2=3, 1*4=5 <- abs-total A3 <- abs-inverse-of-rep-mult* R12 A3 X3- M3*X3=M12 N3*X3=N12 <- abs-total A5 <- abs-inverse-of-rep-mult* R14 A5 X5- M5*X5=M14 N5*X5=N14 %% Create T35 <- times-total* M12 N14 P35*X35 T1214 <- times-total T35 <- times-preserves-positive X3- X5- X35- TX35 <- times-double-associative* M3*X3=M12 N5*X5=N14 T1214 T35 TX35 (T35-X:times P35 (s X35-) P35*X35) <- times-total T11 <- times-double-associative* TM12 TN14 T1214 T11 T24 P11*P24=P35*X35 %% Create T53 <- times-total* M14 N12 P53*X35 T1412 <- times-total T53 <- times-commutative TX35 TX53 <- times-double-associative* M5*X5=M14 N3*X3=N12 T1412 T53 TX53 (T53-X:times P53 (s X35-) P53*X35) <- times-double-associative* TM14 TN12 T1412 T11 T42 P11*P42=P53*X35 %% connect and preserve gt <- abs-yields-positive A1 M1- M1+ N1- N1+ <- times-preserves-positive* T11 M1+ N1+ _ P11+ <- times-left-preserves-gt* P24>P42 P11*P24=P35*X35 P11*P42=P53*X35 P11+ P35*X35>P53*X35 <- times-right-cancels-gt T35-X T53-X eq/ P35*X35>P53*X35 P35>P53. %worlds () (mul-left-preserves-grt* Q2>Q4 Q1*Q2=Q3 Q1*Q4=Q5 %{=>}% Q3>Q5). %total {} (mul-left-preserves-grt* _ _ _ _). %theorem mul-left-cancels-grt : forall* {Q1} {Q2} {Q3} {Q1'} {Q2'} {Q3'} forall {M1:mul Q1 Q2 Q3} {M2:mul Q1' Q2' Q3'} {E1:equ Q1 Q1'} {G1:grt Q3 Q3'} exists {G2:grt Q2 Q2'} true. - : {TM14:times M1 M4 M14} {TN14:times N1 N4 N14} {TM12:times M1 M2 M12} {TN12:times N1 N2 N12} mul-left-cancels-grt (mul/ R12 TN12 TM12 A2 A1) (mul/ R14 TN14' TM14' A4 A1') equ/ (grt/ P35>P53 T53 T35 A5 A3) (grt/ P24>P42 T42 T24 A4 A2) <- abs-deterministic A1' A1 equ/ M1=M1' N1=N1' <- times-respects-eq TM14' M1=M1' eq/ eq/ TM14 <- times-respects-eq TN14' N1=N1' eq/ eq/ TN14 <- abs-inverse-of-rep-mult* R12 A3 X3- M3*X3=M12 N3*X3=N12 <- abs-inverse-of-rep-mult* R14 A5 X5- M5*X5=M14 N5*X5=N14 <- times-preserves-positive X3- X5- X35- TX35 <- times-total* P35 (s X35-) P35*X35 T35-X <- times-total* P53 (s X35-) P53*X35 T53-X <- times-right-preserves-gt P35>P53 T35-X T53-X P35*X35>P53*X35 <- times-double-associative* T35 TX35 T35-X M3*X3=M12 N5*X5=N14 M12*N14=P35*X35 <- times-commutative TX35 TX53 <- times-double-associative* T53 TX53 T53-X M5*X5=M14 N3*X3=N12 M14*N12=P53*X35 <- times-total T24 <- times-total T42 <- times-total T11 <- times-double-associative* TM12 TN14 M12*N14=P35*X35 T11 T24 P11*P24=P35*X35 <- times-double-associative* TM14 TN12 M14*N12=P53*X35 T11 T42 P11*P42=P53*X35 <- times-left-cancels-gt P11*P24=P35*X35 P11*P42=P53*X35 eq/ P35*X35>P53*X35 P24>P42. %worlds () (mul-left-cancels-grt Q1*Q2=Q3 Q1'*Q2'=Q3' Q1=Q1' Q3>Q3' %{=>}% Q2>Q2'). %total {} (mul-left-cancels-grt _ _ _ _ _). %theorem mul-left-preserves-grt : forall* {X1} {X2} {X4} forall {G:grt X2 X4} exists {X3} {X5} {O1:mul X1 X2 X3} {O2:mul X1 X4 X5} {G2:grt X3 X5} true. - : mul-left-preserves-grt X2>X4 X3 X5 X1*X2=A3 X1*X4=X5 X3>X5 <- mul-total X1*X2=A3 <- mul-total X1*X4=X5 <- mul-left-preserves-grt* X2>X4 X1*X2=A3 X1*X4=X5 X3>X5. %worlds () (mul-left-preserves-grt X2>X4 %{=>}% X3 X5 X1*X2=A3 X1*X4=X5 X3>X5). %total {} (mul-left-preserves-grt _ _ _ _ _ _). %theorem mul-right-preserves-grt* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:grt X1 X2} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} exists {G2:grt X4 X5} true. - : mul-right-preserves-grt* X1>X2 X1*X3=X4 X2*X3=X5 X4>X5 <- mul-commutative X1*X3=X4 X3*X1=X4 <- mul-commutative X2*X3=X5 X3*X2=X5 <- mul-left-preserves-grt* X1>X2 X3*X1=X4 X3*X2=X5 X4>X5. %worlds () (mul-right-preserves-grt* X1>X2 X1*X3=X4 X2*X3=X5 %{=>}% X4>X5). %total {} (mul-right-preserves-grt* _ _ _ _). %theorem mul-right-preserves-grt : forall* {X1} {X2} {X3} forall {G1:grt X1 X2} exists {X4} {X5} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} {G2:grt X4 X5} true. - : mul-right-preserves-grt X1>X2 X4 X5 X1*X3=X4 X2*X3=X5 X4>X5 <- mul-total X1*X3=X4 <- mul-total X2*X3=X5 <- mul-right-preserves-grt* X1>X2 X1*X3=X4 X2*X3=X5 X4>X5. %worlds () (mul-right-preserves-grt X1>X2 %{=>}% X4 X5 X1*X3=X4 X2*X3=X5 X4>X5). %total {} (mul-right-preserves-grt _ _ _ _ _ _). %theorem mul-preserves-grt* : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {G1:grt X1 Y1} {G2:grt X2 Y2} {MX:mul X1 X2 X3} {MY:mul Y1 Y2 Y3} exists {G3:grt X3 Y3} true. - : mul-preserves-grt* X1>Y1 X2>Y2 X1*X2=X3 Y1*Y2=Y3 X3>Y3 <- mul-total Y1*X2=X <- mul-right-preserves-grt* X1>Y1 X1*X2=X3 Y1*X2=X X3>X <- mul-left-preserves-grt* X2>Y2 Y1*X2=X Y1*Y2=Y3 X>Y3 <- grt-transitive X3>X X>Y3 X3>Y3. %worlds () (mul-preserves-grt* X1>Y1 X2>Y2 X1*X2=X3 Y1*Y2=Y3 %{=>}% X3>Y3). %total {} (mul-preserves-grt* _ _ _ _ _). %theorem mul-preserves-grt : forall* {X1} {X2} {Y1} {Y2} forall {G1:grt X1 Y1} {G2:grt X2 Y2} exists {X3} {Y3} {MX:mul X1 X2 X3} {MY:mul Y1 Y2 Y3} {G3:grt X3 Y3} true. - : mul-preserves-grt X1>Y1 X2>Y2 X3 Y3 X1*X2=X3 Y1*Y2=Y3 X3>Y3 <- mul-total X1*X2=X3 <- mul-total Y1*Y2=Y3 <- mul-preserves-grt* X1>Y1 X2>Y2 X1*X2=X3 Y1*Y2=Y3 X3>Y3. %worlds () (mul-preserves-grt X1>Y1 X2>Y2 %{=>}% X3 Y3 X1*X2=X3 Y1*Y2=Y3 X3>Y3). %total {} (mul-preserves-grt _ _ _ _ _ _ _). %theorem mul-right-cancels-grt : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E2:equ X2 Y2} {G3:grt X3 Y3} exists {G1:grt X1 Y1} true. - : mul-right-cancels-grt X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3>Y3 X1>Y1 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative Y1*Y2=Y3 Y2*Y1=Y3 <- mul-left-cancels-grt X2*X1=X3 Y2*Y1=Y3 X2=Y2 X3>Y3 X1>Y1. %worlds () (mul-right-cancels-grt X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3>Y3 %{=>}% X1>Y1). %total {} (mul-right-cancels-grt _ _ _ _ _). %%%%% rat-inv.elf %%%%% Subtraction and dvision for rational numbers %%%%% This file is part of the rat.elf signature %{% Subtraction (sub) and division (div) are declared as abbreviations using addition (add) and multiplication (mul). With one exception the theorems are simple restatements of properties of the base relations. The exception is the right-totality (effectiveness) of rational division. See "div-total*". %}% %%%% Definitions %abbrev sub = [X1] [X2] [X3] add X3 X2 X1. %%%% Theorems %%% Theorems about sub %abbrev false-implies-sub = false-implies-add. %theorem sub-respects-equ : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {D:sub X1 X2 X3} {E1:equ X1 X4} {E2:equ X2 X5} {E3:equ X3 X6} exists {DP:sub X4 X5 X6} true. - : sub-respects-equ S equ/ equ/ equ/ S. %worlds () (sub-respects-equ _ _ _ _ _). %total {} (sub-respects-equ _ _ _ _ _). %theorem sub-deterministic : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {S:sub X1 X2 X3} {SP:sub X4 X5 X6} {E1:equ X1 X4} {E2:equ X2 X5} exists {E3:equ X3 X6} true. - : sub-deterministic X3+X2=X1 X6+X5=X4 X1=X4 X2=X5 X3=X6 <- add-right-cancels X3+X2=X1 X6+X5=X4 X2=X5 X1=X4 X3=X6. %worlds () (sub-deterministic X1-X2=X3 X4-X5=X6 X1=X4 X2=X5 X3=X6). %total {} (sub-deterministic _ _ _ _ _). %theorem add-associates-with-sub* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {OP1:add X1 X2 X3} {IOP1:sub X3 X4 X7} {IOP2:sub X2 X4 X6} exists {OP2:add X1 X6 X7} true. - : add-associates-with-sub* X1+X2=X3 X7+X4=X3 X6+X4=X2 X1+X6=X7 <- add-associative-converse X6+X4=X2 X1+X2=X3 X7P X1+X6=X7P X7P+X4=X3 <- add-right-cancels X7P+X4=X3 X7+X4=X3 equ/ equ/ X7P=X7 <- add-respects-equ X1+X6=X7P equ/ equ/ X7P=X7 X1+X6=X7. %worlds () (add-associates-with-sub* X1+X2=X3 X3-X4=X7 X2-X4=X6 %{=>}% X1+X6=X7). %total {} (add-associates-with-sub* _ _ _ _). %theorem add-associates-with-sub-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP2:sub X2 X4 X6} {OP2:add X1 X6 X7} {OP1:add X1 X2 X3} exists {IOP1:sub X3 X4 X7} true. - : add-associates-with-sub-converse* X6+X4=X2 X1+X6=X7 X1+X2=X3 X7+X4=X3 <- add-associative-converse* X6+X4=X2 X1+X2=X3 X1+X6=X7 X7+X4=X3. %worlds () (add-associates-with-sub-converse* X2-X4=X6 X1+X6=X7 X1+X2=X3 %{=>}% X3-X4=X7). %total {} (add-associates-with-sub-converse* _ _ _ _). %theorem add-associates-with-sub-converse : forall* {X1} {X2} {X4} {X6} {X7} forall {IOP2:sub X2 X4 X6} {OP2:add X1 X6 X7} exists {X3} {OP1:add X1 X2 X3} {IOP1:sub X3 X4 X7} true. - : add-associates-with-sub-converse X6+X4=X2 X1+X6=X7 X3 X1+X2=X3 X7+X4=X3 <- add-total X1+X2=X3 <- add-associates-with-sub-converse* X6+X4=X2 X1+X6=X7 X1+X2=X3 X7+X4=X3. %worlds () (add-associates-with-sub-converse X2-X4=X6 X1+X6=X7 %{=>}% X3 X1+X2=X3 X3-X4=X7). %total {} (add-associates-with-sub-converse _ _ _ _ _). %theorem sub-associates-from-add* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP1:sub X1 X2 X3} {OP1:add X3 X4 X7} {IOP2:sub X2 X4 X6} exists {IOP3:sub X1 X6 X7} true. - : sub-associates-from-add* X3+X2=X1 X3+X4=X7 X6+X4=X2 X7+X6=X1 <- add-commutative X6+X4=X2 X4+X6=X2 <- add-associative-converse* X4+X6=X2 X3+X2=X1 X3+X4=X7 X7+X6=X1. %worlds () (sub-associates-from-add* X1-X2=X3 X3+X4=X7 X2-X4=X6 %{=>}% X1-X6=X7). %total {} (sub-associates-from-add* _ _ _ _). %theorem sub-associates-from-add-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP2:sub X2 X4 X6} {IOP3:sub X1 X6 X7} {IOP1:sub X1 X2 X3} exists {OP1:add X3 X4 X7} true. - : sub-associates-from-add-converse* X6+X4=X2 X7+X6=X1 X3+X2=X1 X3+X4=X7 <- add-commutative X6+X4=X2 X4+X6=X2 <- add-associative-converse X4+X6=X2 X3+X2=X1 X7P X3+X4=X7P X7P+X6=X1 <- add-right-cancels X7P+X6=X1 X7+X6=X1 equ/ equ/ X7P=X7 <- add-respects-equ X3+X4=X7P equ/ equ/ X7P=X7 X3+X4=X7. %worlds () (sub-associates-from-add-converse* X2-X4=X6 X1-X6=X7 X1-X2=X3 %{=>}% X3+X4=X7). %total {} (sub-associates-from-add-converse* _ _ _ _). %theorem sub-associates-to-add* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP1:sub X1 X2 X3} {IOP2:sub X3 X4 X7} {OP1:add X2 X4 X6} exists {IOP3:sub X1 X6 X7} true. - : sub-associates-to-add* X3+X2=X1 X7+X4=X3 X2+X4=X6 X7+X6=X1 <- add-commutative X2+X4=X6 X4+X2=X6 <- add-associative* X7+X4=X3 X3+X2=X1 X4+X2=X6 X7+X6=X1. %worlds () (sub-associates-to-add* X1-X2=X3 X3-X4=X7 X2+X4=X6 %{=>}% X1-X6=X7). %total {} (sub-associates-to-add* _ _ _ _). %theorem sub-associates-to-add : forall* {X1} {X2} {X3} {X4} {X7} forall {IOP1:sub X1 X2 X3} {IOP2:sub X3 X4 X7} exists {X6} {OP1:add X2 X4 X6} {IOP3:sub X1 X6 X7} true. - : sub-associates-to-add X3+X2=X1 X7+X4=X3 X6 X2+X4=X6 X7+X6=X1 <- add-associative X7+X4=X3 X3+X2=X1 X6 X4+X2=X6 X7+X6=X1 <- add-commutative X4+X2=X6 X2+X4=X6. %worlds () (sub-associates-to-add X1-X2=X3 X3-X4=X7 X6 X2+X4=X6 X1-X6=X7). %total {} (sub-associates-to-add _ _ _ _ _). %theorem sub-associates-to-add-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {OP1:add X2 X4 X6} {IOP3:sub X1 X6 X7} {IOP1:sub X1 X2 X3} exists {IOP2:sub X3 X4 X7} true. - : sub-associates-to-add-converse* X2+X4=X6 X7+X6=X1 X3+X2=X1 X7+X4=X3 <- add-commutative X2+X4=X6 X4+X2=X6 <- add-associative-converse X4+X2=X6 X7+X6=X1 X3P X7+X4=X3P X3P+X2=X1 <- add-right-cancels X3P+X2=X1 X3+X2=X1 equ/ equ/ X3P=X3 <- add-respects-equ X7+X4=X3P equ/ equ/ X3P=X3 X7+X4=X3. %worlds () (sub-associates-to-add-converse* X2+X4=X6 X1-X6=X7 X1-X2=X3 %{=>}% X3-X4=X7). %total {} (sub-associates-to-add-converse* _ _ _ _). %theorem sub-associates-to-add-converse : forall* {X1} {X2} {X4} {X6} {X7} forall {OP1:add X2 X4 X6} {IOP3:sub X1 X6 X7} exists {X3} {IOP1:sub X1 X2 X3} {IOP2:sub X3 X4 X7} true. - : sub-associates-to-add-converse X2+X4=X6 X7+X6=X1 X3 X3+X2=X1 X7+X4=X3 <- add-commutative X2+X4=X6 X4+X2=X6 <- add-associative-converse X4+X2=X6 X7+X6=X1 X3 X7+X4=X3 X3+X2=X1. %worlds () (sub-associates-to-add-converse X2+X4=X6 X1-X6=X7 %{=>}% X3 X1-X2=X3 X3-X4=X7). %total {} (sub-associates-to-add-converse _ _ _ _ _). %abbrev sub-implies-grt* = add-implies-grt*. %theorem sub-implies-grt : forall* {Q1} {Q2} {Q3} forall {S:sub Q1 Q2 Q3} exists {G1:grt Q1 Q2} {G2:grt Q1 Q3} true. - : sub-implies-grt Q3+Q2=Q1 Q1>Q2 Q1>Q3 <- add-implies-grt Q3+Q2=Q1 Q1>Q3 Q1>Q2. %worlds () (sub-implies-grt Q1-Q2=Q3 Q1>Q2 Q1>Q3). %total {} (sub-implies-grt _ _ _). %theorem sub-left-cancels : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E1:equ X1 X4} {E3:equ X3 X6} exists {E2:equ X2 X5} true. - : sub-left-cancels X3+X2=X1 X6+X5=X4 X1=X4 X3=X6 X2=X5 <- add-left-cancels X3+X2=X1 X6+X5=X4 X3=X6 X1=X4 X2=X5. %worlds () (sub-left-cancels X1-X2=X3 X4-X5=X6 X1=X4 X3=X6 X2=X5). %total {} (sub-left-cancels _ _ _ _ _). %theorem sub-right-cancels : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E2:equ X2 X5} {E3:equ X3 X6} exists {E1:equ X1 X4} true. - : sub-right-cancels X3+X2=X1 X6+X5=X4 X2=X5 X3=X6 X1=X4 <- add-deterministic X3+X2=X1 X6+X5=X4 X3=X6 X2=X5 X1=X4. %worlds () (sub-right-cancels X1-X2=X3 X4-X5=X6 X2=X5 X3=X6 X1=X4). %total {} (sub-right-cancels _ _ _ _ _). %theorem sub-left-inverts-grt* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:grt X2 X4} {IOP1:sub X1 X2 X3} {IOP2:sub X1 X4 X5} exists {GP:grt X5 X3} true. - : sub-left-inverts-grt* X2>X4 X3+X2=X1 X5+X4=X1 X5>X3 <- add-total X3+X4=X7 <- add-left-preserves-grt* X2>X4 X3+X2=X1 X3+X4=X7 X1>X7 <- add-right-cancels-grt X5+X4=X1 X3+X4=X7 equ/ X1>X7 X5>X3. %worlds () (sub-left-inverts-grt* X2>X4 X1-X2=X3 X1-X4=X5 %{=>}% X5>X3). %total {} (sub-left-inverts-grt* _ _ _ _). %theorem sub-right-preserves-grt* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:grt X1 X2} {IOP1:sub X1 X3 X4} {IOP2:sub X2 X3 X5} exists {GP:grt X4 X5} true. - : sub-right-preserves-grt* X1>X2 X4+X3=X1 X5+X3=X2 X4>X5 <- add-right-cancels-grt X4+X3=X1 X5+X3=X2 equ/ X1>X2 X4>X5. %worlds () (sub-right-preserves-grt* X1>X2 X1-X3=X4 X2-X3=X5 %{=>}% X4>X5). %total {} (sub-right-preserves-grt* _ _ _ _). %theorem sub-left-cancels-inverts-grt : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E:equ X1 X4} {G:grt X3 X6} exists {GP:grt X5 X2} true. - : sub-left-cancels-inverts-grt X3+X2=X1 X6+X5=X4 X1=X4 X3>X6 X5>X2 <- add-total X6+X2=X7 <- add-right-preserves-grt* X3>X6 X3+X2=X1 X6+X2=X7 X1>X7 <- equ-symmetric X1=X4 X4=X1 <- add-respects-equ X6+X5=X4 equ/ equ/ X4=X1 X6+X5=X1 <- add-left-cancels-grt X6+X5=X1 X6+X2=X7 equ/ X1>X7 X5>X2. %worlds () (sub-left-cancels-inverts-grt X1-X2=X3 X4-X5=X6 X1=X4 X3>X6 %{=>}% X5>X2). %total {} (sub-left-cancels-inverts-grt _ _ _ _ _). %theorem sub-right-cancels-grt : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E2:equ X2 X5} {G3:grt X3 X6} exists {G1:grt X1 X4} true. - : sub-right-cancels-grt X3+X2=X1 X6+X5=X4 X2=X5 X3>X6 X1>X4 <- add-respects-equ X3+X2=X1 equ/ X2=X5 equ/ X3+X5=X1 <- add-right-preserves-grt* X3>X6 X3+X5=X1 X6+X5=X4 X1>X4. %worlds () (sub-right-cancels-grt X1-X2=X3 X4-X5=X6 X2=X5 X3>X6 %{=>}% X1>X4). %total {} (sub-right-cancels-grt _ _ _ _ _). %theorem mul-right-factors-over-sub : forall* {X1} {X2} {X4} {X5} {X6} {X7} forall {M14:mul X1 X4 X5} {M24:mul X2 X4 X6} {S56:sub X5 X6 X7} exists {X3} {S12:sub X1 X2 X3} {M34:mul X3 X4 X7} true. - : mul-right-factors-over-sub X1*X4=X5 X2*X4=X6 X7+X6=X5 X3 X3+X2=X1 X3*X4=X7 <- add-implies-grt X7+X6=X5 _ X5>X6 <- mul-right-cancels-grt X1*X4=X5 X2*X4=X6 equ/ X5>X6 X1>X2 <- grt-implies-add X1>X2 X3 X3+X2=X1 <- mul-total X3*X4=X7P <- mul-right-distributes-over-add* X3+X2=X1 X1*X4=X5 X3*X4=X7P X2*X4=X6 X7P+X6=X5 <- add-right-cancels X7P+X6=X5 X7+X6=X5 equ/ equ/ X7P=X7 <- mul-respects-equ X3*X4=X7P equ/ equ/ X7P=X7 X3*X4=X7. %worlds () (mul-right-factors-over-sub X1*X4=X5 X2*X4=X6 X5-X6=X7 %{=>}% X3 X1-X2=X3 X3*X4=X7 ). %total {} (mul-right-factors-over-sub _ _ _ _ _ _). %theorem mul-right-distributes-over-sub : forall* {X1} {X2} {X3} {X4} {X7} forall {S12:sub X1 X2 X3} {M34:mul X3 X4 X7} exists {X5} {X6} {M14:mul X1 X4 X5} {M24:mul X2 X4 X6} {S56:sub X5 X6 X7} true. - : mul-right-distributes-over-sub X3+X2=X1 X3*X4=X7 _ _ X1*X4=X5 X2*X4=X6 X7+X6=X5 <- mul-total X1*X4=X5 <- mul-right-distributes-over-add X3+X2=X1 X1*X4=X5 _ _ X3*X4=Y7 X2*X4=X6 Y7+X6=X5 <- mul-deterministic X3*X4=Y7 X3*X4=X7 equ/ equ/ Y7=X7 <- add-respects-equ Y7+X6=X5 Y7=X7 equ/ equ/ X7+X6=X5. %worlds () (mul-right-distributes-over-sub X1-X2=X3 X3*X4=X7 %{=>}% X5 X6 X1*X4=X5 X2*X4=X6 X5-X6=X7). %total {} (mul-right-distributes-over-sub _ _ _ _ _ _ _). %theorem mul-right-distributes-over-sub* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {A12:sub X1 X2 X3} {M34:mul X3 X4 X7} {M14:mul X1 X4 X5} {M24:mul X2 X4 X6} exists {A56:sub X5 X6 X7} true. - : mul-right-distributes-over-sub* X1-X2=X3 X3*X4=X7 X1*X4=X5 X2*X4=X6 X5-X6=X7 <- mul-right-distributes-over-sub X1-X2=X3 X3*X4=X7 Y5 Y6 X1*X4=Y5 X2*X4=Y6 Y5-Y6=X7 <- mul-deterministic X1*X4=Y5 X1*X4=X5 equ/ equ/ Y5=X5 <- mul-deterministic X2*X4=Y6 X2*X4=X6 equ/ equ/ Y6=X6 <- sub-respects-equ Y5-Y6=X7 Y5=X5 Y6=X6 equ/ X5-X6=X7. %worlds () (mul-right-distributes-over-sub* X1-X2=X3 X3*X4=X7 X1*X4=X5 X2*X4=X6 %{=>}% X5-X6=X7). %total {} (mul-right-distributes-over-sub* _ _ _ _ _). %theorem mul-left-distributes-over-sub* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {A12:sub X2 X4 X6} {M34:mul X1 X6 X7} {M14:mul X1 X2 X3} {M24:mul X1 X4 X5} exists {A56:sub X3 X5 X7} true. - : mul-left-distributes-over-sub* X2-X4=X6 X1*X6=X7 X1*X2=X3 X1*X4=X5 X3-X5=X7 <- mul-commutative X1*X6=X7 X6*X1=X7 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative X1*X4=X5 X4*X1=X5 <- mul-right-distributes-over-sub* X2-X4=X6 X6*X1=X7 X2*X1=X3 X4*X1=X5 X3-X5=X7. %worlds () (mul-left-distributes-over-sub* X2-X4=X6 X1*X6=X7 X1*X2=X3 X1*X4=X5 %{=>}% X3-X5=X7). %total {} (mul-left-distributes-over-sub* _ _ _ _ _). %theorem mul-left-distributes-over-sub : forall* {X1} {X2} {X4} {X6} {X7} forall {A12:sub X2 X4 X6} {M34:mul X1 X6 X7} exists {X3} {X5} {M14:mul X1 X2 X3} {M24:mul X1 X4 X5} {A56:sub X3 X5 X7} true. - : mul-left-distributes-over-sub X2-X4=X6 X1*X6=X7 X3 X5 X1*X2=X3 X1*X4=X5 X3-X5=X7 <- mul-total X1*X2=X3 <- mul-total X1*X4=X5 <- mul-left-distributes-over-sub* X2-X4=X6 X1*X6=X7 X1*X2=X3 X1*X4=X5 X3-X5=X7. %worlds () (mul-left-distributes-over-sub X2-X4=X6 X1*X6=X7 %{=>}% X3 X5 X1*X2=X3 X1*X4=X5 X3-X5=X7). %total {} (mul-left-distributes-over-sub _ _ _ _ _ _ _). %theorem mul-right-factors-over-sub* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {M14:mul X1 X4 X5} {M24:mul X2 X4 X6} {A56:sub X5 X6 X7} {A12:sub X1 X2 X3} exists {M34:mul X3 X4 X7} true. - : mul-right-factors-over-sub* X1*X4=X5 X2*X4=X6 X5-X6=X7 X1-X2=X3 X3*X4=X7 <- mul-total X3*X4=Y7 <- mul-right-distributes-over-sub* X1-X2=X3 X3*X4=Y7 X1*X4=X5 X2*X4=X6 X5-X6=Y7 <- sub-deterministic X5-X6=Y7 X5-X6=X7 equ/ equ/ Y7=X7 <- mul-respects-equ X3*X4=Y7 equ/ equ/ Y7=X7 X3*X4=X7. %worlds () (mul-right-factors-over-sub* X1*X4=X5 X2*X4=X6 X5-X6=X7 X1-X2=X3 %{=>}% X3*X4=X7 ). %total {} (mul-right-factors-over-sub* _ _ _ _ _). %theorem mul-left-factors-over-sub : forall* {X1} {X2} {X3} {X4} {X5} {X7} forall {M12:mul X1 X2 X3} {M14:mul X1 X4 X5} {A35:sub X3 X5 X7} exists {X6} {A24:sub X2 X4 X6} {M16:mul X1 X6 X7} true. - : mul-left-factors-over-sub X1*X2=X3 X1*X4=X5 X3-X5=X7 X6 X2-X4=X6 X1*X6=X7 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative X1*X4=X5 X4*X1=X5 <- mul-right-factors-over-sub X2*X1=X3 X4*X1=X5 X3-X5=X7 X6 X2-X4=X6 X6*X1=X7 <- mul-commutative X6*X1=X7 X1*X6=X7. %worlds () (mul-left-factors-over-sub X1*X2=X3 X1*X4=X5 X3-X5=X7 %{=>}% X6 X2-X4=X6 X1*X6=X7). %total {} (mul-left-factors-over-sub _ _ _ _ _ _). %theorem mul-left-factors-over-sub* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {M12:mul X1 X2 X3} {M14:mul X1 X4 X5} {A35:sub X3 X5 X7} {A24:sub X2 X4 X6} exists {M16:mul X1 X6 X7} true. - : mul-left-factors-over-sub* X1*X2=X3 X1*X4=X5 X3-X5=X7 X2-X4=X6 X1*X6=X7 <- mul-total X1*X6=Y7 <- mul-left-distributes-over-sub* X2-X4=X6 X1*X6=Y7 X1*X2=X3 X1*X4=X5 X3-X5=Y7 <- sub-deterministic X3-X5=Y7 X3-X5=X7 equ/ equ/ Y7=X7 <- mul-respects-equ X1*X6=Y7 equ/ equ/ Y7=X7 X1*X6=X7. %worlds () (mul-left-factors-over-sub* X1*X2=X3 X1*X4=X5 X3-X5=X7 X2-X4=X6 %{=>}% X1*X6=X7). %total {} (mul-left-factors-over-sub* _ _ _ _ _). %%%% Definitions %abbrev div = [X1] [X2] [X3] mul X3 X2 X1. %%%% Theorems %%% Theorems about div %abbrev false-implies-div = false-implies-mul. %theorem div-respects-equ : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {D:div X1 X2 X3} {E1:equ X1 X4} {E2:equ X2 X5} {E3:equ X3 X6} exists {DP:div X4 X5 X6} true. - : div-respects-equ S equ/ equ/ equ/ S. %worlds () (div-respects-equ _ _ _ _ _). %total {} (div-respects-equ _ _ _ _ _). %theorem div-deterministic : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {S:div X1 X2 X3} {SP:div X4 X5 X6} {E1:equ X1 X4} {E2:equ X2 X5} exists {E3:equ X3 X6} true. - : div-deterministic X3*X2=X1 X6*X5=X4 X1=X4 X2=X5 X3=X6 <- mul-right-cancels X3*X2=X1 X6*X5=X4 X2=X5 X1=X4 X3=X6. %worlds () (div-deterministic X1/X2=X3 X4/X5=X6 X1=X4 X2=X5 X3=X6). %total {} (div-deterministic _ _ _ _ _). %theorem div-total* : forall {Q3} {Q2} exists {Q1} {D:div Q3 Q2 Q1} true. - : div-total* Q3 Q2 Q1 (mul/ R12 TN12 TM12 A2 A1) <- abs-total* Q3 M3- N3- A3 <- abs-total* Q2 M2- N2- A2 <- times-preserves-positive M3- N2- P32- T32 <- times-preserves-positive M2- N3- P23- T23 <- rep-total* P32- P23- Q1 R23 <- abs-total* Q1 M1- N1- A1 <- abs-inverse-of-rep-mult R23 A1 X M1*X=P32 N1*X=P23 <- times-preserves-positive M1- M2- M12- TM12 <- times-preserves-positive N1- N2- N12- TN12 <- rep-inverse-of-abs A3 R3 <- times-preserves-positive M2- N2- P22- T22 <- times-commutative T22 T22c <- times-total* (s M3-) (s P22-) M3*P22 T-1 <- times-total* (s N3-) (s P22-) N3*P22 T-2 <- rep-times-right R3 eq/ T-1 T-2 R3*P22 <- times-associative-converse* T22c T-1 T32 (T-1a:times (s P32-) (s M2-) M3*P22) <- times-commutative T23 T23c <- times-associative-converse* T22 T-2 T23c (T-2a:times (s P23-) (s N2-) N3*P22) <- times-commutative M1*X=P32 X*M1=P32 <- times-commutative N1*X=P23 X*N1=P23 <- times-associative* X*M1=P32 T-1a TM12 X*M12=M3*P22 <- times-associative* X*N1=P23 T-2a TN12 X*N12=N3*P22 <- rep-left-cancels R3*P22 X*M12=M3*P22 X*N12=N3*P22 R12. %worlds () (div-total* Q1 Q2 Q3 Q1/Q2=Q3). %total {} (div-total* _ _ _ _). %abbrev div-total = div-total* _ _ _. %theorem mul-associates-with-div* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {OP1:mul X1 X2 X3} {IOP1:div X3 X4 X7} {IOP2:div X2 X4 X6} exists {OP2:mul X1 X6 X7} true. - : mul-associates-with-div* X1*X2=X3 X7*X4=X3 X6*X4=X2 X1*X6=X7 <- mul-associative-converse X6*X4=X2 X1*X2=X3 X7P X1*X6=X7P X7P+X4=X3 <- mul-right-cancels X7P+X4=X3 X7*X4=X3 equ/ equ/ X7P=X7 <- mul-respects-equ X1*X6=X7P equ/ equ/ X7P=X7 X1*X6=X7. %worlds () (mul-associates-with-div* X1*X2=X3 X3/X4=X7 X2/X4=X6 %{=>}% X1*X6=X7). %total {} (mul-associates-with-div* _ _ _ _). %theorem mul-associates-with-div : forall* {X1} {X2} {X3} {X4} {X7} forall {OP1:mul X1 X2 X3} {IOP1:div X3 X4 X7} exists {X6} {IOP2:div X2 X4 X6} {OP2:mul X1 X6 X7} true. - : mul-associates-with-div X1*X2=X3 X3/X4=X7 X6 X2/X4=X6 X1*X6=X7 <- div-total X2/X4=X6 <- mul-associates-with-div* X1*X2=X3 X3/X4=X7 X2/X4=X6 X1*X6=X7. %worlds () (mul-associates-with-div X1*X2=X3 X3/X4=X7 %{=>}% X6 X2/X4=X6 X1*X6=X7). %total {} (mul-associates-with-div _ _ _ _ _). %theorem mul-associates-with-div-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP2:div X2 X4 X6} {OP2:mul X1 X6 X7} {OP1:mul X1 X2 X3} exists {IOP1:div X3 X4 X7} true. - : mul-associates-with-div-converse* X6*X4=X2 X1*X6=X7 X1*X2=X3 X7*X4=X3 <- mul-associative-converse* X6*X4=X2 X1*X2=X3 X1*X6=X7 X7*X4=X3. %worlds () (mul-associates-with-div-converse* X2/X4=X6 X1*X6=X7 X1*X2=X3 %{=>}% X3/X4=X7). %total {} (mul-associates-with-div-converse* _ _ _ _). %theorem mul-associates-with-div-converse : forall* {X1} {X2} {X4} {X6} {X7} forall {IOP2:div X2 X4 X6} {OP2:mul X1 X6 X7} exists {X3} {OP1:mul X1 X2 X3} {IOP1:div X3 X4 X7} true. - : mul-associates-with-div-converse X6*X4=X2 X1*X6=X7 X3 X1*X2=X3 X7*X4=X3 <- mul-total X1*X2=X3 <- mul-associates-with-div-converse* X6*X4=X2 X1*X6=X7 X1*X2=X3 X7*X4=X3. %worlds () (mul-associates-with-div-converse X2/X4=X6 X1*X6=X7 %{=>}% X3 X1*X2=X3 X3/X4=X7). %total {} (mul-associates-with-div-converse _ _ _ _ _). %theorem div-associates-from-mul* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP1:div X1 X2 X3} {OP1:mul X3 X4 X7} {IOP2:div X2 X4 X6} exists {IOP3:div X1 X6 X7} true. - : div-associates-from-mul* X3*X2=X1 X3*X4=X7 X6*X4=X2 X7*X6=X1 <- mul-commutative X6*X4=X2 X4*X6=X2 <- mul-associative-converse* X4*X6=X2 X3*X2=X1 X3*X4=X7 X7*X6=X1. %worlds () (div-associates-from-mul* X1/X2=X3 X3*X4=X7 X2/X4=X6 %{=>}% X1/X6=X7). %total {} (div-associates-from-mul* _ _ _ _). %theorem div-associates-from-mul : forall* {X1} {X2} {X3} {X4} {X7} forall {IOP1:div X1 X2 X3} {OP1:mul X3 X4 X7} exists {X6} {IOP2:div X2 X4 X6} {IOP3:div X1 X6 X7} true. - : div-associates-from-mul X3*X2=X1 X3*X4=X7 X6 X6*X4=X2 X7*X6=X1 <- div-total X6*X4=X2 <- div-associates-from-mul* X3*X2=X1 X3*X4=X7 X6*X4=X2 X7*X6=X1. %worlds () (div-associates-from-mul X1/X2=X3 X3*X4=X7 %{=>}% X6 X2/X4=X6 X1/X6=X7). %total {} (div-associates-from-mul _ _ _ _ _). %theorem div-associates-from-mul-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP2:div X2 X4 X6} {IOP3:div X1 X6 X7} {IOP1:div X1 X2 X3} exists {OP1:mul X3 X4 X7} true. - : div-associates-from-mul-converse* X6*X4=X2 X7*X6=X1 X3*X2=X1 X3*X4=X7 <- mul-commutative X6*X4=X2 X4*X6=X2 <- mul-associative-converse X4*X6=X2 X3*X2=X1 X7P X3*X4=X7P X7P+X6=X1 <- mul-right-cancels X7P+X6=X1 X7*X6=X1 equ/ equ/ X7P=X7 <- mul-respects-equ X3*X4=X7P equ/ equ/ X7P=X7 X3*X4=X7. %worlds () (div-associates-from-mul-converse* X2/X4=X6 X1/X6=X7 X1/X2=X3 %{=>}% X3*X4=X7). %total {} (div-associates-from-mul-converse* _ _ _ _). %theorem div-associates-from-mul-converse : forall* {X1} {X2} {X4} {X6} {X7} forall {IOP2:div X2 X4 X6} {IOP3:div X1 X6 X7} exists {X3} {IOP1:div X1 X2 X3} {OP1:mul X3 X4 X7} true. - : div-associates-from-mul-converse X2/X4=X6 X1/X6=X7 X3 X1/X2=X3 X3*X4=X7 <- div-total X1/X2=X3 <- div-associates-from-mul-converse* X2/X4=X6 X1/X6=X7 X1/X2=X3 X3*X4=X7. %worlds () (div-associates-from-mul-converse X2/X4=X6 X1/X6=X7 %{=>}% X3 X1/X2=X3 X3*X4=X7). %total {} (div-associates-from-mul-converse _ _ _ _ _). %theorem div-associates-to-mul* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {IOP1:div X1 X2 X3} {IOP2:div X3 X4 X7} {OP1:mul X2 X4 X6} exists {IOP3:div X1 X6 X7} true. - : div-associates-to-mul* X3*X2=X1 X7*X4=X3 X2*X4=X6 X7*X6=X1 <- mul-commutative X2*X4=X6 X4*X2=X6 <- mul-associative* X7*X4=X3 X3*X2=X1 X4*X2=X6 X7*X6=X1. %worlds () (div-associates-to-mul* X1/X2=X3 X3/X4=X7 X2*X4=X6 %{=>}% X1/X6=X7). %total {} (div-associates-to-mul* _ _ _ _). %theorem div-associates-to-mul : forall* {X1} {X2} {X3} {X4} {X7} forall {IOP1:div X1 X2 X3} {IOP2:div X3 X4 X7} exists {X6} {OP1:mul X2 X4 X6} {IOP3:div X1 X6 X7} true. - : div-associates-to-mul X3*X2=X1 X7*X4=X3 X6 X2*X4=X6 X7*X6=X1 <- mul-associative X7*X4=X3 X3*X2=X1 X6 X4*X2=X6 X7*X6=X1 <- mul-commutative X4*X2=X6 X2*X4=X6. %worlds () (div-associates-to-mul X1/X2=X3 X3/X4=X7 X6 X2*X4=X6 X1/X6=X7). %total {} (div-associates-to-mul _ _ _ _ _). %theorem div-associates-to-mul-converse* : forall* {X1} {X2} {X3} {X4} {X6} {X7} forall {OP1:mul X2 X4 X6} {IOP3:div X1 X6 X7} {IOP1:div X1 X2 X3} exists {IOP2:div X3 X4 X7} true. - : div-associates-to-mul-converse* X2*X4=X6 X7*X6=X1 X3*X2=X1 X7*X4=X3 <- mul-commutative X2*X4=X6 X4*X2=X6 <- mul-associative-converse X4*X2=X6 X7*X6=X1 X3P X7*X4=X3P X3P+X2=X1 <- mul-right-cancels X3P+X2=X1 X3*X2=X1 equ/ equ/ X3P=X3 <- mul-respects-equ X7*X4=X3P equ/ equ/ X3P=X3 X7*X4=X3. %worlds () (div-associates-to-mul-converse* X2*X4=X6 X1/X6=X7 X1/X2=X3 %{=>}% X3/X4=X7). %total {} (div-associates-to-mul-converse* _ _ _ _). %theorem div-associates-to-mul-converse : forall* {X1} {X2} {X4} {X6} {X7} forall {OP1:mul X2 X4 X6} {IOP3:div X1 X6 X7} exists {X3} {IOP1:div X1 X2 X3} {IOP2:div X3 X4 X7} true. - : div-associates-to-mul-converse X2*X4=X6 X7*X6=X1 X3 X3*X2=X1 X7*X4=X3 <- mul-commutative X2*X4=X6 X4*X2=X6 <- mul-associative-converse X4*X2=X6 X7*X6=X1 X3 X7*X4=X3 X3*X2=X1. %worlds () (div-associates-to-mul-converse X2*X4=X6 X1/X6=X7 %{=>}% X3 X1/X2=X3 X3/X4=X7). %total {} (div-associates-to-mul-converse _ _ _ _ _). %theorem div-left-cancels : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E1:equ X1 X4} {E3:equ X3 X6} exists {E2:equ X2 X5} true. - : div-left-cancels X3*X2=X1 X6*X5=X4 X1=X4 X3=X6 X2=X5 <- mul-left-cancels X3*X2=X1 X6*X5=X4 X3=X6 X1=X4 X2=X5. %worlds () (div-left-cancels X1/X2=X3 X4/X5=X6 X1=X4 X3=X6 X2=X5). %total {} (div-left-cancels _ _ _ _ _). %theorem div-right-cancels : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E2:equ X2 X5} {E3:equ X3 X6} exists {E1:equ X1 X4} true. - : div-right-cancels X3*X2=X1 X6*X5=X4 X2=X5 X3=X6 X1=X4 <- mul-deterministic X3*X2=X1 X6*X5=X4 X3=X6 X2=X5 X1=X4. %worlds () (div-right-cancels X1/X2=X3 X4/X5=X6 X2=X5 X3=X6 X1=X4). %total {} (div-right-cancels _ _ _ _ _). %theorem div-left-inverts-grt* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:grt X2 X4} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} exists {GP:grt X5 X3} true. - : div-left-inverts-grt* X2>X4 X3*X2=X1 X5*X4=X1 X5>X3 <- mul-total X3*X4=X7 <- mul-left-preserves-grt* X2>X4 X3*X2=X1 X3*X4=X7 X1>X7 <- mul-right-cancels-grt X5*X4=X1 X3*X4=X7 equ/ X1>X7 X5>X3. %worlds () (div-left-inverts-grt* X2>X4 X1/X2=X3 X1/X4=X5 %{=>}% X5>X3). %total {} (div-left-inverts-grt* _ _ _ _). %theorem div-left-inverts-grt : forall* {X1} {X2} {X4} forall {G:grt X2 X4} exists {X3} {X5} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} {GP:grt X5 X3} true. - : div-left-inverts-grt X2>X4 X3 X5 X1/X2=X3 X1/X4=X5 X5>X3 <- div-total X1/X2=X3 <- div-total X1/X4=X5 <- div-left-inverts-grt* X2>X4 X1/X2=X3 X1/X4=X5 X5>X3. %worlds () (div-left-inverts-grt X2>X4 %{=>}% X3 X5 X1/X2=X3 X1/X4=X5 X5>X3). %total {} (div-left-inverts-grt _ _ _ _ _ _). %theorem div-right-preserves-grt* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:grt X1 X2} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} exists {GP:grt X4 X5} true. - : div-right-preserves-grt* X1>X2 X4*X3=X1 X5*X3=X2 X4>X5 <- mul-right-cancels-grt X4*X3=X1 X5*X3=X2 equ/ X1>X2 X4>X5. %worlds () (div-right-preserves-grt* X1>X2 X1/X3=X4 X2/X3=X5 %{=>}% X4>X5). %total {} (div-right-preserves-grt* _ _ _ _). %theorem div-right-preserves-grt : forall* {X1} {X2} {X3} forall {G:grt X1 X2} exists {X4} {X5} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} {GP:grt X4 X5} true. - : div-right-preserves-grt X1>X2 X4 X5 X1/X3=X4 X2/X3=X5 X4>X5 <- div-total X1/X3=X4 <- div-total X2/X3=X5 <- div-right-preserves-grt* X1>X2 X1/X3=X4 X2/X3=X5 X4>X5. %worlds () (div-right-preserves-grt X1>X2 %{=>}% X4 X5 X1/X3=X4 X2/X3=X5 X4>X5). %total {} (div-right-preserves-grt _ _ _ _ _ _). %theorem div-left-cancels-inverts-grt : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E:equ X1 X4} {G:grt X3 X6} exists {GP:grt X5 X2} true. - : div-left-cancels-inverts-grt X3*X2=X1 X6*X5=X4 X1=X4 X3>X6 X5>X2 <- mul-total X6*X2=X7 <- mul-right-preserves-grt* X3>X6 X3*X2=X1 X6*X2=X7 X1>X7 <- equ-symmetric X1=X4 X4=X1 <- mul-respects-equ X6*X5=X4 equ/ equ/ X4=X1 X6*X5=X1 <- mul-left-cancels-grt X6*X5=X1 X6*X2=X7 equ/ X1>X7 X5>X2. %worlds () (div-left-cancels-inverts-grt X1/X2=X3 X4/X5=X6 X1=X4 X3>X6 %{=>}% X5>X2). %total {} (div-left-cancels-inverts-grt _ _ _ _ _). %theorem div-right-cancels-grt : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E2:equ X2 X5} {G3:grt X3 X6} exists {G1:grt X1 X4} true. - : div-right-cancels-grt X3*X2=X1 X6*X5=X4 X2=X5 X3>X6 X1>X4 <- mul-respects-equ X3*X2=X1 equ/ X2=X5 equ/ X3*X5=X1 <- mul-right-preserves-grt* X3>X6 X3*X5=X1 X6*X5=X4 X1>X4. %worlds () (div-right-cancels-grt X1/X2=X3 X4/X5=X6 X2=X5 X3>X6 %{=>}% X1>X4). %total {} (div-right-cancels-grt _ _ _ _ _). %theorem div-right-distributes-over-add : forall* {Q1} {Q2} {Q3} {Q4} {Q7} forall {A12:add Q1 Q2 Q3} {D34:div Q3 Q4 Q7} exists {Q5} {Q6} {D14:div Q1 Q4 Q5} {D24:div Q2 Q4 Q6} {A56:add Q5 Q6 Q7} true. - : div-right-distributes-over-add Q1+Q2=Q3 Q7*Q4=Q3 Q5 Q6 Q5*Q4=Q1 Q6*Q4=Q2 Q5+Q6=Q7 <- div-total Q5*Q4=Q1 <- div-total Q6*Q4=Q2 <- add-total Q5+Q6=Q7P <- mul-total Q7P*Q4=Q3P <- mul-right-distributes-over-add* Q5+Q6=Q7P Q7P*Q4=Q3P Q5*Q4=Q1 Q6*Q4=Q2 Q1+Q2=Q3P <- add-deterministic Q1+Q2=Q3P Q1+Q2=Q3 equ/ equ/ Q3P=Q3 <- mul-right-cancels Q7P*Q4=Q3P Q7*Q4=Q3 equ/ Q3P=Q3 Q7P=Q7 <- add-respects-equ Q5+Q6=Q7P equ/ equ/ Q7P=Q7 Q5+Q6=Q7. %worlds () (div-right-distributes-over-add Q1+Q2=Q3 Q3/Q4=Q7 %{=>}% Q5 Q6 Q1/Q4=Q5 Q2/Q4=Q6 Q5+Q6=Q7). %total {} (div-right-distributes-over-add _ _ _ _ _ _ _). %theorem div-right-distributes-over-add* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {A12:add X1 X2 X3} {M34:div X3 X4 X7} {M14:div X1 X4 X5} {M24:div X2 X4 X6} exists {A56:add X5 X6 X7} true. - : div-right-distributes-over-add* X1+X2=X3 X3/X4=X7 X1/X4=X5 X2/X4=X6 X5+X6=X7 <- div-right-distributes-over-add X1+X2=X3 X3/X4=X7 Y5 Y6 X1/X4=Y5 X2/X4=Y6 Y5+Y6=X7 <- div-deterministic X1/X4=Y5 X1/X4=X5 equ/ equ/ Y5=X5 <- div-deterministic X2/X4=Y6 X2/X4=X6 equ/ equ/ Y6=X6 <- add-respects-equ Y5+Y6=X7 Y5=X5 Y6=X6 equ/ X5+X6=X7. %worlds () (div-right-distributes-over-add* X1+X2=X3 X3/X4=X7 X1/X4=X5 X2/X4=X6 %{=>}% X5+X6=X7). %total {} (div-right-distributes-over-add* _ _ _ _ _). %theorem div-right-factors-over-add : forall* {X1} {X2} {X4} {X5} {X6} {X7} forall {M14:div X1 X4 X5} {M24:div X2 X4 X6} {A56:add X5 X6 X7} exists {X3} {A12:add X1 X2 X3} {M34:div X3 X4 X7} true. - : div-right-factors-over-add X1/X4=X5 X2/X4=X6 X5+X6=X7 X3 X1+X2=X3 X3/X4=X7 <- add-total X1+X2=X3 <- div-total X3/X4=Y7 <- div-right-distributes-over-add* X1+X2=X3 X3/X4=Y7 X1/X4=X5 X2/X4=X6 X5+X6=Y7 <- add-deterministic X5+X6=Y7 X5+X6=X7 equ/ equ/ Y7=X7 <- div-respects-equ X3/X4=Y7 equ/ equ/ Y7=X7 X3/X4=X7. %worlds () (div-right-factors-over-add X1/X4=X5 X2/X4=X6 X5+X6=X7 %{=>}% X3 X1+X2=X3 X3/X4=X7 ). %total {} (div-right-factors-over-add _ _ _ _ _ _). %theorem div-right-factors-over-add* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {M14:div X1 X4 X5} {M24:div X2 X4 X6} {A56:add X5 X6 X7} {A12:add X1 X2 X3} exists {M34:div X3 X4 X7} true. - : div-right-factors-over-add* X1/X4=X5 X2/X4=X6 X5+X6=X7 X1+X2=X3 X3/X4=X7 <- div-total X3/X4=Y7 <- div-right-distributes-over-add* X1+X2=X3 X3/X4=Y7 X1/X4=X5 X2/X4=X6 X5+X6=Y7 <- add-deterministic X5+X6=Y7 X5+X6=X7 equ/ equ/ Y7=X7 <- div-respects-equ X3/X4=Y7 equ/ equ/ Y7=X7 X3/X4=X7. %worlds () (div-right-factors-over-add* X1/X4=X5 X2/X4=X6 X5+X6=X7 X1+X2=X3 %{=>}% X3/X4=X7 ). %total {} (div-right-factors-over-add* _ _ _ _ _). %theorem div-right-factors-over-sub : forall* {X1} {X2} {X4} {X5} {X6} {X7} forall {M14:div X1 X4 X5} {M24:div X2 X4 X6} {S56:sub X5 X6 X7} exists {X3} {S12:sub X1 X2 X3} {M34:div X3 X4 X7} true. - : div-right-factors-over-sub X1/X4=X5 X2/X4=X6 X7+X6=X5 X3 X3+X2=X1 X3/X4=X7 <- add-implies-grt X7+X6=X5 _ X5>X6 <- div-right-cancels-grt X1/X4=X5 X2/X4=X6 equ/ X5>X6 X1>X2 <- grt-implies-add X1>X2 X3 X3+X2=X1 <- div-total X3/X4=X7P <- div-right-distributes-over-add* X3+X2=X1 X1/X4=X5 X3/X4=X7P X2/X4=X6 X7P+X6=X5 <- add-right-cancels X7P+X6=X5 X7+X6=X5 equ/ equ/ X7P=X7 <- div-respects-equ X3/X4=X7P equ/ equ/ X7P=X7 X3/X4=X7. %worlds () (div-right-factors-over-sub X1/X4=X5 X2/X4=X6 X5-X6=X7 %{=>}% X3 X1-X2=X3 X3/X4=X7 ). %total {} (div-right-factors-over-sub _ _ _ _ _ _). %theorem div-right-distributes-over-sub : forall* {X1} {X2} {X3} {X4} {X7} forall {S12:sub X1 X2 X3} {M34:div X3 X4 X7} exists {X5} {X6} {M14:div X1 X4 X5} {M24:div X2 X4 X6} {S56:sub X5 X6 X7} true. - : div-right-distributes-over-sub X3+X2=X1 X3/X4=X7 _ _ X1/X4=X5 X2/X4=X6 X7+X6=X5 <- div-total X1/X4=X5 <- div-right-distributes-over-add X3+X2=X1 X1/X4=X5 _ _ X3/X4=Y7 X2/X4=X6 Y7+X6=X5 <- div-deterministic X3/X4=Y7 X3/X4=X7 equ/ equ/ Y7=X7 <- add-respects-equ Y7+X6=X5 Y7=X7 equ/ equ/ X7+X6=X5. %worlds () (div-right-distributes-over-sub X1-X2=X3 X3/X4=X7 %{=>}% X5 X6 X1/X4=X5 X2/X4=X6 X5-X6=X7). %total {} (div-right-distributes-over-sub _ _ _ _ _ _ _). %theorem div-right-distributes-over-sub* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {A12:sub X1 X2 X3} {M34:div X3 X4 X7} {M14:div X1 X4 X5} {M24:div X2 X4 X6} exists {A56:sub X5 X6 X7} true. - : div-right-distributes-over-sub* X1-X2=X3 X3/X4=X7 X1/X4=X5 X2/X4=X6 X5-X6=X7 <- div-right-distributes-over-sub X1-X2=X3 X3/X4=X7 Y5 Y6 X1/X4=Y5 X2/X4=Y6 Y5-Y6=X7 <- div-deterministic X1/X4=Y5 X1/X4=X5 equ/ equ/ Y5=X5 <- div-deterministic X2/X4=Y6 X2/X4=X6 equ/ equ/ Y6=X6 <- sub-respects-equ Y5-Y6=X7 Y5=X5 Y6=X6 equ/ X5-X6=X7. %worlds () (div-right-distributes-over-sub* X1-X2=X3 X3/X4=X7 X1/X4=X5 X2/X4=X6 %{=>}% X5-X6=X7). %total {} (div-right-distributes-over-sub* _ _ _ _ _). %theorem div-right-factors-over-sub* : forall* {X1} {X2} {X3} {X4} {X5} {X6} {X7} forall {M14:div X1 X4 X5} {M24:div X2 X4 X6} {A56:sub X5 X6 X7} {A12:sub X1 X2 X3} exists {M34:div X3 X4 X7} true. - : div-right-factors-over-sub* X1/X4=X5 X2/X4=X6 X5-X6=X7 X1-X2=X3 X3/X4=X7 <- div-total X3/X4=Y7 <- div-right-distributes-over-sub* X1-X2=X3 X3/X4=Y7 X1/X4=X5 X2/X4=X6 X5-X6=Y7 <- sub-deterministic X5-X6=Y7 X5-X6=X7 equ/ equ/ Y7=X7 <- div-respects-equ X3/X4=Y7 equ/ equ/ Y7=X7 X3/X4=X7. %worlds () (div-right-factors-over-sub* X1/X4=X5 X2/X4=X6 X5-X6=X7 X1-X2=X3 %{=>}% X3/X4=X7 ). %total {} (div-right-factors-over-sub* _ _ _ _ _). % a theorem needed in fractional permissions %theorem add-cross-comparable : forall* {Q} {Q1} {Q2} {Q3} {Q4} forall {A12:add Q1 Q2 Q} {A34:add Q3 Q4 Q} exists {Q13} {Q14} {Q23} {Q24} {A1:add Q13 Q14 Q1} {A2:add Q23 Q24 Q2} {A3:add Q13 Q23 Q3} {A4:add Q14 Q24 Q4} true. - : add-cross-comparable Q1+Q2=Q Q3+Q4=Q Q1Q3/Q Q1Q4/Q Q2Q3/Q Q2Q4/Q Q1Q3/Q+Q1Q4/Q=Q1 Q2Q3/Q+Q2Q4/Q=Q2 Q1Q3/Q+Q2Q3/Q=Q3 Q1Q4/Q+Q2Q4/Q=Q4 <- mul-total Q*Q3=QQ3 <- mul-right-distributes-over-add Q1+Q2=Q Q*Q3=QQ3 Q1Q3 Q2Q3 Q1*Q3=Q1Q3 Q2*Q3=Q2Q3 Q1Q3+Q2Q3=QQ3 <- mul-commutative Q*Q3=QQ3 QQ3/Q=Q3 <- div-right-distributes-over-add Q1Q3+Q2Q3=QQ3 QQ3/Q=Q3 Q1Q3/Q Q2Q3/Q Q1Q3/Q=Q1Q3/Q Q2Q3/Q=Q2Q3/Q Q1Q3/Q+Q2Q3/Q=Q3 <- mul-total Q*Q4=QQ4 <- mul-right-distributes-over-add Q1+Q2=Q Q*Q4=QQ4 Q1Q4 Q2Q4 Q1*Q4=Q1Q4 Q2*Q4=Q2Q4 Q1Q4+Q2Q4=QQ4 <- mul-commutative Q*Q4=QQ4 QQ4/Q=Q4 <- div-right-distributes-over-add Q1Q4+Q2Q4=QQ4 QQ4/Q=Q4 Q1Q4/Q Q2Q4/Q Q1Q4/Q=Q1Q4/Q Q2Q4/Q=Q2Q4/Q Q1Q4/Q+Q2Q4/Q=Q4 <- mul-total Q1*Q=Q1Q % the same as Q1Q/Q=Q1 <- mul-left-distributes-over-add* Q3+Q4=Q Q1*Q=Q1Q Q1*Q3=Q1Q3 Q1*Q4=Q1Q4 Q1Q3+Q1Q4=Q1Q <- div-right-distributes-over-add* Q1Q3+Q1Q4=Q1Q Q1*Q=Q1Q Q1Q3/Q=Q1Q3/Q Q1Q4/Q=Q1Q4/Q Q1Q3/Q+Q1Q4/Q=Q1 <- mul-total Q2*Q=Q2Q % the same as Q2Q/Q=Q2 <- mul-left-distributes-over-add* Q3+Q4=Q Q2*Q=Q2Q Q2*Q3=Q2Q3 Q2*Q4=Q2Q4 Q2Q3+Q2Q4=Q2Q <- div-right-distributes-over-add* Q2Q3+Q2Q4=Q2Q Q2*Q=Q2Q Q2Q3/Q=Q2Q3/Q Q2Q4/Q=Q2Q4/Q Q2Q3/Q+Q2Q4/Q=Q2. %worlds () (add-cross-comparable _ _ _ _ _ _ _ _ _ _). %total { } (add-cross-comparable _ _ _ _ _ _ _ _ _ _). %%%%% rat-comp.elf %%%%% Composed relations for rational numbers %%%%% This file is part of the rat.elf signature %{% We define derived relations for greater-than-or-equal "gre" and not-equal "neq". The theorems here never need to look into the representation of rationals. %}% %%%% Definitions gre : rat -> rat -> type. gre/= : gre X Y <- equ X Y. gre/> : gre X Y <- grt X Y. %%%% Theorems %%% Theorems about gre %theorem false-implies-gre : forall* {X1} {X2} forall {F:void} exists {G:gre X1 X2} true. %worlds () (false-implies-gre _ _). %total { } (false-implies-gre _ _). %theorem gre-respects-equ : forall* {X1} {X2} {Y1} {Y2} forall {D1:gre X1 X2} {E1:equ X1 Y1} {E2:equ X2 Y2} exists {D2:gre Y1 Y2} true. - : gre-respects-equ X1>=X2 equ/ equ/ X1>=X2. %worlds () (gre-respects-equ _ _ _ _). %total { } (gre-respects-equ _ _ _ _). %theorem gre-reflexive : forall {X} exists {G:gre X X} true. - : gre-reflexive _ (gre/= equ/). %worlds () (gre-reflexive X %{=>}% X>=X). %total {} (gre-reflexive _ _). %theorem gre-transitive: forall* {X1} {X2} {X3} forall {G1:gre X1 X2} {G2:gre X2 X3} exists {G3:gre X1 X3} true. - : gre-transitive (gre/= equ/) (gre/= equ/) (gre/= equ/). - : gre-transitive (gre/= equ/) (gre/> X>X3) (gre/> X>X3). - : gre-transitive (gre/> X1>X) (gre/= equ/) (gre/> X1>X). - : gre-transitive (gre/> X1>X2) (gre/> X2>X3) (gre/> X1>X3) <- grt-transitive X1>X2 X2>X3 X1>X3. %worlds () (gre-transitive X1>=X2 X2>=X3 %{=>}% X1>=X3). %total {} (gre-transitive _ _ _). %theorem gre-anti-symmetric : forall* {X1} {X2} forall {G1:gre X1 X2} {G2:gre X2 X1} exists {E:equ X1 X2} true. - : gre-anti-symmetric (gre/= equ/) _ equ/. - : gre-anti-symmetric _ (gre/= equ/) equ/. - : gre-anti-symmetric (gre/> X1>X2) (gre/> X2>X1) X1=X2 <- grt-anti-symmetric X1>X2 X2>X1 F <- false-implies-equ F X1=X2. %worlds () (gre-anti-symmetric X1>=X2 X2>=X1 %{=>}% X1=X2). %total {} (gre-anti-symmetric _ _ _). %theorem gre-transitive-grt: forall* {X1} {X2} {X3} forall {G1:gre X1 X2} {G2:grt X2 X3} exists {G3:grt X1 X3} true. - : gre-transitive-grt (gre/= equ/) X>X3 X>X3. - : gre-transitive-grt (gre/> X1>X2) X2>X3 X1>X3 <- grt-transitive X1>X2 X2>X3 X1>X3. %worlds () (gre-transitive-grt X1>=X2 X2>X3 %{=>}% X1>X3). %total {} (gre-transitive-grt _ _ _). %theorem grt-transitive-gre: forall* {X1} {X2} {X3} forall {G1:grt X1 X2} {G2:gre X2 X3} exists {G3:grt X1 X3} true. - : grt-transitive-gre X1>X2 (gre/= equ/) X1>X2. - : grt-transitive-gre X1>X2 (gre/> X2>X3) X1>X3 <- grt-transitive X1>X2 X2>X3 X1>X3. %worlds () (grt-transitive-gre X1>X2 X2>=X3 %{=>}% X1>X3). %total {} (grt-transitive-gre _ _ _). %theorem add-implies-gre : forall* {X1} {X2} {X3} forall {OP1:add X1 X2 X3} exists {G1:gre X3 X1} {G2:gre X3 X2} true. - : add-implies-gre X1+X2=X3 (gre/> X3>X1) (gre/> X3>X2) <- add-implies-grt X1+X2=X3 X3>X1 X3>X2. %worlds () (add-implies-gre X1+X2=X3 X3>=X1 X3>=X2). %total {} (add-implies-gre _ _ _). %abbrev add-implies-gre* = [A:add X1 X2 X3] [G1:gre X3 X1] add-implies-gre A G1 (G2:gre X3 X2). %theorem add-left-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X2 X4} {OP1:add X1 X2 X3} {OP2:add X1 X4 X5} exists {G2:gre X3 X5} true. - : add-left-preserves-gre* (gre/= equ/) X1+X2=X3 X1+X2=X5 (gre/= X3=X5) <- add-deterministic X1+X2=X3 X1+X2=X5 equ/ equ/ X3=X5. - : add-left-preserves-gre* (gre/> X2>X4) X1+X2=X3 X1+X4=X5 (gre/> X3>X5) <- add-left-preserves-grt* X2>X4 X1+X2=X3 X1+X4=X5 X3>X5. %worlds () (add-left-preserves-gre* X2>=X4 X1+X2=X3 X1+X4=X5 %{=>}% X3>=X5). %total {} (add-left-preserves-gre* _ _ _ _). %theorem add-left-cancels-gre : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:add X1 X2 X3} {OP2:add Y1 Y2 Y3} {E1:equ X1 Y1} {G3:gre X3 Y3} exists {G2:gre X2 Y2} true. - : add-left-cancels-gre X1+X2=X3 X1+Y2=X3 equ/ (gre/= equ/) (gre/= X2=Y2) <- add-left-cancels X1+X2=X3 X1+Y2=X3 equ/ equ/ X2=Y2. - : add-left-cancels-gre X1+X2=X3 X1+Y2=Y3 equ/ (gre/> X3>Y3) (gre/> X2>Y2) <- add-left-cancels-grt X1+X2=X3 X1+Y2=Y3 equ/ X3>Y3 X2>Y2. %worlds () (add-left-cancels-gre X1+X2=X3 Y1+Y2=Y3 X1=Y1 X3>=Y3 %{=>}% X2>=Y2). %total {} (add-left-cancels-gre _ _ _ _ _). %theorem add-left-preserves-gre : forall* {X1} {X2} {X4} forall {G:gre X2 X4} exists {X3} {X5} {O1:add X1 X2 X3} {O2:add X1 X4 X5} {G2:gre X3 X5} true. - : add-left-preserves-gre X2>=X4 X3 X5 X1+X2=A3 X1+X4=X5 X3>=X5 <- add-total X1+X2=A3 <- add-total X1+X4=X5 <- add-left-preserves-gre* X2>=X4 X1+X2=A3 X1+X4=X5 X3>=X5. %worlds () (add-left-preserves-gre X2>=X4 %{=>}% X3 X5 X1+X2=A3 X1+X4=X5 X3>=X5). %total {} (add-left-preserves-gre _ _ _ _ _ _). %theorem add-right-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:gre X1 X2} {O1:add X1 X3 X4} {O2:add X2 X3 X5} exists {G2:gre X4 X5} true. - : add-right-preserves-gre* X1>=X2 X1+X3=X4 X2+X3=X5 X4>=X5 <- add-commutative X1+X3=X4 X3+X1=X4 <- add-commutative X2+X3=X5 X3+X2=X5 <- add-left-preserves-gre* X1>=X2 X3+X1=X4 X3+X2=X5 X4>=X5. %worlds () (add-right-preserves-gre* X1>=X2 X1+X3=X4 X2+X3=X5 %{=>}% X4>=X5). %total {} (add-right-preserves-gre* _ _ _ _). %theorem add-right-preserves-gre : forall* {X1} {X2} {X3} forall {G1:gre X1 X2} exists {X4} {X5} {O1:add X1 X3 X4} {O2:add X2 X3 X5} {G2:gre X4 X5} true. - : add-right-preserves-gre X1>=X2 X4 X5 X1+X3=X4 X2+X3=X5 X4>=X5 <- add-total X1+X3=X4 <- add-total X2+X3=X5 <- add-right-preserves-gre* X1>=X2 X1+X3=X4 X2+X3=X5 X4>=X5. %worlds () (add-right-preserves-gre X1>=X2 %{=>}% X4 X5 X1+X3=X4 X2+X3=X5 X4>=X5). %total {} (add-right-preserves-gre _ _ _ _ _ _). %theorem add-preserves-gre* : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {G1:gre X1 Y1} {G2:gre X2 Y2} {MX:add X1 X2 X3} {MY:add Y1 Y2 Y3} exists {G3:gre X3 Y3} true. - : add-preserves-gre* X1>=Y1 X2>=Y2 X1+X2=X3 Y1+Y2=Y3 X3>=Y3 <- add-total Y1+X2=X <- add-right-preserves-gre* X1>=Y1 X1+X2=X3 Y1+X2=X X3>=X <- add-left-preserves-gre* X2>=Y2 Y1+X2=X Y1+Y2=Y3 X>=Y3 <- gre-transitive X3>=X X>=Y3 X3>=Y3. %worlds () (add-preserves-gre* X1>=Y1 X2>=Y2 X1+X2=X3 Y1+Y2=Y3 %{=>}% X3>=Y3). %total {} (add-preserves-gre* _ _ _ _ _). %theorem add-preserves-gre : forall* {X1} {X2} {Y1} {Y2} forall {G1:gre X1 Y1} {G2:gre X2 Y2} exists {X3} {Y3} {MX:add X1 X2 X3} {MY:add Y1 Y2 Y3} {G3:gre X3 Y3} true. - : add-preserves-gre X1>=Y1 X2>=Y2 X3 Y3 X1+X2=X3 Y1+Y2=Y3 X3>=Y3 <- add-total X1+X2=X3 <- add-total Y1+Y2=Y3 <- add-preserves-gre* X1>=Y1 X2>=Y2 X1+X2=X3 Y1+Y2=Y3 X3>=Y3. %worlds () (add-preserves-gre X1>=Y1 X2>=Y2 %{=>}% X3 Y3 X1+X2=X3 Y1+Y2=Y3 X3>=Y3). %total {} (add-preserves-gre _ _ _ _ _ _ _). %theorem add-right-cancels-gre : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:add X1 X2 X3} {OP2:add Y1 Y2 Y3} {E2:equ X2 Y2} {G3:gre X3 Y3} exists {G1:gre X1 Y1} true. - : add-right-cancels-gre X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3>=Y3 X1>=Y1 <- add-commutative X1+X2=X3 X2+X1=X3 <- add-commutative Y1+Y2=Y3 Y2+Y1=Y3 <- add-left-cancels-gre X2+X1=X3 Y2+Y1=Y3 X2=Y2 X3>=Y3 X1>=Y1. %worlds () (add-right-cancels-gre X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3>=Y3 %{=>}% X1>=Y1). %total {} (add-right-cancels-gre _ _ _ _ _). %theorem mul-left-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X2 X4} {OP1:mul X1 X2 X3} {OP2:mul X1 X4 X5} exists {G2:gre X3 X5} true. - : mul-left-preserves-gre* (gre/= equ/) X1*X2=X3 X1*X2=X5 (gre/= X3=X5) <- mul-deterministic X1*X2=X3 X1*X2=X5 equ/ equ/ X3=X5. - : mul-left-preserves-gre* (gre/> X2>X4) X1*X2=X3 X1*X4=X5 (gre/> X3>X5) <- mul-left-preserves-grt* X2>X4 X1*X2=X3 X1*X4=X5 X3>X5. %worlds () (mul-left-preserves-gre* X2>=X4 X1*X2=X3 X1*X4=X5 %{=>}% X3>=X5). %total {} (mul-left-preserves-gre* _ _ _ _). %theorem mul-left-cancels-gre : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E1:equ X1 Y1} {G3:gre X3 Y3} exists {G2:gre X2 Y2} true. - : mul-left-cancels-gre X1*X2=X3 X1*Y2=X3 equ/ (gre/= equ/) (gre/= X2=Y2) <- mul-left-cancels X1*X2=X3 X1*Y2=X3 equ/ equ/ X2=Y2. - : mul-left-cancels-gre X1*X2=X3 X1*Y2=Y3 equ/ (gre/> X3>Y3) (gre/> X2>Y2) <- mul-left-cancels-grt X1*X2=X3 X1*Y2=Y3 equ/ X3>Y3 X2>Y2. %worlds () (mul-left-cancels-gre X1*X2=X3 Y1*Y2=Y3 X1=Y1 X3>=Y3 %{=>}% X2>=Y2). %total {} (mul-left-cancels-gre _ _ _ _ _). %theorem mul-left-preserves-gre : forall* {X1} {X2} {X4} forall {G:gre X2 X4} exists {X3} {X5} {O1:mul X1 X2 X3} {O2:mul X1 X4 X5} {G2:gre X3 X5} true. - : mul-left-preserves-gre X2>=X4 X3 X5 X1*X2=A3 X1*X4=X5 X3>=X5 <- mul-total X1*X2=A3 <- mul-total X1*X4=X5 <- mul-left-preserves-gre* X2>=X4 X1*X2=A3 X1*X4=X5 X3>=X5. %worlds () (mul-left-preserves-gre X2>=X4 %{=>}% X3 X5 X1*X2=A3 X1*X4=X5 X3>=X5). %total {} (mul-left-preserves-gre _ _ _ _ _ _). %theorem mul-right-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:gre X1 X2} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} exists {G2:gre X4 X5} true. - : mul-right-preserves-gre* X1>=X2 X1*X3=X4 X2*X3=X5 X4>=X5 <- mul-commutative X1*X3=X4 X3*X1=X4 <- mul-commutative X2*X3=X5 X3*X2=X5 <- mul-left-preserves-gre* X1>=X2 X3*X1=X4 X3*X2=X5 X4>=X5. %worlds () (mul-right-preserves-gre* X1>=X2 X1*X3=X4 X2*X3=X5 %{=>}% X4>=X5). %total {} (mul-right-preserves-gre* _ _ _ _). %theorem mul-right-preserves-gre : forall* {X1} {X2} {X3} forall {G1:gre X1 X2} exists {X4} {X5} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} {G2:gre X4 X5} true. - : mul-right-preserves-gre X1>=X2 X4 X5 X1*X3=X4 X2*X3=X5 X4>=X5 <- mul-total X1*X3=X4 <- mul-total X2*X3=X5 <- mul-right-preserves-gre* X1>=X2 X1*X3=X4 X2*X3=X5 X4>=X5. %worlds () (mul-right-preserves-gre X1>=X2 %{=>}% X4 X5 X1*X3=X4 X2*X3=X5 X4>=X5). %total {} (mul-right-preserves-gre _ _ _ _ _ _). %theorem mul-preserves-gre* : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {G1:gre X1 Y1} {G2:gre X2 Y2} {MX:mul X1 X2 X3} {MY:mul Y1 Y2 Y3} exists {G3:gre X3 Y3} true. - : mul-preserves-gre* X1>=Y1 X2>=Y2 X1*X2=X3 Y1*Y2=Y3 X3>=Y3 <- mul-total Y1*X2=X <- mul-right-preserves-gre* X1>=Y1 X1*X2=X3 Y1*X2=X X3>=X <- mul-left-preserves-gre* X2>=Y2 Y1*X2=X Y1*Y2=Y3 X>=Y3 <- gre-transitive X3>=X X>=Y3 X3>=Y3. %worlds () (mul-preserves-gre* X1>=Y1 X2>=Y2 X1*X2=X3 Y1*Y2=Y3 %{=>}% X3>=Y3). %total {} (mul-preserves-gre* _ _ _ _ _). %theorem mul-preserves-gre : forall* {X1} {X2} {Y1} {Y2} forall {G1:gre X1 Y1} {G2:gre X2 Y2} exists {X3} {Y3} {MX:mul X1 X2 X3} {MY:mul Y1 Y2 Y3} {G3:gre X3 Y3} true. - : mul-preserves-gre X1>=Y1 X2>=Y2 X3 Y3 X1*X2=X3 Y1*Y2=Y3 X3>=Y3 <- mul-total X1*X2=X3 <- mul-total Y1*Y2=Y3 <- mul-preserves-gre* X1>=Y1 X2>=Y2 X1*X2=X3 Y1*Y2=Y3 X3>=Y3. %worlds () (mul-preserves-gre X1>=Y1 X2>=Y2 %{=>}% X3 Y3 X1*X2=X3 Y1*Y2=Y3 X3>=Y3). %total {} (mul-preserves-gre _ _ _ _ _ _ _). %theorem mul-right-cancels-gre : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E2:equ X2 Y2} {G3:gre X3 Y3} exists {G1:gre X1 Y1} true. - : mul-right-cancels-gre X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3>=Y3 X1>=Y1 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative Y1*Y2=Y3 Y2*Y1=Y3 <- mul-left-cancels-gre X2*X1=X3 Y2*Y1=Y3 X2=Y2 X3>=Y3 X1>=Y1. %worlds () (mul-right-cancels-gre X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3>=Y3 %{=>}% X1>=Y1). %total {} (mul-right-cancels-gre _ _ _ _ _). %%%% Definitions neq : rat -> rat -> type. neq/< : neq X Y <- grt Y X. neq/> : neq X Y <- grt X Y. equ? : rat -> rat -> bool -> type. equ?/yes : equ? X X true. equ?/no : equ? X Y false <- neq X Y. %%%% Theorems %%% Theorems about neq %theorem false-implies-neq : forall* {X1} {X2} forall {F:void} exists {G:neq X1 X2} true. %worlds () (false-implies-neq _ _). %total { } (false-implies-neq _ _). %theorem neq-respects-equ : forall* {X1} {X2} {Y1} {Y2} forall {D1:neq X1 X2} {E1:equ X1 Y1} {E2:equ X2 Y2} exists {D2:neq Y1 Y2} true. - : neq-respects-equ X1<>X2 equ/ equ/ X1<>X2. %worlds () (neq-respects-equ _ _ _ _). %total { } (neq-respects-equ _ _ _ _). %theorem neq-anti-reflexive : forall* {X} forall {R:neq X X} exists {F:void} true. - : neq-anti-reflexive (neq/< X X>X) F <- grt-anti-reflexive X>X F. %worlds () (neq-anti-reflexive X<>X %{=>}% _). %total {} (neq-anti-reflexive _ _). %theorem neq-symmetric : forall* {X} {Y} forall {R1:neq X Y} exists {R2:neq Y X} true. - : neq-symmetric (neq/< X X X>Y) (neq/< X>Y). %worlds () (neq-symmetric X<>Y %{=>}% Y<>X). %total {} (neq-symmetric _ _). %theorem equ-neq-implies-false : forall* {X} {Y} forall {D1:equ X Y} {D2:neq X Y} exists {F:void} true. - : equ-neq-implies-false equ/ X<>X F <- neq-anti-reflexive X<>X F. %worlds () (equ-neq-implies-false X=Y X<>Y %{=>}% _). %total {} (equ-neq-implies-false _ _ _). %theorem gre-neq-implies-grt : forall* {X} {Y} forall {D1:gre X Y} {D2:neq X Y} exists {D3:grt X Y} true. - : gre-neq-implies-grt (gre/> X>Y) _ X>Y. - : gre-neq-implies-grt (gre/= equ/) X<>X X>X <- neq-anti-reflexive X<>X F <- false-implies-grt F X>X. %worlds () (gre-neq-implies-grt X>=Y X<>Y %{=>}% X>Y). %total {} (gre-neq-implies-grt _ _ _). %theorem equ?-total* : forall {M} {N} exists {B} {T:equ? M N B} true. %theorem equ?-total*/L : forall* {M} {N} {C} forall {CMP:cmp M N C} exists {B} {T:equ? M N B} true. - : equ?-total*/L cmp/= true equ?/yes. - : equ?-total*/L (cmp/< X X>Y) false (equ?/no (neq/> X>Y)). %worlds () (equ?-total*/L _ _ _). %total { } (equ?-total*/L _ _ _). - : equ?-total* M N B T <- cmp-total CMP <- equ?-total*/L CMP B T. %worlds () (equ?-total* _ _ _ _). %total { } (equ?-total* _ _ _ _). %abbrev equ?-total = equ?-total* _ _ _. %theorem add-left-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:neq X2 X4} {OP1:add X1 X2 X3} {OP2:add X1 X4 X5} exists {G2:neq X3 X5} true. - : add-left-preserves-neq* (neq/< X4>X2) X1+X2=X3 X1+X4=X5 (neq/< X5>X3) <- add-left-preserves-grt* X4>X2 X1+X4=X5 X1+X2=X3 X5>X3. - : add-left-preserves-neq* (neq/> X2>X4) X1+X2=X3 X1+X4=X5 (neq/> X3>X5) <- add-left-preserves-grt* X2>X4 X1+X2=X3 X1+X4=X5 X3>X5. %worlds () (add-left-preserves-neq* X2<>X4 X1+X2=X3 X1+X4=X5 %{=>}% X3<>X5). %total {} (add-left-preserves-neq* _ _ _ _). %theorem add-left-cancels-neq : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:add X1 X2 X3} {OP2:add Y1 Y2 Y3} {E1:equ X1 Y1} {G3:neq X3 Y3} exists {G2:neq X2 Y2} true. - : add-left-cancels-neq X1+X2=X3 X1+Y2=Y3 equ/ (neq/< Y3>X3) (neq/< Y2>X2) <- add-left-cancels-grt X1+Y2=Y3 X1+X2=X3 equ/ Y3>X3 Y2>X2. - : add-left-cancels-neq X1+X2=X3 X1+Y2=Y3 equ/ (neq/> X3>Y3) (neq/> X2>Y2) <- add-left-cancels-grt X1+X2=X3 X1+Y2=Y3 equ/ X3>Y3 X2>Y2. %worlds () (add-left-cancels-neq X1+X2=X3 Y1+Y2=Y3 X1=Y1 X3<>Y3 %{=>}% X2<>Y2). %total {} (add-left-cancels-neq _ _ _ _ _). %theorem add-left-preserves-neq : forall* {X1} {X2} {X4} forall {G:neq X2 X4} exists {X3} {X5} {O1:add X1 X2 X3} {O2:add X1 X4 X5} {G2:neq X3 X5} true. - : add-left-preserves-neq X2<>X4 X3 X5 X1+X2=A3 X1+X4=X5 X3<>X5 <- add-total X1+X2=A3 <- add-total X1+X4=X5 <- add-left-preserves-neq* X2<>X4 X1+X2=A3 X1+X4=X5 X3<>X5. %worlds () (add-left-preserves-neq X2<>X4 %{=>}% X3 X5 X1+X2=A3 X1+X4=X5 X3<>X5). %total {} (add-left-preserves-neq _ _ _ _ _ _). %theorem add-right-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:neq X1 X2} {O1:add X1 X3 X4} {O2:add X2 X3 X5} exists {G2:neq X4 X5} true. - : add-right-preserves-neq* X1<>X2 X1+X3=X4 X2+X3=X5 X4<>X5 <- add-commutative X1+X3=X4 X3+X1=X4 <- add-commutative X2+X3=X5 X3+X2=X5 <- add-left-preserves-neq* X1<>X2 X3+X1=X4 X3+X2=X5 X4<>X5. %worlds () (add-right-preserves-neq* X1<>X2 X1+X3=X4 X2+X3=X5 %{=>}% X4<>X5). %total {} (add-right-preserves-neq* _ _ _ _). %theorem add-right-preserves-neq : forall* {X1} {X2} {X3} forall {G1:neq X1 X2} exists {X4} {X5} {O1:add X1 X3 X4} {O2:add X2 X3 X5} {G2:neq X4 X5} true. - : add-right-preserves-neq X1<>X2 X4 X5 X1+X3=X4 X2+X3=X5 X4<>X5 <- add-total X1+X3=X4 <- add-total X2+X3=X5 <- add-right-preserves-neq* X1<>X2 X1+X3=X4 X2+X3=X5 X4<>X5. %worlds () (add-right-preserves-neq X1<>X2 %{=>}% X4 X5 X1+X3=X4 X2+X3=X5 X4<>X5). %total {} (add-right-preserves-neq _ _ _ _ _ _). %theorem add-right-cancels-neq : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:add X1 X2 X3} {OP2:add Y1 Y2 Y3} {E2:equ X2 Y2} {G3:neq X3 Y3} exists {G1:neq X1 Y1} true. - : add-right-cancels-neq X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3<>Y3 X1<>Y1 <- add-commutative X1+X2=X3 X2+X1=X3 <- add-commutative Y1+Y2=Y3 Y2+Y1=Y3 <- add-left-cancels-neq X2+X1=X3 Y2+Y1=Y3 X2=Y2 X3<>Y3 X1<>Y1. %worlds () (add-right-cancels-neq X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3<>Y3 %{=>}% X1<>Y1). %total {} (add-right-cancels-neq _ _ _ _ _). %theorem mul-left-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:neq X2 X4} {OP1:mul X1 X2 X3} {OP2:mul X1 X4 X5} exists {G2:neq X3 X5} true. - : mul-left-preserves-neq* (neq/< X4>X2) X1*X2=X3 X1*X4=X5 (neq/< X5>X3) <- mul-left-preserves-grt* X4>X2 X1*X4=X5 X1*X2=X3 X5>X3. - : mul-left-preserves-neq* (neq/> X2>X4) X1*X2=X3 X1*X4=X5 (neq/> X3>X5) <- mul-left-preserves-grt* X2>X4 X1*X2=X3 X1*X4=X5 X3>X5. %worlds () (mul-left-preserves-neq* X2<>X4 X1*X2=X3 X1*X4=X5 %{=>}% X3<>X5). %total {} (mul-left-preserves-neq* _ _ _ _). %theorem mul-left-cancels-neq : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E1:equ X1 Y1} {G3:neq X3 Y3} exists {G2:neq X2 Y2} true. - : mul-left-cancels-neq X1*X2=X3 X1*Y2=Y3 equ/ (neq/< Y3>X3) (neq/< Y2>X2) <- mul-left-cancels-grt X1*Y2=Y3 X1*X2=X3 equ/ Y3>X3 Y2>X2. - : mul-left-cancels-neq X1*X2=X3 X1*Y2=Y3 equ/ (neq/> X3>Y3) (neq/> X2>Y2) <- mul-left-cancels-grt X1*X2=X3 X1*Y2=Y3 equ/ X3>Y3 X2>Y2. %worlds () (mul-left-cancels-neq X1*X2=X3 Y1*Y2=Y3 X1=Y1 X3<>Y3 %{=>}% X2<>Y2). %total {} (mul-left-cancels-neq _ _ _ _ _). %theorem mul-left-preserves-neq : forall* {X1} {X2} {X4} forall {G:neq X2 X4} exists {X3} {X5} {O1:mul X1 X2 X3} {O2:mul X1 X4 X5} {G2:neq X3 X5} true. - : mul-left-preserves-neq X2<>X4 X3 X5 X1*X2=A3 X1*X4=X5 X3<>X5 <- mul-total X1*X2=A3 <- mul-total X1*X4=X5 <- mul-left-preserves-neq* X2<>X4 X1*X2=A3 X1*X4=X5 X3<>X5. %worlds () (mul-left-preserves-neq X2<>X4 %{=>}% X3 X5 X1*X2=A3 X1*X4=X5 X3<>X5). %total {} (mul-left-preserves-neq _ _ _ _ _ _). %theorem mul-right-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:neq X1 X2} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} exists {G2:neq X4 X5} true. - : mul-right-preserves-neq* X1<>X2 X1*X3=X4 X2*X3=X5 X4<>X5 <- mul-commutative X1*X3=X4 X3*X1=X4 <- mul-commutative X2*X3=X5 X3*X2=X5 <- mul-left-preserves-neq* X1<>X2 X3*X1=X4 X3*X2=X5 X4<>X5. %worlds () (mul-right-preserves-neq* X1<>X2 X1*X3=X4 X2*X3=X5 %{=>}% X4<>X5). %total {} (mul-right-preserves-neq* _ _ _ _). %theorem mul-right-preserves-neq : forall* {X1} {X2} {X3} forall {G1:neq X1 X2} exists {X4} {X5} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} {G2:neq X4 X5} true. - : mul-right-preserves-neq X1<>X2 X4 X5 X1*X3=X4 X2*X3=X5 X4<>X5 <- mul-total X1*X3=X4 <- mul-total X2*X3=X5 <- mul-right-preserves-neq* X1<>X2 X1*X3=X4 X2*X3=X5 X4<>X5. %worlds () (mul-right-preserves-neq X1<>X2 %{=>}% X4 X5 X1*X3=X4 X2*X3=X5 X4<>X5). %total {} (mul-right-preserves-neq _ _ _ _ _ _). %theorem mul-right-cancels-neq : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E2:equ X2 Y2} {G3:neq X3 Y3} exists {G1:neq X1 Y1} true. - : mul-right-cancels-neq X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3<>Y3 X1<>Y1 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative Y1*Y2=Y3 Y2*Y1=Y3 <- mul-left-cancels-neq X2*X1=X3 Y2*Y1=Y3 X2=Y2 X3<>Y3 X1<>Y1. %worlds () (mul-right-cancels-neq X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3<>Y3 %{=>}% X1<>Y1). %total {} (mul-right-cancels-neq _ _ _ _ _). %%%%% rat-less.elf %%%%% Inverse relations for rational numbers %%%%% This file is part of the rat.elf signature %%%% Definitions %abbrev lst = [X] [Y] grt Y X. %%%% Theorems about lst %theorem false-implies-lst : forall* {X1} {X2} forall {F:void} exists {G:lst X1 X2} true. %worlds () (false-implies-lst _ _). %total { } (false-implies-lst _ _). %theorem lst-respects-equ : forall* {X1} {X2} {Y1} {Y2} forall {D1:lst X1 X2} {E1:equ X1 Y1} {E2:equ X2 Y2} exists {D2:lst Y1 Y2} true. - : lst-respects-equ X1X1 X1>X2 R <- grt-anti-symmetric X1>X2 X2>X1 R. %worlds () (lst-anti-symmetric _ _ _). %total {} (lst-anti-symmetric _ _ _). %theorem lst-transitive : forall* {X1} {X2} {X3} forall {G1:lst X1 X2} {G2:lst X2 X3} exists {G3:lst X1 X3} true. - : lst-transitive X1X2 X1+X2=X3 X1+X4=X5 X5>X3 <- add-left-preserves-grt* X4>X2 X1+X4=X5 X1+X2=X3 X5>X3. %worlds () (add-left-preserves-lst* X2}% X3X3 Y2>X2 <- add-left-cancels-grt X1+Y2=X3 X1+X2=X3 equ/ Y3>X3 Y2>X2. %worlds () (add-left-cancels-lst X1+X2=X3 Y1+Y2=Y3 X1=Y1 X3}% X2}% X3 X5 X1+X2=A3 X1+X4=X5 X3}% X4}% X4 X5 X1+X3=X4 X2+X3=X5 X4}% X3}% X3 Y3 X1+X2=X3 Y1+Y2=Y3 X3}% X1X2 X1*X2=X3 X1*X4=X5 X5>X3 <- mul-left-preserves-grt* X4>X2 X1*X4=X5 X1*X2=X3 X5>X3. %worlds () (mul-left-preserves-lst* X2}% X3X3 Y2>X2 <- mul-left-cancels-grt X1*Y2=X3 X1*X2=X3 equ/ Y3>X3 Y2>X2. %worlds () (mul-left-cancels-lst X1*X2=X3 Y1*Y2=Y3 X1=Y1 X3}% X2}% X3 X5 X1*X2=A3 X1*X4=X5 X3}% X4}% X4 X5 X1*X3=X4 X2*X3=X5 X4}% X3}% X3 Y3 X1*X2=X3 Y1*Y2=Y3 X3}% X1=X1 X1>=X2 R <- gre-anti-symmetric X1>=X2 X2>=X1 R. %worlds () (lse-anti-symmetric _ _ _). %total {} (lse-anti-symmetric _ _ _). %theorem lse-transitive : forall* {X1} {X2} {X3} forall {G1:lse X1 X2} {G2:lse X2 X3} exists {G3:lse X1 X3} true. - : lse-transitive X1<=X2 X2<=X3 X1<=X3 <- gre-transitive X2<=X3 X1<=X2 X1<=X3. %worlds () (lse-transitive X1<=X2 X2<=X3 X1<=X3). %total {} (lse-transitive _ _ _). %abbrev lse-reflexive = gre-reflexive. %theorem lse-transitive-lst: forall* {X1} {X2} {X3} forall {L1:lse X1 X2} {L2:lst X2 X3} exists {L3:lst X1 X3} true. - : lse-transitive-lst X2>=X1 X3>X2 X3>X1 <- grt-transitive-gre X3>X2 X2>=X1 X3>X1. %worlds () (lse-transitive-lst X1<=X2 X2}% X1X1 X3>=X2 X3>X1 <- gre-transitive-grt X3>=X2 X2>X1 X3>X1. %worlds () (lst-transitive-lse X1}% X1=X2 X1+X2=X3 X1+X4=X5 X5>=X3 <- add-left-preserves-gre* X4>=X2 X1+X4=X5 X1+X2=X3 X5>=X3. %worlds () (add-left-preserves-lse* X2<=X4 X1+X2=X3 X1+X4=X5 %{=>}% X3<=X5). %total {} (add-left-preserves-lse* _ _ _ _). %theorem add-left-cancels-lse : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:add X1 X2 X3} {OP2:add Y1 Y2 Y3} {E1:equ X1 Y1} {R3:lse X3 Y3} exists {R2:lse X2 Y2} true. - : add-left-cancels-lse X1+X2=X3 X1+Y2=X3 equ/ Y3>=X3 Y2>=X2 <- add-left-cancels-gre X1+Y2=X3 X1+X2=X3 equ/ Y3>=X3 Y2>=X2. %worlds () (add-left-cancels-lse X1+X2=X3 Y1+Y2=Y3 X1=Y1 X3<=Y3 %{=>}% X2<=Y2). %total {} (add-left-cancels-lse _ _ _ _ _). %theorem add-left-preserves-lse : forall* {X1} {X2} {X4} forall {G:lse X2 X4} exists {X3} {X5} {O1:add X1 X2 X3} {O2:add X1 X4 X5} {G2:lse X3 X5} true. - : add-left-preserves-lse X2<=X4 X3 X5 X1+X2=A3 X1+X4=X5 X3<=X5 <- add-total X1+X2=A3 <- add-total X1+X4=X5 <- add-left-preserves-lse* X2<=X4 X1+X2=A3 X1+X4=X5 X3<=X5. %worlds () (add-left-preserves-lse X2<=X4 %{=>}% X3 X5 X1+X2=A3 X1+X4=X5 X3<=X5). %total {} (add-left-preserves-lse _ _ _ _ _ _). %theorem add-right-preserves-lse* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:lse X1 X2} {O1:add X1 X3 X4} {O2:add X2 X3 X5} exists {G2:lse X4 X5} true. - : add-right-preserves-lse* X1<=X2 X1+X3=X4 X2+X3=X5 X4<=X5 <- add-commutative X1+X3=X4 X3+X1=X4 <- add-commutative X2+X3=X5 X3+X2=X5 <- add-left-preserves-lse* X1<=X2 X3+X1=X4 X3+X2=X5 X4<=X5. %worlds () (add-right-preserves-lse* X1<=X2 X1+X3=X4 X2+X3=X5 %{=>}% X4<=X5). %total {} (add-right-preserves-lse* _ _ _ _). %theorem add-right-preserves-lse : forall* {X1} {X2} {X3} forall {G1:lse X1 X2} exists {X4} {X5} {O1:add X1 X3 X4} {O2:add X2 X3 X5} {G2:lse X4 X5} true. - : add-right-preserves-lse X1<=X2 X4 X5 X1+X3=X4 X2+X3=X5 X4<=X5 <- add-total X1+X3=X4 <- add-total X2+X3=X5 <- add-right-preserves-lse* X1<=X2 X1+X3=X4 X2+X3=X5 X4<=X5. %worlds () (add-right-preserves-lse X1<=X2 %{=>}% X4 X5 X1+X3=X4 X2+X3=X5 X4<=X5). %total {} (add-right-preserves-lse _ _ _ _ _ _). %theorem add-preserves-lse* : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {G1:lse X1 Y1} {G2:lse X2 Y2} {MX:add X1 X2 X3} {MY:add Y1 Y2 Y3} exists {G3:lse X3 Y3} true. - : add-preserves-lse* X1<=Y1 X2<=Y2 X1+X2=X3 Y1+Y2=Y3 X3<=Y3 <- add-total Y1+X2=X <- add-right-preserves-lse* X1<=Y1 X1+X2=X3 Y1+X2=X X3<=X <- add-left-preserves-lse* X2<=Y2 Y1+X2=X Y1+Y2=Y3 X<=Y3 <- lse-transitive X3<=X X<=Y3 X3<=Y3. %worlds () (add-preserves-lse* X1<=Y1 X2<=Y2 X1+X2=X3 Y1+Y2=Y3 %{=>}% X3<=Y3). %total {} (add-preserves-lse* _ _ _ _ _). %theorem add-preserves-lse : forall* {X1} {X2} {Y1} {Y2} forall {G1:lse X1 Y1} {G2:lse X2 Y2} exists {X3} {Y3} {MX:add X1 X2 X3} {MY:add Y1 Y2 Y3} {G3:lse X3 Y3} true. - : add-preserves-lse X1<=Y1 X2<=Y2 X3 Y3 X1+X2=X3 Y1+Y2=Y3 X3<=Y3 <- add-total X1+X2=X3 <- add-total Y1+Y2=Y3 <- add-preserves-lse* X1<=Y1 X2<=Y2 X1+X2=X3 Y1+Y2=Y3 X3<=Y3. %worlds () (add-preserves-lse X1<=Y1 X2<=Y2 %{=>}% X3 Y3 X1+X2=X3 Y1+Y2=Y3 X3<=Y3). %total {} (add-preserves-lse _ _ _ _ _ _ _). %theorem add-right-cancels-lse : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:add X1 X2 X3} {OP2:add Y1 Y2 Y3} {E2:equ X2 Y2} {G3:lse X3 Y3} exists {G1:lse X1 Y1} true. - : add-right-cancels-lse X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3<=Y3 X1<=Y1 <- add-commutative X1+X2=X3 X2+X1=X3 <- add-commutative Y1+Y2=Y3 Y2+Y1=Y3 <- add-left-cancels-lse X2+X1=X3 Y2+Y1=Y3 X2=Y2 X3<=Y3 X1<=Y1. %worlds () (add-right-cancels-lse X1+X2=X3 Y1+Y2=Y3 X2=Y2 X3<=Y3 %{=>}% X1<=Y1). %total {} (add-right-cancels-lse _ _ _ _ _). %theorem mul-left-preserves-lse* : forall* {X1} {X2} {X3} {X4} {X5} forall {R1:lse X2 X4} {OP1:mul X1 X2 X3} {OP2:mul X1 X4 X5} exists {R2:lse X3 X5} true. - : mul-left-preserves-lse* X4>=X2 X1*X2=X3 X1*X4=X5 X5>=X3 <- mul-left-preserves-gre* X4>=X2 X1*X4=X5 X1*X2=X3 X5>=X3. %worlds () (mul-left-preserves-lse* X2<=X4 X1*X2=X3 X1*X4=X5 %{=>}% X3<=X5). %total {} (mul-left-preserves-lse* _ _ _ _). %theorem mul-left-cancels-lse : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E1:equ X1 Y1} {R3:lse X3 Y3} exists {R2:lse X2 Y2} true. - : mul-left-cancels-lse X1*X2=X3 X1*Y2=X3 equ/ Y3>=X3 Y2>=X2 <- mul-left-cancels-gre X1*Y2=X3 X1*X2=X3 equ/ Y3>=X3 Y2>=X2. %worlds () (mul-left-cancels-lse X1*X2=X3 Y1*Y2=Y3 X1=Y1 X3<=Y3 %{=>}% X2<=Y2). %total {} (mul-left-cancels-lse _ _ _ _ _). %theorem mul-left-preserves-lse : forall* {X1} {X2} {X4} forall {G:lse X2 X4} exists {X3} {X5} {O1:mul X1 X2 X3} {O2:mul X1 X4 X5} {G2:lse X3 X5} true. - : mul-left-preserves-lse X2<=X4 X3 X5 X1*X2=A3 X1*X4=X5 X3<=X5 <- mul-total X1*X2=A3 <- mul-total X1*X4=X5 <- mul-left-preserves-lse* X2<=X4 X1*X2=A3 X1*X4=X5 X3<=X5. %worlds () (mul-left-preserves-lse X2<=X4 %{=>}% X3 X5 X1*X2=A3 X1*X4=X5 X3<=X5). %total {} (mul-left-preserves-lse _ _ _ _ _ _). %theorem mul-right-preserves-lse* : forall* {X1} {X2} {X3} {X4} {X5} forall {G1:lse X1 X2} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} exists {G2:lse X4 X5} true. - : mul-right-preserves-lse* X1<=X2 X1*X3=X4 X2*X3=X5 X4<=X5 <- mul-commutative X1*X3=X4 X3*X1=X4 <- mul-commutative X2*X3=X5 X3*X2=X5 <- mul-left-preserves-lse* X1<=X2 X3*X1=X4 X3*X2=X5 X4<=X5. %worlds () (mul-right-preserves-lse* X1<=X2 X1*X3=X4 X2*X3=X5 %{=>}% X4<=X5). %total {} (mul-right-preserves-lse* _ _ _ _). %theorem mul-right-preserves-lse : forall* {X1} {X2} {X3} forall {G1:lse X1 X2} exists {X4} {X5} {O1:mul X1 X3 X4} {O2:mul X2 X3 X5} {G2:lse X4 X5} true. - : mul-right-preserves-lse X1<=X2 X4 X5 X1*X3=X4 X2*X3=X5 X4<=X5 <- mul-total X1*X3=X4 <- mul-total X2*X3=X5 <- mul-right-preserves-lse* X1<=X2 X1*X3=X4 X2*X3=X5 X4<=X5. %worlds () (mul-right-preserves-lse X1<=X2 %{=>}% X4 X5 X1*X3=X4 X2*X3=X5 X4<=X5). %total {} (mul-right-preserves-lse _ _ _ _ _ _). %theorem mul-preserves-lse* : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {G1:lse X1 Y1} {G2:lse X2 Y2} {MX:mul X1 X2 X3} {MY:mul Y1 Y2 Y3} exists {G3:lse X3 Y3} true. - : mul-preserves-lse* X1<=Y1 X2<=Y2 X1*X2=X3 Y1*Y2=Y3 X3<=Y3 <- mul-total Y1*X2=X <- mul-right-preserves-lse* X1<=Y1 X1*X2=X3 Y1*X2=X X3<=X <- mul-left-preserves-lse* X2<=Y2 Y1*X2=X Y1*Y2=Y3 X<=Y3 <- lse-transitive X3<=X X<=Y3 X3<=Y3. %worlds () (mul-preserves-lse* X1<=Y1 X2<=Y2 X1*X2=X3 Y1*Y2=Y3 %{=>}% X3<=Y3). %total {} (mul-preserves-lse* _ _ _ _ _). %theorem mul-preserves-lse : forall* {X1} {X2} {Y1} {Y2} forall {G1:lse X1 Y1} {G2:lse X2 Y2} exists {X3} {Y3} {MX:mul X1 X2 X3} {MY:mul Y1 Y2 Y3} {G3:lse X3 Y3} true. - : mul-preserves-lse X1<=Y1 X2<=Y2 X3 Y3 X1*X2=X3 Y1*Y2=Y3 X3<=Y3 <- mul-total X1*X2=X3 <- mul-total Y1*Y2=Y3 <- mul-preserves-lse* X1<=Y1 X2<=Y2 X1*X2=X3 Y1*Y2=Y3 X3<=Y3. %worlds () (mul-preserves-lse X1<=Y1 X2<=Y2 %{=>}% X3 Y3 X1*X2=X3 Y1*Y2=Y3 X3<=Y3). %total {} (mul-preserves-lse _ _ _ _ _ _ _). %theorem mul-right-cancels-lse : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E2:equ X2 Y2} {G3:lse X3 Y3} exists {G1:lse X1 Y1} true. - : mul-right-cancels-lse X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3<=Y3 X1<=Y1 <- mul-commutative X1*X2=X3 X2*X1=X3 <- mul-commutative Y1*Y2=Y3 Y2*Y1=Y3 <- mul-left-cancels-lse X2*X1=X3 Y2*Y1=Y3 X2=Y2 X3<=Y3 X1<=Y1. %worlds () (mul-right-cancels-lse X1*X2=X3 Y1*Y2=Y3 X2=Y2 X3<=Y3 %{=>}% X1<=Y1). %total {} (mul-right-cancels-lse _ _ _ _ _). %%%%% rat-inv-comp.elf %%%%% Theorems about inverted operations and composed relations %%%%% This file is part of the rat.elf signature %%%% Theorems %%% Theorems about sub %theorem sub-left-inverts-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X2 X4} {IOP1:sub X1 X2 X3} {IOP2:sub X1 X4 X5} exists {GP:gre X5 X3} true. - : sub-left-inverts-gre* X2>=X4 X3+X2=X1 X5+X4=X1 X5>=X3 <- add-total X3+X4=X7 <- add-left-preserves-gre* X2>=X4 X3+X2=X1 X3+X4=X7 X1>=X7 <- add-right-cancels-gre X5+X4=X1 X3+X4=X7 equ/ X1>=X7 X5>=X3. %worlds () (sub-left-inverts-gre* X2>=X4 X1-X2=X3 X1-X4=X5 %{=>}% X5>=X3). %total {} (sub-left-inverts-gre* _ _ _ _). %theorem sub-right-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X1 X2} {IOP1:sub X1 X3 X4} {IOP2:sub X2 X3 X5} exists {GP:gre X4 X5} true. - : sub-right-preserves-gre* X1>=X2 X4+X3=X1 X5+X3=X2 X4>=X5 <- add-right-cancels-gre X4+X3=X1 X5+X3=X2 equ/ X1>=X2 X4>=X5. %worlds () (sub-right-preserves-gre* X1>=X2 X1-X3=X4 X2-X3=X5 %{=>}% X4>=X5). %total {} (sub-right-preserves-gre* _ _ _ _). %theorem sub-left-cancels-inverts-gre : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E:equ X1 X4} {G:gre X3 X6} exists {GP:gre X5 X2} true. - : sub-left-cancels-inverts-gre X3+X2=X1 X6+X5=X4 X1=X4 X3>=X6 X5>=X2 <- add-total X6+X2=X7 <- add-right-preserves-gre* X3>=X6 X3+X2=X1 X6+X2=X7 X1>=X7 <- equ-symmetric X1=X4 X4=X1 <- add-respects-equ X6+X5=X4 equ/ equ/ X4=X1 X6+X5=X1 <- add-left-cancels-gre X6+X5=X1 X6+X2=X7 equ/ X1>=X7 X5>=X2. %worlds () (sub-left-cancels-inverts-gre X1-X2=X3 X4-X5=X6 X1=X4 X3>=X6 %{=>}% X5>=X2). %total {} (sub-left-cancels-inverts-gre _ _ _ _ _). %theorem sub-right-cancels-gre : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E2:equ X2 X5} {G3:gre X3 X6} exists {G1:gre X1 X4} true. - : sub-right-cancels-gre X3+X2=X1 X6+X5=X4 X2=X5 X3>=X6 X1>=X4 <- add-respects-equ X3+X2=X1 equ/ X2=X5 equ/ X3+X5=X1 <- add-right-preserves-gre* X3>=X6 X3+X5=X1 X6+X5=X4 X1>=X4. %worlds () (sub-right-cancels-gre X1-X2=X3 X4-X5=X6 X2=X5 X3>=X6 %{=>}% X1>=X4). %total {} (sub-right-cancels-gre _ _ _ _ _). %theorem sub-left-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:neq X2 X4} {IOP1:sub X1 X2 X3} {IOP2:sub X1 X4 X5} exists {GP:neq X3 X5} true. - : sub-left-preserves-neq* X2<>X4 X3+X2=X1 X5+X4=X1 X3<>X5 <- add-total X3+X4=X7 <- add-left-preserves-neq* X2<>X4 X3+X2=X1 X3+X4=X7 X1<>X7 <- add-right-cancels-neq X5+X4=X1 X3+X4=X7 equ/ X1<>X7 X5<>X3 <- neq-symmetric X5<>X3 X3<>X5. %worlds () (sub-left-preserves-neq* X2<>X4 X1-X2=X3 X1-X4=X5 %{=>}% X3<>X5). %total {} (sub-left-preserves-neq* _ _ _ _). %theorem sub-right-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:neq X1 X2} {IOP1:sub X1 X3 X4} {IOP2:sub X2 X3 X5} exists {GP:neq X4 X5} true. - : sub-right-preserves-neq* X1<>X2 X4+X3=X1 X5+X3=X2 X4<>X5 <- add-right-cancels-neq X4+X3=X1 X5+X3=X2 equ/ X1<>X2 X4<>X5. %worlds () (sub-right-preserves-neq* X1<>X2 X1-X3=X4 X2-X3=X5 %{=>}% X4<>X5). %total {} (sub-right-preserves-neq* _ _ _ _). %theorem sub-left-cancels-neq : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E:equ X1 X4} {G:neq X3 X6} exists {GP:neq X2 X5} true. - : sub-left-cancels-neq X3+X2=X1 X6+X5=X4 X1=X4 X3<>X6 X2<>X5 <- add-total X6+X2=X7 <- add-right-preserves-neq* X3<>X6 X3+X2=X1 X6+X2=X7 X1<>X7 <- equ-symmetric X1=X4 X4=X1 <- add-respects-equ X6+X5=X4 equ/ equ/ X4=X1 X6+X5=X1 <- add-left-cancels-neq X6+X5=X1 X6+X2=X7 equ/ X1<>X7 X5<>X2 <- neq-symmetric X5<>X2 X2<>X5. %worlds () (sub-left-cancels-neq X1-X2=X3 X4-X5=X6 X1=X4 X3<>X6 %{=>}% X2<>X5). %total {} (sub-left-cancels-neq _ _ _ _ _). %theorem sub-right-cancels-neq : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E2:equ X2 X5} {G3:neq X3 X6} exists {G1:neq X1 X4} true. - : sub-right-cancels-neq X3+X2=X1 X6+X5=X4 X2=X5 X3<>X6 X1<>X4 <- add-respects-equ X3+X2=X1 equ/ X2=X5 equ/ X3+X5=X1 <- add-right-preserves-neq* X3<>X6 X3+X5=X1 X6+X5=X4 X1<>X4. %worlds () (sub-right-cancels-neq X1-X2=X3 X4-X5=X6 X2=X5 X3<>X6 %{=>}% X1<>X4). %total {} (sub-right-cancels-neq _ _ _ _ _). %%% Theorems about div %theorem mul-left-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X2 X4} {OP1:mul X1 X2 X3} {OP2:mul X1 X4 X5} exists {G2:gre X3 X5} true. - : mul-left-preserves-gre* (gre/= equ/) X1*X2=X3 X1*X2=X5 (gre/= X3=X5) <- mul-deterministic X1*X2=X3 X1*X2=X5 equ/ equ/ X3=X5. - : mul-left-preserves-gre* (gre/> X2>X4) X1*X2=X3 X1*X4=X5 (gre/> X3>X5) <- mul-left-preserves-grt* X2>X4 X1*X2=X3 X1*X4=X5 X3>X5. %worlds () (mul-left-preserves-gre* X2>=X4 X1*X2=X3 X1*X4=X5 %{=>}% X3>=X5). %total {} (mul-left-preserves-gre* _ _ _ _). %theorem mul-left-cancels-gre : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E1:equ X1 Y1} {G3:gre X3 Y3} exists {G2:gre X2 Y2} true. - : mul-left-cancels-gre X1*X2=X3 X1*Y2=X3 equ/ (gre/= equ/) (gre/= X2=Y2) <- mul-left-cancels X1*X2=X3 X1*Y2=X3 equ/ equ/ X2=Y2. - : mul-left-cancels-gre X1*X2=X3 X1*Y2=Y3 equ/ (gre/> X3>Y3) (gre/> X2>Y2) <- mul-left-cancels-grt X1*X2=X3 X1*Y2=Y3 equ/ X3>Y3 X2>Y2. %worlds () (mul-left-cancels-gre X1*X2=X3 Y1*Y2=Y3 X1=Y1 X3>=Y3 %{=>}% X2>=Y2). %total {} (mul-left-cancels-gre _ _ _ _ _). %theorem div-left-inverts-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X2 X4} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} exists {GP:gre X5 X3} true. - : div-left-inverts-gre* X2>=X4 X3*X2=X1 X5*X4=X1 X5>=X3 <- mul-total X3*X4=X7 <- mul-left-preserves-gre* X2>=X4 X3*X2=X1 X3*X4=X7 X1>=X7 <- mul-right-cancels-gre X5*X4=X1 X3*X4=X7 equ/ X1>=X7 X5>=X3. %worlds () (div-left-inverts-gre* X2>=X4 X1/X2=X3 X1/X4=X5 %{=>}% X5>=X3). %total {} (div-left-inverts-gre* _ _ _ _). %theorem div-left-inverts-gre : forall* {X1} {X2} {X4} forall {G:gre X2 X4} exists {X3} {X5} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} {GP:gre X5 X3} true. - : div-left-inverts-gre X2>=X4 X3 X5 X1/X2=X3 X1/X4=X5 X5>=X3 <- div-total X1/X2=X3 <- div-total X1/X4=X5 <- div-left-inverts-gre* X2>=X4 X1/X2=X3 X1/X4=X5 X5>=X3. %worlds () (div-left-inverts-gre X2>=X4 %{=>}% X3 X5 X1/X2=X3 X1/X4=X5 X5>=X3). %total {} (div-left-inverts-gre _ _ _ _ _ _). %theorem div-right-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X1 X2} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} exists {GP:gre X4 X5} true. - : div-right-preserves-gre* X1>=X2 X4*X3=X1 X5*X3=X2 X4>=X5 <- mul-right-cancels-gre X4*X3=X1 X5*X3=X2 equ/ X1>=X2 X4>=X5. %worlds () (div-right-preserves-gre* X1>=X2 X1/X3=X4 X2/X3=X5 %{=>}% X4>=X5). %total {} (div-right-preserves-gre* _ _ _ _). %theorem div-right-preserves-gre : forall* {X1} {X2} {X3} forall {G:gre X1 X2} exists {X4} {X5} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} {GP:gre X4 X5} true. - : div-right-preserves-gre X1>=X2 X4 X5 X1/X3=X4 X2/X3=X5 X4>=X5 <- div-total X1/X3=X4 <- div-total X2/X3=X5 <- div-right-preserves-gre* X1>=X2 X1/X3=X4 X2/X3=X5 X4>=X5. %worlds () (div-right-preserves-gre X1>=X2 %{=>}% X4 X5 X1/X3=X4 X2/X3=X5 X4>=X5). %total {} (div-right-preserves-gre _ _ _ _ _ _). %theorem div-left-cancels-inverts-gre : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E:equ X1 X4} {G:gre X3 X6} exists {GP:gre X5 X2} true. - : div-left-cancels-inverts-gre X3*X2=X1 X6*X5=X4 X1=X4 X3>=X6 X5>=X2 <- mul-total X6*X2=X7 <- mul-right-preserves-gre* X3>=X6 X3*X2=X1 X6*X2=X7 X1>=X7 <- equ-symmetric X1=X4 X4=X1 <- mul-respects-equ X6*X5=X4 equ/ equ/ X4=X1 X6*X5=X1 <- mul-left-cancels-gre X6*X5=X1 X6*X2=X7 equ/ X1>=X7 X5>=X2. %worlds () (div-left-cancels-inverts-gre X1/X2=X3 X4/X5=X6 X1=X4 X3>=X6 %{=>}% X5>=X2). %total {} (div-left-cancels-inverts-gre _ _ _ _ _). %theorem div-right-cancels-gre : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E2:equ X2 X5} {G3:gre X3 X6} exists {G1:gre X1 X4} true. - : div-right-cancels-gre X3*X2=X1 X6*X5=X4 X2=X5 X3>=X6 X1>=X4 <- mul-respects-equ X3*X2=X1 equ/ X2=X5 equ/ X3*X5=X1 <- mul-right-preserves-gre* X3>=X6 X3*X5=X1 X6*X5=X4 X1>=X4. %worlds () (div-right-cancels-gre X1/X2=X3 X4/X5=X6 X2=X5 X3>=X6 %{=>}% X1>=X4). %total {} (div-right-cancels-gre _ _ _ _ _). %theorem div-left-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:neq X2 X4} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} exists {GP:neq X3 X5} true. - : div-left-preserves-neq* X2<>X4 X3*X2=X1 X5*X4=X1 X3<>X5 <- mul-total X3*X4=X7 <- mul-left-preserves-neq* X2<>X4 X3*X2=X1 X3*X4=X7 X1<>X7 <- mul-right-cancels-neq X5*X4=X1 X3*X4=X7 equ/ X1<>X7 X5<>X3 <- neq-symmetric X5<>X3 X3<>X5. %worlds () (div-left-preserves-neq* X2<>X4 X1/X2=X3 X1/X4=X5 %{=>}% X3<>X5). %total {} (div-left-preserves-neq* _ _ _ _). %theorem div-left-preserves-neq : forall* {X1} {X2} {X4} forall {G:neq X2 X4} exists {X3} {X5} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} {GP:neq X3 X5} true. - : div-left-preserves-neq X2<>X4 X3 X5 X1/X2=X3 X1/X4=X5 X3<>X5 <- div-total X1/X2=X3 <- div-total X1/X4=X5 <- div-left-preserves-neq* X2<>X4 X1/X2=X3 X1/X4=X5 X3<>X5. %worlds () (div-left-preserves-neq X2<>X4 %{=>}% X3 X5 X1/X2=X3 X1/X4=X5 X3<>X5). %total {} (div-left-preserves-neq _ _ _ _ _ _). %theorem div-right-preserves-neq* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:neq X1 X2} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} exists {GP:neq X4 X5} true. - : div-right-preserves-neq* X1<>X2 X4*X3=X1 X5*X3=X2 X4<>X5 <- mul-right-cancels-neq X4*X3=X1 X5*X3=X2 equ/ X1<>X2 X4<>X5. %worlds () (div-right-preserves-neq* X1<>X2 X1/X3=X4 X2/X3=X5 %{=>}% X4<>X5). %total {} (div-right-preserves-neq* _ _ _ _). %theorem div-right-preserves-neq : forall* {X1} {X2} {X3} forall {G:neq X1 X2} exists {X4} {X5} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} {GP:neq X4 X5} true. - : div-right-preserves-neq X1<>X2 X4 X5 X1/X3=X4 X2/X3=X5 X4<>X5 <- div-total X1/X3=X4 <- div-total X2/X3=X5 <- div-right-preserves-neq* X1<>X2 X1/X3=X4 X2/X3=X5 X4<>X5. %worlds () (div-right-preserves-neq X1<>X2 %{=>}% X4 X5 X1/X3=X4 X2/X3=X5 X4<>X5). %total {} (div-right-preserves-neq _ _ _ _ _ _). %theorem div-left-cancels-neq : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E:equ X1 X4} {G:neq X3 X6} exists {GP:neq X2 X5} true. - : div-left-cancels-neq X3*X2=X1 X6*X5=X4 X1=X4 X3<>X6 X2<>X5 <- mul-total X6*X2=X7 <- mul-right-preserves-neq* X3<>X6 X3*X2=X1 X6*X2=X7 X1<>X7 <- equ-symmetric X1=X4 X4=X1 <- mul-respects-equ X6*X5=X4 equ/ equ/ X4=X1 X6*X5=X1 <- mul-left-cancels-neq X6*X5=X1 X6*X2=X7 equ/ X1<>X7 X5<>X2 <- neq-symmetric X5<>X2 X2<>X5. %worlds () (div-left-cancels-neq X1/X2=X3 X4/X5=X6 X1=X4 X3<>X6 %{=>}% X2<>X5). %total {} (div-left-cancels-neq _ _ _ _ _). %theorem div-right-cancels-neq : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E2:equ X2 X5} {G3:neq X3 X6} exists {G1:neq X1 X4} true. - : div-right-cancels-neq X3*X2=X1 X6*X5=X4 X2=X5 X3<>X6 X1<>X4 <- mul-respects-equ X3*X2=X1 equ/ X2=X5 equ/ X3*X5=X1 <- mul-right-preserves-neq* X3<>X6 X3*X5=X1 X6*X5=X4 X1<>X4. %worlds () (div-right-cancels-neq X1/X2=X3 X4/X5=X6 X2=X5 X3<>X6 %{=>}% X1<>X4). %total {} (div-right-cancels-neq _ _ _ _ _). %%%%% rat-inv-less.elf %%%%% Theorems about inverted operations and inverted relations %%%%% This file is part of the rat.elf signature %%%% Theorems %%% Theorems about sub %theorem sub-left-inverts-lst* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:lst X2 X4} {IOP1:sub X1 X2 X3} {IOP2:sub X1 X4 X5} exists {GP:lst X5 X3} true. - : sub-left-inverts-lst* X2}% X5}% X4}% X5}% X1}% X5<=X3). %total {} (sub-left-inverts-lse* _ _ _ _). %theorem sub-right-preserves-lse* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:lse X1 X2} {IOP1:sub X1 X3 X4} {IOP2:sub X2 X3 X5} exists {GP:lse X4 X5} true. - : sub-right-preserves-lse* X1<=X2 X4+X3=X1 X5+X3=X2 X4<=X5 <- add-right-cancels-lse X4+X3=X1 X5+X3=X2 equ/ X1<=X2 X4<=X5. %worlds () (sub-right-preserves-lse* X1<=X2 X1-X3=X4 X2-X3=X5 %{=>}% X4<=X5). %total {} (sub-right-preserves-lse* _ _ _ _). %theorem sub-left-cancels-inverts-lse : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E:equ X1 X4} {G:lse X3 X6} exists {GP:lse X5 X2} true. - : sub-left-cancels-inverts-lse X3+X2=X1 X6+X5=X4 X1=X4 X3<=X6 X5<=X2 <- add-total X6+X2=X7 <- add-right-preserves-lse* X3<=X6 X3+X2=X1 X6+X2=X7 X1<=X7 <- equ-symmetric X1=X4 X4=X1 <- add-respects-equ X6+X5=X4 equ/ equ/ X4=X1 X6+X5=X1 <- add-left-cancels-lse X6+X5=X1 X6+X2=X7 equ/ X1<=X7 X5<=X2. %worlds () (sub-left-cancels-inverts-lse X1-X2=X3 X4-X5=X6 X1=X4 X3<=X6 %{=>}% X5<=X2). %total {} (sub-left-cancels-inverts-lse _ _ _ _ _). %theorem sub-right-cancels-lse : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:sub X1 X2 X3} {IOP2:sub X4 X5 X6} {E2:equ X2 X5} {G3:lse X3 X6} exists {G1:lse X1 X4} true. - : sub-right-cancels-lse X3+X2=X1 X6+X5=X4 X2=X5 X3<=X6 X1<=X4 <- add-respects-equ X3+X2=X1 equ/ X2=X5 equ/ X3+X5=X1 <- add-right-preserves-lse* X3<=X6 X3+X5=X1 X6+X5=X4 X1<=X4. %worlds () (sub-right-cancels-lse X1-X2=X3 X4-X5=X6 X2=X5 X3<=X6 %{=>}% X1<=X4). %total {} (sub-right-cancels-lse _ _ _ _ _). %%% Theorems about div %theorem mul-left-preserves-gre* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:gre X2 X4} {OP1:mul X1 X2 X3} {OP2:mul X1 X4 X5} exists {G2:gre X3 X5} true. - : mul-left-preserves-gre* (gre/= equ/) X1*X2=X3 X1*X2=X5 (gre/= X3=X5) <- mul-deterministic X1*X2=X3 X1*X2=X5 equ/ equ/ X3=X5. - : mul-left-preserves-gre* (gre/> X2>X4) X1*X2=X3 X1*X4=X5 (gre/> X3>X5) <- mul-left-preserves-grt* X2>X4 X1*X2=X3 X1*X4=X5 X3>X5. %worlds () (mul-left-preserves-gre* X2>=X4 X1*X2=X3 X1*X4=X5 %{=>}% X3>=X5). %total {} (mul-left-preserves-gre* _ _ _ _). %theorem mul-left-cancels-gre : forall* {X1} {X2} {X3} {Y1} {Y2} {Y3} forall {OP1:mul X1 X2 X3} {OP2:mul Y1 Y2 Y3} {E1:equ X1 Y1} {G3:gre X3 Y3} exists {G2:gre X2 Y2} true. - : mul-left-cancels-gre X1*X2=X3 X1*Y2=X3 equ/ (gre/= equ/) (gre/= X2=Y2) <- mul-left-cancels X1*X2=X3 X1*Y2=X3 equ/ equ/ X2=Y2. - : mul-left-cancels-gre X1*X2=X3 X1*Y2=Y3 equ/ (gre/> X3>Y3) (gre/> X2>Y2) <- mul-left-cancels-grt X1*X2=X3 X1*Y2=Y3 equ/ X3>Y3 X2>Y2. %worlds () (mul-left-cancels-gre X1*X2=X3 Y1*Y2=Y3 X1=Y1 X3>=Y3 %{=>}% X2>=Y2). %total {} (mul-left-cancels-gre _ _ _ _ _). %theorem div-left-inverts-lst* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:lst X2 X4} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} exists {GP:lst X5 X3} true. - : div-left-inverts-lst* X2}% X5}% X3 X5 X1/X2=X3 X1/X4=X5 X5}% X4}% X4 X5 X1/X3=X4 X2/X3=X5 X4}% X5}% X1}% X5<=X3). %total {} (div-left-inverts-lse* _ _ _ _). %theorem div-left-inverts-lse : forall* {X1} {X2} {X4} forall {G:lse X2 X4} exists {X3} {X5} {IOP1:div X1 X2 X3} {IOP2:div X1 X4 X5} {GP:lse X5 X3} true. - : div-left-inverts-lse X2<=X4 X3 X5 X1/X2=X3 X1/X4=X5 X5<=X3 <- div-total X1/X2=X3 <- div-total X1/X4=X5 <- div-left-inverts-lse* X2<=X4 X1/X2=X3 X1/X4=X5 X5<=X3. %worlds () (div-left-inverts-lse X2<=X4 %{=>}% X3 X5 X1/X2=X3 X1/X4=X5 X5<=X3). %total {} (div-left-inverts-lse _ _ _ _ _ _). %theorem div-right-preserves-lse* : forall* {X1} {X2} {X3} {X4} {X5} forall {G:lse X1 X2} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} exists {GP:lse X4 X5} true. - : div-right-preserves-lse* X1<=X2 X4*X3=X1 X5*X3=X2 X4<=X5 <- mul-right-cancels-lse X4*X3=X1 X5*X3=X2 equ/ X1<=X2 X4<=X5. %worlds () (div-right-preserves-lse* X1<=X2 X1/X3=X4 X2/X3=X5 %{=>}% X4<=X5). %total {} (div-right-preserves-lse* _ _ _ _). %theorem div-right-preserves-lse : forall* {X1} {X2} {X3} forall {G:lse X1 X2} exists {X4} {X5} {IOP1:div X1 X3 X4} {IOP2:div X2 X3 X5} {GP:lse X4 X5} true. - : div-right-preserves-lse X1<=X2 X4 X5 X1/X3=X4 X2/X3=X5 X4<=X5 <- div-total X1/X3=X4 <- div-total X2/X3=X5 <- div-right-preserves-lse* X1<=X2 X1/X3=X4 X2/X3=X5 X4<=X5. %worlds () (div-right-preserves-lse X1<=X2 %{=>}% X4 X5 X1/X3=X4 X2/X3=X5 X4<=X5). %total {} (div-right-preserves-lse _ _ _ _ _ _). %theorem div-left-cancels-inverts-lse : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E:equ X1 X4} {G:lse X3 X6} exists {GP:lse X5 X2} true. - : div-left-cancels-inverts-lse X3*X2=X1 X6*X5=X4 X1=X4 X3<=X6 X5<=X2 <- mul-total X6*X2=X7 <- mul-right-preserves-lse* X3<=X6 X3*X2=X1 X6*X2=X7 X1<=X7 <- equ-symmetric X1=X4 X4=X1 <- mul-respects-equ X6*X5=X4 equ/ equ/ X4=X1 X6*X5=X1 <- mul-left-cancels-lse X6*X5=X1 X6*X2=X7 equ/ X1<=X7 X5<=X2. %worlds () (div-left-cancels-inverts-lse X1/X2=X3 X4/X5=X6 X1=X4 X3<=X6 %{=>}% X5<=X2). %total {} (div-left-cancels-inverts-lse _ _ _ _ _). %theorem div-right-cancels-lse : forall* {X1} {X2} {X3} {X4} {X5} {X6} forall {IOP1:div X1 X2 X3} {IOP2:div X4 X5 X6} {E2:equ X2 X5} {G3:lse X3 X6} exists {G1:lse X1 X4} true. - : div-right-cancels-lse X3*X2=X1 X6*X5=X4 X2=X5 X3<=X6 X1<=X4 <- mul-respects-equ X3*X2=X1 equ/ X2=X5 equ/ X3*X5=X1 <- mul-right-preserves-lse* X3<=X6 X3*X5=X1 X6*X5=X4 X1<=X4. %worlds () (div-right-cancels-lse X1/X2=X3 X4/X5=X6 X2=X5 X3<=X6 %{=>}% X1<=X4). %total {} (div-right-cancels-lse _ _ _ _ _). %%%%% rat-eq.elf %%%%% Part of rat.elf %%%%% John Boyland %{% Retrofit rat to use eq/ne/eq? The definition of rat assumes that nat and rat use different identifiers which is convenient for writing proofs using both but is inconvenient for `functors'. %}% %%%% Renamings %abbrev eq = equ. %abbrev eq/ = equ/. %abbrev false-implies-eq = false-implies-equ. %abbrev eq-reflexive = equ-reflexive. %abbrev eq-symmetric = equ-symmetric. %abbrev eq-transitive = equ-transitive. %abbrev ne = neq. %abbrev false-implies-ne = false-implies-neq. %abbrev neq-respects-eq = neq-respects-equ. %abbrev ne-anti-reflexive = neq-anti-reflexive. %abbrev ne-symmetric = neq-symmetric. %abbrev eq-ne-implies-false = equ-neq-implies-false. %abbrev eq? = equ?. %abbrev eq?/yes = equ?/yes. %abbrev eq?/no = equ?/no. %abbrev eq?-total = equ?-total. %%%%% rat-leq.elf %%%%% Part of rat.elf %%%%% John Boyland %{% Retrofit rat to use leq/nle/leq? Makes it easier to use functors based on leq. %}% %%%% Renamings %abbrev leq = lse. %abbrev false-implies-leq = false-implies-lse. %abbrev leq-respects-eq = lse-respects-equ. %abbrev leq-reflexive = lse-reflexive. %abbrev leq-anti-symmetric = lse-anti-symmetric. %abbrev leq-transitive = lse-transitive. %abbrev nle = grt. %abbrev false-implies-nle = false-implies-grt. %abbrev nle-respects-eq = grt-respects-equ. %abbrev nle-anti-reflexive = grt-anti-reflexive. %%%% Definitions leq? : rat -> rat -> bool -> type. leq?/yes : leq Q1 Q2 -> leq? Q1 Q2 true. leq?/no : nle Q1 Q2 -> leq? Q1 Q2 false. %%%% Theorems %%% Theorems about leq/nle %theorem nle-implies-ne : forall* {Q1} {Q2} forall {G:grt Q1 Q2} exists {N:neq Q1 Q2} true. - : nle-implies-ne Q1>Q2 (neq/> Q1>Q2). %worlds () (nle-implies-ne _ _). %total { } (nle-implies-ne _ _). %theorem leq-nle-contradiction : forall* {Q1} {Q2} forall {L:lse Q1 Q2} {G:grt Q1 Q2} exists {F:void} true. - : leq-nle-contradiction Q2>=Q1 Q1>Q2 F <- gre-transitive-grt Q2>=Q1 Q1>Q2 Q2>Q2 <- grt-anti-reflexive Q2>Q2 F. %worlds () (leq-nle-contradiction _ _ _). %total { } (leq-nle-contradiction _ _ _). %%% Theorems about leq? %theorem leq?-total* : forall {Q1} {Q2} exists {B} {L:leq? Q1 Q2 B} true. %abbrev leq?-total = leq?-total* _ _ _. %theorem leq?-total** : forall* {Q1} {Q2} {C} forall {CMP:cmp Q1 Q2 C} exists {B} {L?:leq? Q1 Q2 B} true. - : leq?-total L? <- cmp-total CMP <- leq?-total** CMP _ L?. - : leq?-total** (cmp/< Q1 Q1 Q1>Q2) _ (leq?/no Q1>Q2). %worlds () (leq?-total** _ _ _). %total { } (leq?-total** _ _ _). %worlds () (leq?-total* _ _ _ _). %total { } (leq?-total* _ _ _ _). %%%%% Enumerating the rationals %%%%% John Boyland %%%%% Part of the rat.elf signature %%%% Definitions rat2nat : rat -> nat -> type. %abbrev nat2rat = [N] [R] rat2nat R N. rat2nat/whole : times N (s (s z)) TWON -> rat2nat (whole N) TWON. rat2nat/frac : plus TWON (s z) TWON+1 -> times N (s (s z)) TWON -> pair2nat (natpair/ N1 N2) N -> rat2nat R N2 -> rat2nat (frac N1 R) TWON+1. %%%% Theorems %theorem false-implies-rat2nat : forall* {R} {N} forall {F:void} exists {R2N:rat2nat R N} true. %worlds () (false-implies-rat2nat _ _). %total { } (false-implies-rat2nat _ _). %abbrev false-implies-nat2rat = false-implies-rat2nat. %theorem rat2nat-respects-eq : forall* {R1} {N1} {R2} {N2} forall {D1:rat2nat R1 N1} {ER:equ R1 R2} {EN:nat`eq N1 N2} exists {D2:rat2nat R2 N2} true. - : rat2nat-respects-eq R2N equ/ nat`eq/ R2N. %worlds () (rat2nat-respects-eq _ _ _ _). %total { } (rat2nat-respects-eq _ _ _ _). %reduces D1 = D2 (rat2nat-respects-eq D1 _ _ D2). %abbrev nat2rat-respects-eq : (nat2rat N1 R1) -> (nat`eq N1 N2) -> (equ R1 R2) -> (nat2rat N2 R2) -> type = [D1] [EN] [ER] [D2] rat2nat-respects-eq D1 ER EN D2. %theorem rat2nat-total* : forall {R:rat} exists {N:nat} {R2N:rat2nat R N} true. - : rat2nat-total* _ _ (rat2nat/whole T) <- times-total T. - : rat2nat-total* _ _ (rat2nat/frac P T P2N R2N) <- rat2nat-total* _ _ R2N <- pair2nat-total P2N <- times-total T <- plus-total P. %worlds () (rat2nat-total* _ _ _). %total (R) (rat2nat-total* R _ _). %abbrev rat2nat-total = rat2nat-total* _ _. %theorem nat2rat-total* : forall {N:nat} exists {R:rat} {N2R:nat2rat N R} true. %theorem nat2rat-total*/L : forall* {Q} {R} forall {N:nat} {D:divrem N (s (s z)) Q R} exists {S:rat} {N2R:nat2rat N S} true. - : nat2rat-total*/L M (D:divrem M _ N z) (whole N) (rat2nat/whole N*2=M) <- div-can-be-inverted D N*2=M. - : nat2rat-total*/L M (D:divrem M _ N (s z)) (frac N1 R) (rat2nat/frac TWON+1=M N*2=2N P2N R2N) <- divrem-can-be-inverted D TWON N*2=2N TWON+1=M <- times-commutative N*2=2N (times/s (times/s times/z plus/z) N+N=2N) <- plus-implies-ge N+N=2N TWON>=N <- plus-commutative TWON+1=M ONE+2N=M <- plus-implies-gt ONE+2N=M nat`eq/ M>2N <- gt-transitive-ge M>2N TWON>=N M>N <- meta-gt _ _ M>N <- nat2pair-total (P2N:nat2pair N (natpair/ N1 N2)) <- nat2pair-implies-ge P2N _ N>=N2 <- meta-ge _ _ N>=N2 <- divrem-total D2 <- nat2rat-total*/L _ D2 _ R2N. - : nat2rat-total*/L M (D:divrem _ _ _ (s (s X))) (whole z) R2N <- divrem-implies-gt D TWO>SSX <- succ-preserves-gt-converse TWO>SSX ONE>SX <- succ-preserves-gt-converse ONE>SX ZERO>X <- gt-contradiction ZERO>X F <- false-implies-nat2rat F R2N. %worlds () (nat2rat-total*/L _ _ _ _). %total (N) (nat2rat-total*/L N _ _ _). - : nat2rat-total* M R N2R <- divrem-total D <- nat2rat-total*/L M D R N2R. %worlds () (nat2rat-total* _ _ _). %total { } (nat2rat-total* _ _ _). %abbrev nat2rat-total = nat2rat-total* _ _. %theorem rat2nat-deterministic : forall* {R1} {R2} {N1} {N2} forall {D1:rat2nat R1 N1} {D2:rat2nat R2 N2} {ER:equ R1 R2} exists {EN:nat`eq N1 N2} true. - : rat2nat-deterministic (rat2nat/whole N*2=2N) (rat2nat/whole N*2=2N') equ/ TWON=2N' <- times-deterministic N*2=2N N*2=2N' nat`eq/ nat`eq/ TWON=2N'. - : rat2nat-deterministic (rat2nat/frac TWON+1=TWON1 N*2=2N P2N R2N) (rat2nat/frac TWON'+1=TWON1' N'*2=2N' P2N' R2N') equ/ TWON1=TWON1' <- rat2nat-deterministic R2N R2N' equ/ N2=N2' <- natpair`pair-preserves-eq nat`eq/ N2=N2' N1,N2=N1,N2' <- pair2nat-deterministic P2N P2N' N1,N2=N1,N2' N=N' <- times-deterministic N*2=2N N'*2=2N' N=N' nat`eq/ TWON=2N' <- plus-deterministic TWON+1=TWON1 TWON'+1=TWON1' TWON=2N' nat`eq/ TWON1=TWON1'. %worlds () (rat2nat-deterministic _ _ _ _). %total (R) (rat2nat-deterministic R _ _ _). %theorem nat2rat-deterministic : forall* {R1} {R2} {N1} {N2} forall {D1:nat2rat N1 R1} {D2:nat2rat N2 R2} {EN:nat`eq N1 N2} exists {ER:equ R1 R2} true. - : nat2rat-deterministic (rat2nat/whole N*2=2N) (rat2nat/whole N'*2=2N) nat`eq/ WN=WN' <- times-right-cancels N*2=2N N'*2=2N nat`eq/ nat`eq/ N=N' <- whole-preserves-eq N=N' WN=WN'. - : nat2rat-deterministic (rat2nat/whole N*2=X) (rat2nat/frac TWON+1=X N'*2=2N _ _) nat`eq/ R=R' <- div-can-be-constructed N*2=X X/2=N,0 <- divrem-can-be-constructed N'*2=2N TWON+1=X (gt/1) X/2=N',1 <- divrem-deterministic X/2=N,0 X/2=N',1 nat`eq/ nat`eq/ N=N' ZERO=ONE <- nat`eq-contradiction ZERO=ONE F <- false-implies-equ F R=R'. - : nat2rat-deterministic (rat2nat/frac TWON+1=X N'*2=2N _ _) (rat2nat/whole N*2=X) nat`eq/ R'=R <- div-can-be-constructed N*2=X X/2=N,0 <- divrem-can-be-constructed N'*2=2N TWON+1=X (gt/1) X/2=N',1 <- divrem-deterministic X/2=N,0 X/2=N',1 nat`eq/ nat`eq/ N=N' ZERO=ONE <- nat`eq-contradiction ZERO=ONE F <- false-implies-equ F R'=R. - : nat2rat-deterministic (rat2nat/frac TWON+1=Z N*2=2N P2N R2N) (rat2nat/frac TWON'+1=Z N'*2=2N' P2N' R2N') nat`eq/ NR=NR' <- divrem-can-be-constructed N*2=2N TWON+1=Z (gt/1) Z/2=N,1 <- divrem-can-be-constructed N'*2=2N' TWON'+1=Z (gt/1) Z/2=N',1 <- divrem-deterministic Z/2=N,1 Z/2=N',1 nat`eq/ nat`eq/ N=N' _ <- nat2pair-deterministic P2N P2N' N=N' N1,N2=N1',N2' <- natpair`pair-eq-implies-eq N1,N2=N1',N2' N1=N1' N2=N2' <- nat2rat-deterministic R2N R2N' N2=N2' R=R' <- frac-preserves-equ N1=N1' R=R' NR=NR'. %worlds () (nat2rat-deterministic _ _ _ _). %total (D) (nat2rat-deterministic D _ _ _). %theorem rat2nat-preserves-ne* : forall* {R1} {R2} {N1} {N2} forall {RNE: neq R1 R2} {T1:rat2nat R1 N1} {T2:rat2nat R2 N2} exists {NE: nat`ne N1 N2} true. %theorem rat2nat-preserves-ne*/L : forall* {R1} {R2} {N1} {N2} {B} forall {RNE: neq R1 R2} {T1:rat2nat R1 N1} {T2:rat2nat R2 N2} {NT: nat`eq? N1 N2 B} exists {NE: nat`ne N1 N2} true. - : rat2nat-preserves-ne* R1<>R2 R1->N1 R2->N2 N1<>N2 <- nat`eq?-total EQ? <- rat2nat-preserves-ne*/L R1<>R2 R1->N1 R2->N2 EQ? N1<>N2. - : rat2nat-preserves-ne*/L _ _ _ (nat`eq?/no N1<>N2) N1<>N2. - : rat2nat-preserves-ne*/L R1<>R2 R1->N R2->N (nat`eq?/yes) N<>N <- nat2rat-deterministic R1->N R2->N nat`eq/ R1=R2 <- equ-neq-implies-false R1=R2 R1<>R2 F <- nat`false-implies-ne F N<>N. %worlds () (rat2nat-preserves-ne*/L _ _ _ _ _). %total { } (rat2nat-preserves-ne*/L _ _ _ _ _). %worlds () (rat2nat-preserves-ne* _ _ _ _). %total { } (rat2nat-preserves-ne* _ _ _ _). %theorem rat2nat-preserves-ne : forall* {R1} {R2} forall {RNE: neq R1 R2} exists {N1} {N2} {T1:rat2nat R1 N1} {T2:rat2nat R2 N2} {NE: nat`ne N1 N2} true. - : rat2nat-preserves-ne R1<>R2 N1 N2 T1 T2 N1<>N2 <- rat2nat-total T1 <- rat2nat-total T2 <- rat2nat-preserves-ne* R1<>R2 T1 T2 N1<>N2. %worlds () (rat2nat-preserves-ne _ _ _ _ _ _). %total { } (rat2nat-preserves-ne _ _ _ _ _ _). %theorem nat2rat-preserves-ne* : forall* {R1} {R2} {N1} {N2} forall {NE: nat`ne N1 N2} {T1:nat2rat N1 R1} {T2:nat2rat N2 R2} exists {RNE: neq R1 R2} true. %theorem nat2rat-preserves-ne*/L : forall* {R1} {R2} {N1} {N2} {B} forall {NE: nat`ne N1 N2} {T1:nat2rat N1 R1} {T2:nat2rat N2 R2} {RT: equ? R1 R2 B} exists {RNE: neq R1 R2} true. - : nat2rat-preserves-ne* N1<>N2 N1->R1 N2->R2 R1<>R2 <- equ?-total ER? <- nat2rat-preserves-ne*/L N1<>N2 N1->R1 N2->R2 ER? R1<>R2. - : nat2rat-preserves-ne*/L _ _ _ (equ?/no R1<>R2) R1<>R2. - : nat2rat-preserves-ne*/L N1<>N2 N1->R N2->R (equ?/yes) R<>R <- rat2nat-deterministic N1->R N2->R eq/ N1=N2 <- nat`eq-ne-implies-false N1=N2 N1<>N2 F <- false-implies-neq F R<>R. %worlds () (nat2rat-preserves-ne*/L _ _ _ _ _). %total { } (nat2rat-preserves-ne*/L _ _ _ _ _). %worlds () (nat2rat-preserves-ne* _ _ _ _). %total { } (nat2rat-preserves-ne* _ _ _ _). %theorem nat2rat-preserves-ne : forall* {N1} {N2} forall {NNE: nat`ne N1 N2} exists {R1} {R2} {T1:nat2rat N1 R1} {T2:nat2rat N2 R2} {RE: neq R1 R2} true. - : nat2rat-preserves-ne N1<>N2 R1 R2 T1 T2 R1<>R2 <- nat2rat-total T1 <- nat2rat-total T2 <- nat2rat-preserves-ne* N1<>N2 T1 T2 R1<>R2. %worlds () (nat2rat-preserves-ne _ _ _ _ _ _). %total { } (nat2rat-preserves-ne _ _ _ _ _ _). %%%% Exports %abbrev rat`rat = rat. %abbrev rat`whole = whole. %abbrev rat`frac = frac. %abbrev rat`one = one. %abbrev rat`two = two. %abbrev rat`half = half. %abbrev rat`equ = equ. %abbrev rat`equ/ = equ/. %abbrev rat`inc = inc. %abbrev rat`inc/whole = inc/whole. %abbrev rat`inc/frac = inc/frac. %abbrev rat`abs = abs. %abbrev rat`abs/whole = abs/whole. %abbrev rat`abs/frac = abs/frac. %abbrev rat`rep = rep. %abbrev rat`rep/= = rep/=. %abbrev rat`rep/> = rep/>. %abbrev rat`rep/< = rep/<. %abbrev rat`grt = grt. %abbrev rat`grt/ = grt/. %abbrev rat`cmp = cmp. %abbrev rat`cmp/= = cmp/=. %abbrev rat`cmp/< = cmp/<. %abbrev rat`cmp/> = cmp/>. %abbrev rat`add = add. %abbrev rat`add/ = add/. %abbrev rat`mul = mul. %abbrev rat`mul/ = mul/. %abbrev rat`false-implies-equ = false-implies-equ. %abbrev rat`equ-reflexive = equ-reflexive. %abbrev rat`equ-symmetric = equ-symmetric. %abbrev rat`equ-transitive = equ-transitive. %abbrev rat`whole-preserves-eq = whole-preserves-eq. %abbrev rat`frac-preserves-equ = frac-preserves-equ. %abbrev rat`inc-respects-equ = inc-respects-equ. %abbrev rat`inc-total* = inc-total*. %abbrev rat`inc-total = inc-total. %abbrev rat`inc-deterministic = inc-deterministic. %abbrev rat`abs-respects-equ = abs-respects-equ. %abbrev rat`abs-deterministic = abs-deterministic. %abbrev rat`abs-total* = abs-total*. %abbrev rat`abs-total = abs-total. %abbrev rat`abs-yields-positive = abs-yields-positive. %abbrev rat`false-implies-rep = false-implies-rep. %abbrev rat`rep-respects-equ = rep-respects-equ. %abbrev rat`rep-implies-positive = rep-implies-positive. %abbrev rat`rep-inf-contradiction = rep-inf-contradiction. %abbrev rat`rep-zero-contradiction = rep-zero-contradiction. %abbrev rat`rep-deterministic = rep-deterministic. %abbrev rat`rep-total** = rep-total**. %abbrev rat`rep-total* = rep-total*. %abbrev rat`rep-total = rep-total. %abbrev rat`rep-times-right = rep-times-right. %abbrev rat`rep-times-left = rep-times-left. %abbrev rat`rep-right-cancels = rep-right-cancels. %abbrev rat`rep-left-cancels = rep-left-cancels. %abbrev rat`rep-whole = rep-whole. %abbrev rat`rep-frac = rep-frac. %abbrev rat`rep-inverse-of-abs = rep-inverse-of-abs. %abbrev rat`abs-inverse-of-rep-mult* = abs-inverse-of-rep-mult*. %abbrev rat`abs-inverse-of-rep-mult = abs-inverse-of-rep-mult. %abbrev rat`reps-comparable = reps-comparable. %abbrev rat`false-implies-grt = false-implies-grt. %abbrev rat`grt-respects-equ = grt-respects-equ. %abbrev rat`grt-anti-reflexive = grt-anti-reflexive. %abbrev rat`grt-transitive = grt-transitive. %abbrev rat`grt-anti-symmetric = grt-anti-symmetric. %abbrev rat`grt-implies-add = grt-implies-add. %abbrev rat`false-implies-cmp = false-implies-cmp. %abbrev rat`cmp-respects-equ = cmp-respects-equ. %abbrev rat`cmp-total** = cmp-total**. %abbrev rat`cmp-total* = cmp-total*. %abbrev rat`cmp-total = cmp-total. %abbrev rat`greater-implies-grt = greater-implies-grt. %abbrev rat`less-implies-lst = less-implies-lst. %abbrev rat`equal-implies-equ = equal-implies-equ. %abbrev rat`false-implies-add = false-implies-add. %abbrev rat`add-respects-equ = add-respects-equ. %abbrev rat`add-total* = add-total*. %abbrev rat`add-total = add-total. %abbrev rat`add-deterministic = add-deterministic. %abbrev rat`add-commutative = add-commutative. %abbrev rat`add-associative = add-associative. %abbrev rat`add-associative* = add-associative*. %abbrev rat`add-associative-converse = add-associative-converse. %abbrev rat`add-associative-converse* = add-associative-converse*. %abbrev rat`add-assoc-commutative* = add-assoc-commutative*. %abbrev rat`add-assoc-commutative = add-assoc-commutative. %abbrev rat`add-double-associative* = add-double-associative*. %abbrev rat`add-double-associative = add-double-associative. %abbrev rat`add-left-cancels = add-left-cancels. %abbrev rat`add-right-cancels = add-right-cancels. %abbrev rat`add-implies-grt* = add-implies-grt*. %abbrev rat`add-implies-grt = add-implies-grt. %abbrev rat`add-no-left-identity = add-no-left-identity. %abbrev rat`add-no-right-identity = add-no-right-identity. %abbrev rat`add-left-preserves-grt* = add-left-preserves-grt*. %abbrev rat`add-left-cancels-grt = add-left-cancels-grt. %abbrev rat`add-left-preserves-grt = add-left-preserves-grt. %abbrev rat`add-right-preserves-grt* = add-right-preserves-grt*. %abbrev rat`add-right-preserves-grt = add-right-preserves-grt. %abbrev rat`add-preserves-grt* = add-preserves-grt*. %abbrev rat`add-preserves-grt = add-preserves-grt. %abbrev rat`add-right-cancels-grt = add-right-cancels-grt. %abbrev rat`false-implies-mul = false-implies-mul. %abbrev rat`mul-respects-equ = mul-respects-equ. %abbrev rat`mul-total* = mul-total*. %abbrev rat`mul-total = mul-total. %abbrev rat`mul-deterministic = mul-deterministic. %abbrev rat`mul-commutative = mul-commutative. %abbrev rat`mul-left-identity = mul-left-identity. %abbrev rat`mul-right-identity = mul-right-identity. %abbrev rat`mul-associative = mul-associative. %abbrev rat`mul-associative* = mul-associative*. %abbrev rat`mul-associative-converse = mul-associative-converse. %abbrev rat`mul-associative-converse* = mul-associative-converse*. %abbrev rat`mul-assoc-commutative* = mul-assoc-commutative*. %abbrev rat`mul-assoc-commutative = mul-assoc-commutative. %abbrev rat`mul-double-associative* = mul-double-associative*. %abbrev rat`mul-double-associative = mul-double-associative. %abbrev rat`mul-right-distributes-over-add = mul-right-distributes-over-add. %abbrev rat`mul-right-distributes-over-add* = mul-right-distributes-over-add*. %abbrev rat`mul-left-distributes-over-add* = mul-left-distributes-over-add*. %abbrev rat`mul-left-distributes-over-add = mul-left-distributes-over-add. %abbrev rat`mul-right-factors-over-add = mul-right-factors-over-add. %abbrev rat`mul-right-factors-over-add* = mul-right-factors-over-add*. %abbrev rat`mul-left-factors-over-add = mul-left-factors-over-add. %abbrev rat`mul-left-factors-over-add* = mul-left-factors-over-add*. %abbrev rat`mul-left-cancels = mul-left-cancels. %abbrev rat`mul-right-cancels = mul-right-cancels. %abbrev rat`mul-left-preserves-grt* = mul-left-preserves-grt*. %abbrev rat`mul-left-cancels-grt = mul-left-cancels-grt. %abbrev rat`mul-left-preserves-grt = mul-left-preserves-grt. %abbrev rat`mul-right-preserves-grt* = mul-right-preserves-grt*. %abbrev rat`mul-right-preserves-grt = mul-right-preserves-grt. %abbrev rat`mul-preserves-grt* = mul-preserves-grt*. %abbrev rat`mul-preserves-grt = mul-preserves-grt. %abbrev rat`mul-right-cancels-grt = mul-right-cancels-grt. %abbrev rat`sub = sub. %abbrev rat`false-implies-sub = false-implies-sub. %abbrev rat`sub-respects-equ = sub-respects-equ. %abbrev rat`sub-deterministic = sub-deterministic. %abbrev rat`add-associates-with-sub* = add-associates-with-sub*. %abbrev rat`add-associates-with-sub-converse* = add-associates-with-sub-converse*. %abbrev rat`add-associates-with-sub-converse = add-associates-with-sub-converse. %abbrev rat`sub-associates-from-add* = sub-associates-from-add*. %abbrev rat`sub-associates-from-add-converse* = sub-associates-from-add-converse*. %abbrev rat`sub-associates-to-add* = sub-associates-to-add*. %abbrev rat`sub-associates-to-add = sub-associates-to-add. %abbrev rat`sub-associates-to-add-converse* = sub-associates-to-add-converse*. %abbrev rat`sub-associates-to-add-converse = sub-associates-to-add-converse. %abbrev rat`sub-implies-grt* = sub-implies-grt*. %abbrev rat`sub-implies-grt = sub-implies-grt. %abbrev rat`sub-left-cancels = sub-left-cancels. %abbrev rat`sub-right-cancels = sub-right-cancels. %abbrev rat`sub-left-inverts-grt* = sub-left-inverts-grt*. %abbrev rat`sub-right-preserves-grt* = sub-right-preserves-grt*. %abbrev rat`sub-left-cancels-inverts-grt = sub-left-cancels-inverts-grt. %abbrev rat`sub-right-cancels-grt = sub-right-cancels-grt. %abbrev rat`mul-right-factors-over-sub = mul-right-factors-over-sub. %abbrev rat`mul-right-distributes-over-sub = mul-right-distributes-over-sub. %abbrev rat`mul-right-distributes-over-sub* = mul-right-distributes-over-sub*. %abbrev rat`mul-left-distributes-over-sub* = mul-left-distributes-over-sub*. %abbrev rat`mul-left-distributes-over-sub = mul-left-distributes-over-sub. %abbrev rat`mul-right-factors-over-sub* = mul-right-factors-over-sub*. %abbrev rat`mul-left-factors-over-sub = mul-left-factors-over-sub. %abbrev rat`mul-left-factors-over-sub* = mul-left-factors-over-sub*. %abbrev rat`div = div. %abbrev rat`false-implies-div = false-implies-div. %abbrev rat`div-respects-equ = div-respects-equ. %abbrev rat`div-deterministic = div-deterministic. %abbrev rat`div-total* = div-total*. %abbrev rat`div-total = div-total. %abbrev rat`mul-associates-with-div* = mul-associates-with-div*. %abbrev rat`mul-associates-with-div = mul-associates-with-div. %abbrev rat`mul-associates-with-div-converse* = mul-associates-with-div-converse*. %abbrev rat`mul-associates-with-div-converse = mul-associates-with-div-converse. %abbrev rat`div-associates-from-mul* = div-associates-from-mul*. %abbrev rat`div-associates-from-mul = div-associates-from-mul. %abbrev rat`div-associates-from-mul-converse* = div-associates-from-mul-converse*. %abbrev rat`div-associates-from-mul-converse = div-associates-from-mul-converse. %abbrev rat`div-associates-to-mul* = div-associates-to-mul*. %abbrev rat`div-associates-to-mul = div-associates-to-mul. %abbrev rat`div-associates-to-mul-converse* = div-associates-to-mul-converse*. %abbrev rat`div-associates-to-mul-converse = div-associates-to-mul-converse. %abbrev rat`div-left-cancels = div-left-cancels. %abbrev rat`div-right-cancels = div-right-cancels. %abbrev rat`div-left-inverts-grt* = div-left-inverts-grt*. %abbrev rat`div-left-inverts-grt = div-left-inverts-grt. %abbrev rat`div-right-preserves-grt* = div-right-preserves-grt*. %abbrev rat`div-right-preserves-grt = div-right-preserves-grt. %abbrev rat`div-left-cancels-inverts-grt = div-left-cancels-inverts-grt. %abbrev rat`div-right-cancels-grt = div-right-cancels-grt. %abbrev rat`div-right-distributes-over-add = div-right-distributes-over-add. %abbrev rat`div-right-distributes-over-add* = div-right-distributes-over-add*. %abbrev rat`div-right-factors-over-add = div-right-factors-over-add. %abbrev rat`div-right-factors-over-add* = div-right-factors-over-add*. %abbrev rat`div-right-factors-over-sub = div-right-factors-over-sub. %abbrev rat`div-right-distributes-over-sub = div-right-distributes-over-sub. %abbrev rat`div-right-distributes-over-sub* = div-right-distributes-over-sub*. %abbrev rat`div-right-factors-over-sub* = div-right-factors-over-sub*. %abbrev rat`add-cross-comparable = add-cross-comparable. %abbrev rat`gre = gre. %abbrev rat`gre/= = gre/=. %abbrev rat`gre/> = gre/>. %abbrev rat`false-implies-gre = false-implies-gre. %abbrev rat`gre-respects-equ = gre-respects-equ. %abbrev rat`gre-reflexive = gre-reflexive. %abbrev rat`gre-transitive = gre-transitive. %abbrev rat`gre-anti-symmetric = gre-anti-symmetric. %abbrev rat`gre-transitive-grt = gre-transitive-grt. %abbrev rat`grt-transitive-gre = grt-transitive-gre. %abbrev rat`add-implies-gre = add-implies-gre. %abbrev rat`add-implies-gre* = add-implies-gre*. %abbrev rat`add-left-preserves-gre* = add-left-preserves-gre*. %abbrev rat`add-left-cancels-gre = add-left-cancels-gre. %abbrev rat`add-left-preserves-gre = add-left-preserves-gre. %abbrev rat`add-right-preserves-gre* = add-right-preserves-gre*. %abbrev rat`add-right-preserves-gre = add-right-preserves-gre. %abbrev rat`add-preserves-gre* = add-preserves-gre*. %abbrev rat`add-preserves-gre = add-preserves-gre. %abbrev rat`add-right-cancels-gre = add-right-cancels-gre. %abbrev rat`mul-left-preserves-gre* = mul-left-preserves-gre*. %abbrev rat`mul-left-cancels-gre = mul-left-cancels-gre. %abbrev rat`mul-left-preserves-gre = mul-left-preserves-gre. %abbrev rat`mul-right-preserves-gre* = mul-right-preserves-gre*. %abbrev rat`mul-right-preserves-gre = mul-right-preserves-gre. %abbrev rat`mul-preserves-gre* = mul-preserves-gre*. %abbrev rat`mul-preserves-gre = mul-preserves-gre. %abbrev rat`mul-right-cancels-gre = mul-right-cancels-gre. %abbrev rat`neq = neq. %abbrev rat`neq/< = neq/<. %abbrev rat`neq/> = neq/>. %abbrev rat`equ? = equ?. %abbrev rat`equ?/yes = equ?/yes. %abbrev rat`equ?/no = equ?/no. %abbrev rat`false-implies-neq = false-implies-neq. %abbrev rat`neq-respects-equ = neq-respects-equ. %abbrev rat`neq-anti-reflexive = neq-anti-reflexive. %abbrev rat`neq-symmetric = neq-symmetric. %abbrev rat`equ-neq-implies-false = equ-neq-implies-false. %abbrev rat`gre-neq-implies-grt = gre-neq-implies-grt. %abbrev rat`equ?-total* = equ?-total*. %abbrev rat`equ?-total*/L = equ?-total*/L. %abbrev rat`equ?-total = equ?-total. %abbrev rat`add-left-preserves-neq* = add-left-preserves-neq*. %abbrev rat`add-left-cancels-neq = add-left-cancels-neq. %abbrev rat`add-left-preserves-neq = add-left-preserves-neq. %abbrev rat`add-right-preserves-neq* = add-right-preserves-neq*. %abbrev rat`add-right-preserves-neq = add-right-preserves-neq. %abbrev rat`add-right-cancels-neq = add-right-cancels-neq. %abbrev rat`mul-left-preserves-neq* = mul-left-preserves-neq*. %abbrev rat`mul-left-cancels-neq = mul-left-cancels-neq. %abbrev rat`mul-left-preserves-neq = mul-left-preserves-neq. %abbrev rat`mul-right-preserves-neq* = mul-right-preserves-neq*. %abbrev rat`mul-right-preserves-neq = mul-right-preserves-neq. %abbrev rat`mul-right-cancels-neq = mul-right-cancels-neq. %abbrev rat`lst = lst. %abbrev rat`false-implies-lst = false-implies-lst. %abbrev rat`lst-respects-equ = lst-respects-equ. %abbrev rat`lst-anti-symmetric = lst-anti-symmetric. %abbrev rat`lst-transitive = lst-transitive. %abbrev rat`lst-anti-reflexive = lst-anti-reflexive. %abbrev rat`add-left-preserves-lst* = add-left-preserves-lst*. %abbrev rat`add-left-cancels-lst = add-left-cancels-lst. %abbrev rat`add-left-preserves-lst = add-left-preserves-lst. %abbrev rat`add-right-preserves-lst* = add-right-preserves-lst*. %abbrev rat`add-right-preserves-lst = add-right-preserves-lst. %abbrev rat`add-preserves-lst* = add-preserves-lst*. %abbrev rat`add-preserves-lst = add-preserves-lst. %abbrev rat`add-right-cancels-lst = add-right-cancels-lst. %abbrev rat`mul-left-preserves-lst* = mul-left-preserves-lst*. %abbrev rat`mul-left-cancels-lst = mul-left-cancels-lst. %abbrev rat`mul-left-preserves-lst = mul-left-preserves-lst. %abbrev rat`mul-right-preserves-lst* = mul-right-preserves-lst*. %abbrev rat`mul-right-preserves-lst = mul-right-preserves-lst. %abbrev rat`mul-preserves-lst* = mul-preserves-lst*. %abbrev rat`mul-preserves-lst = mul-preserves-lst. %abbrev rat`mul-right-cancels-lst = mul-right-cancels-lst. %abbrev rat`lse = lse. %abbrev rat`false-implies-lse = false-implies-lse. %abbrev rat`lse-respects-equ = lse-respects-equ. %abbrev rat`lse-anti-symmetric = lse-anti-symmetric. %abbrev rat`lse-transitive = lse-transitive. %abbrev rat`lse-reflexive = lse-reflexive. %abbrev rat`lse-transitive-lst = lse-transitive-lst. %abbrev rat`lst-transitive-lse = lst-transitive-lse. %abbrev rat`add-left-preserves-lse* = add-left-preserves-lse*. %abbrev rat`add-left-cancels-lse = add-left-cancels-lse. %abbrev rat`add-left-preserves-lse = add-left-preserves-lse. %abbrev rat`add-right-preserves-lse* = add-right-preserves-lse*. %abbrev rat`add-right-preserves-lse = add-right-preserves-lse. %abbrev rat`add-preserves-lse* = add-preserves-lse*. %abbrev rat`add-preserves-lse = add-preserves-lse. %abbrev rat`add-right-cancels-lse = add-right-cancels-lse. %abbrev rat`mul-left-preserves-lse* = mul-left-preserves-lse*. %abbrev rat`mul-left-cancels-lse = mul-left-cancels-lse. %abbrev rat`mul-left-preserves-lse = mul-left-preserves-lse. %abbrev rat`mul-right-preserves-lse* = mul-right-preserves-lse*. %abbrev rat`mul-right-preserves-lse = mul-right-preserves-lse. %abbrev rat`mul-preserves-lse* = mul-preserves-lse*. %abbrev rat`mul-preserves-lse = mul-preserves-lse. %abbrev rat`mul-right-cancels-lse = mul-right-cancels-lse. %abbrev rat`sub-left-inverts-gre* = sub-left-inverts-gre*. %abbrev rat`sub-right-preserves-gre* = sub-right-preserves-gre*. %abbrev rat`sub-left-cancels-inverts-gre = sub-left-cancels-inverts-gre. %abbrev rat`sub-right-cancels-gre = sub-right-cancels-gre. %abbrev rat`sub-left-preserves-neq* = sub-left-preserves-neq*. %abbrev rat`sub-right-preserves-neq* = sub-right-preserves-neq*. %abbrev rat`sub-left-cancels-neq = sub-left-cancels-neq. %abbrev rat`sub-right-cancels-neq = sub-right-cancels-neq. %abbrev rat`mul-left-preserves-gre* = mul-left-preserves-gre*. %abbrev rat`mul-left-cancels-gre = mul-left-cancels-gre. %abbrev rat`div-left-inverts-gre* = div-left-inverts-gre*. %abbrev rat`div-left-inverts-gre = div-left-inverts-gre. %abbrev rat`div-right-preserves-gre* = div-right-preserves-gre*. %abbrev rat`div-right-preserves-gre = div-right-preserves-gre. %abbrev rat`div-left-cancels-inverts-gre = div-left-cancels-inverts-gre. %abbrev rat`div-right-cancels-gre = div-right-cancels-gre. %abbrev rat`div-left-preserves-neq* = div-left-preserves-neq*. %abbrev rat`div-left-preserves-neq = div-left-preserves-neq. %abbrev rat`div-right-preserves-neq* = div-right-preserves-neq*. %abbrev rat`div-right-preserves-neq = div-right-preserves-neq. %abbrev rat`div-left-cancels-neq = div-left-cancels-neq. %abbrev rat`div-right-cancels-neq = div-right-cancels-neq. %abbrev rat`sub-left-inverts-lst* = sub-left-inverts-lst*. %abbrev rat`sub-right-preserves-lst* = sub-right-preserves-lst*. %abbrev rat`sub-left-cancels-inverts-lst = sub-left-cancels-inverts-lst. %abbrev rat`sub-right-cancels-lst = sub-right-cancels-lst. %abbrev rat`sub-left-inverts-lse* = sub-left-inverts-lse*. %abbrev rat`sub-right-preserves-lse* = sub-right-preserves-lse*. %abbrev rat`sub-left-cancels-inverts-lse = sub-left-cancels-inverts-lse. %abbrev rat`sub-right-cancels-lse = sub-right-cancels-lse. %abbrev rat`mul-left-preserves-gre* = mul-left-preserves-gre*. %abbrev rat`mul-left-cancels-gre = mul-left-cancels-gre. %abbrev rat`div-left-inverts-lst* = div-left-inverts-lst*. %abbrev rat`div-left-inverts-lst = div-left-inverts-lst. %abbrev rat`div-right-preserves-lst* = div-right-preserves-lst*. %abbrev rat`div-right-preserves-lst = div-right-preserves-lst. %abbrev rat`div-left-cancels-inverts-lst = div-left-cancels-inverts-lst. %abbrev rat`div-right-cancels-lst = div-right-cancels-lst. %abbrev rat`div-left-inverts-lse* = div-left-inverts-lse*. %abbrev rat`div-left-inverts-lse = div-left-inverts-lse. %abbrev rat`div-right-preserves-lse* = div-right-preserves-lse*. %abbrev rat`div-right-preserves-lse = div-right-preserves-lse. %abbrev rat`div-left-cancels-inverts-lse = div-left-cancels-inverts-lse. %abbrev rat`div-right-cancels-lse = div-right-cancels-lse. %abbrev rat`eq = eq. %abbrev rat`eq/ = eq/. %abbrev rat`false-implies-eq = false-implies-eq. %abbrev rat`eq-reflexive = eq-reflexive. %abbrev rat`eq-symmetric = eq-symmetric. %abbrev rat`eq-transitive = eq-transitive. %abbrev rat`ne = ne. %abbrev rat`false-implies-ne = false-implies-ne. %abbrev rat`neq-respects-eq = neq-respects-eq. %abbrev rat`ne-anti-reflexive = ne-anti-reflexive. %abbrev rat`ne-symmetric = ne-symmetric. %abbrev rat`eq-ne-implies-false = eq-ne-implies-false. %abbrev rat`eq? = eq?. %abbrev rat`eq?/yes = eq?/yes. %abbrev rat`eq?/no = eq?/no. %abbrev rat`eq?-total = eq?-total. %abbrev rat`leq = leq. %abbrev rat`false-implies-leq = false-implies-leq. %abbrev rat`leq-respects-eq = leq-respects-eq. %abbrev rat`leq-reflexive = leq-reflexive. %abbrev rat`leq-anti-symmetric = leq-anti-symmetric. %abbrev rat`leq-transitive = leq-transitive. %abbrev rat`nle = nle. %abbrev rat`false-implies-nle = false-implies-nle. %abbrev rat`nle-respects-eq = nle-respects-eq. %abbrev rat`nle-anti-reflexive = nle-anti-reflexive. %abbrev rat`leq? = leq?. %abbrev rat`leq?/yes = leq?/yes. %abbrev rat`leq?/no = leq?/no. %abbrev rat`nle-implies-ne = nle-implies-ne. %abbrev rat`leq-nle-contradiction = leq-nle-contradiction. %abbrev rat`leq?-total* = leq?-total*. %abbrev rat`leq?-total = leq?-total. %abbrev rat`leq?-total** = leq?-total**. %abbrev rat`rat2nat = rat2nat. %abbrev rat`nat2rat = nat2rat. %abbrev rat`rat2nat/whole = rat2nat/whole. %abbrev rat`rat2nat/frac = rat2nat/frac. %abbrev rat`false-implies-rat2nat = false-implies-rat2nat. %abbrev rat`false-implies-nat2rat = false-implies-nat2rat. %abbrev rat`rat2nat-respects-eq = rat2nat-respects-eq. %abbrev rat`nat2rat-respects-eq = nat2rat-respects-eq. %abbrev rat`rat2nat-total* = rat2nat-total*. %abbrev rat`rat2nat-total = rat2nat-total. %abbrev rat`nat2rat-total* = nat2rat-total*. %abbrev rat`nat2rat-total*/L = nat2rat-total*/L. %abbrev rat`nat2rat-total = nat2rat-total. %abbrev rat`rat2nat-deterministic = rat2nat-deterministic. %abbrev rat`nat2rat-deterministic = nat2rat-deterministic. %abbrev rat`rat2nat-preserves-ne* = rat2nat-preserves-ne*. %abbrev rat`rat2nat-preserves-ne*/L = rat2nat-preserves-ne*/L. %abbrev rat`rat2nat-preserves-ne = rat2nat-preserves-ne. %abbrev rat`nat2rat-preserves-ne* = nat2rat-preserves-ne*. %abbrev rat`nat2rat-preserves-ne*/L = nat2rat-preserves-ne*/L. %abbrev rat`nat2rat-preserves-ne = nat2rat-preserves-ne.