:: AOFA_I00 semantic presentation begin theorem Th1: :: AOFA_I00:1 for x, y, z, a, b, c being set st a <> b & b <> c & c <> a holds ex f being Function st ( f . a = x & f . b = y & f . c = z ) proof let x, y, z, a, b, c be set ; ::_thesis: ( a <> b & b <> c & c <> a implies ex f being Function st ( f . a = x & f . b = y & f . c = z ) ) assume that A1: a <> b and A2: b <> c and A3: c <> a ; ::_thesis: ex f being Function st ( f . a = x & f . b = y & f . c = z ) set fb = b .--> y; A4: dom (b .--> y) = {b} by FUNCOP_1:13; A5: a nin dom (b .--> y) by A1, TARSKI:def_1; A6: b in dom (b .--> y) by A4, TARSKI:def_1; set fc = c .--> z; set fa = a .--> x; take f = ((a .--> x) +* (b .--> y)) +* (c .--> z); ::_thesis: ( f . a = x & f . b = y & f . c = z ) A7: dom (c .--> z) = {c} by FUNCOP_1:13; a nin dom (c .--> z) by A3, TARSKI:def_1; hence f . a = ((a .--> x) +* (b .--> y)) . a by FUNCT_4:11 .= (a .--> x) . a by A5, FUNCT_4:11 .= x by FUNCOP_1:72 ; ::_thesis: ( f . b = y & f . c = z ) b nin dom (c .--> z) by A2, TARSKI:def_1; hence f . b = ((a .--> x) +* (b .--> y)) . b by FUNCT_4:11 .= (b .--> y) . b by A6, FUNCT_4:13 .= y by FUNCOP_1:72 ; ::_thesis: f . c = z c in dom (c .--> z) by A7, TARSKI:def_1; hence f . c = (c .--> z) . c by FUNCT_4:13 .= z by FUNCOP_1:72 ; ::_thesis: verum end; definition let F be non empty functional set ; let x, f be set ; funcF \ (x,f) -> Subset of F equals :: AOFA_I00:def 1 { g where g is Element of F : g . x <> f } ; coherence { g where g is Element of F : g . x <> f } is Subset of F proof set X = { g where g is Element of F : g . x <> f } ; { g where g is Element of F : g . x <> f } c= F proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in { g where g is Element of F : g . x <> f } or a in F ) assume a in { g where g is Element of F : g . x <> f } ; ::_thesis: a in F then ex g being Element of F st ( g = a & g . x <> f ) ; hence a in F ; ::_thesis: verum end; hence { g where g is Element of F : g . x <> f } is Subset of F ; ::_thesis: verum end; end; :: deftheorem defines \ AOFA_I00:def_1_:_ for F being non empty functional set for x, f being set holds F \ (x,f) = { g where g is Element of F : g . x <> f } ; theorem Th2: :: AOFA_I00:2 for F being non empty functional set for x, y being set for g being Element of F holds ( g in F \ (x,y) iff g . x <> y ) proof let F be non empty functional set ; ::_thesis: for x, y being set for g being Element of F holds ( g in F \ (x,y) iff g . x <> y ) let x, y be set ; ::_thesis: for g being Element of F holds ( g in F \ (x,y) iff g . x <> y ) let g be Element of F; ::_thesis: ( g in F \ (x,y) iff g . x <> y ) ( g in F \ (x,y) iff ex f being Element of F st ( g = f & f . x <> y ) ) ; hence ( g in F \ (x,y) iff g . x <> y ) ; ::_thesis: verum end; definition let X be set ; let Y, Z be set ; let f be Function of [:(Funcs (X,INT)),Y:],Z; mode Variable of f -> Element of X means :Def2: :: AOFA_I00:def 2 verum; existence ex b1 being Element of X st verum ; end; :: deftheorem Def2 defines Variable AOFA_I00:def_2_:_ for X, Y, Z being set for f being Function of [:(Funcs (X,INT)),Y:],Z for b5 being Element of X holds ( b5 is Variable of f iff verum ); notation let f be real-valued Function; let x be real number ; synonym f * x for x (#) f; end; definition let t1, t2 be INT -valued Function; funct1 div t2 -> INT -valued Function means :Def3: :: AOFA_I00:def 3 ( dom it = (dom t1) /\ (dom t2) & ( for s being set st s in dom it holds it . s = (t1 . s) div (t2 . s) ) ); correctness existence ex b1 being INT -valued Function st ( dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = (t1 . s) div (t2 . s) ) ); uniqueness for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = (t1 . s) div (t2 . s) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = (t1 . s) div (t2 . s) ) holds b1 = b2; proof deffunc H1( set ) -> set = (t1 . \$1) div (t2 . \$1); consider f being Function such that A1: ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in (dom t1) /\ (dom t2) holds f . x = H1(x) ) ) from FUNCT_1:sch_3(); f is INT -valued proof let y be set ; :: according to TARSKI:def_3,RELAT_1:def_19 ::_thesis: ( not y in proj2 f or y in INT ) assume y in rng f ; ::_thesis: y in INT then consider x being set such that A2: x in dom f and A3: f . x = y by FUNCT_1:def_3; f . x = H1(x) by A1, A2; hence y in INT by A3, INT_1:def_2; ::_thesis: verum end; hence ex f being INT -valued Function st ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in dom f holds f . x = H1(x) ) ) by A1; ::_thesis: for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = (t1 . s) div (t2 . s) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = (t1 . s) div (t2 . s) ) holds b1 = b2 let f1, f2 be INT -valued Function; ::_thesis: ( dom f1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f1 holds f1 . s = (t1 . s) div (t2 . s) ) & dom f2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f2 holds f2 . s = (t1 . s) div (t2 . s) ) implies f1 = f2 ) assume that A4: dom f1 = (dom t1) /\ (dom t2) and A5: for s being set st s in dom f1 holds f1 . s = H1(s) and A6: dom f2 = (dom t1) /\ (dom t2) and A7: for s being set st s in dom f2 holds f2 . s = H1(s) ; ::_thesis: f1 = f2 now__::_thesis:_for_s_being_set_st_s_in_(dom_t1)_/\_(dom_t2)_holds_ f1_._s_=_f2_._s let s be set ; ::_thesis: ( s in (dom t1) /\ (dom t2) implies f1 . s = f2 . s ) assume A8: s in (dom t1) /\ (dom t2) ; ::_thesis: f1 . s = f2 . s hence f1 . s = H1(s) by A4, A5 .= f2 . s by A6, A7, A8 ; ::_thesis: verum end; hence f1 = f2 by A4, A6, FUNCT_1:2; ::_thesis: verum end; funct1 mod t2 -> INT -valued Function means :Def4: :: AOFA_I00:def 4 ( dom it = (dom t1) /\ (dom t2) & ( for s being set st s in dom it holds it . s = (t1 . s) mod (t2 . s) ) ); correctness existence ex b1 being INT -valued Function st ( dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = (t1 . s) mod (t2 . s) ) ); uniqueness for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = (t1 . s) mod (t2 . s) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = (t1 . s) mod (t2 . s) ) holds b1 = b2; proof deffunc H1( set ) -> set = (t1 . \$1) mod (t2 . \$1); consider f being Function such that A9: ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in (dom t1) /\ (dom t2) holds f . x = H1(x) ) ) from FUNCT_1:sch_3(); f is INT -valued proof let y be set ; :: according to TARSKI:def_3,RELAT_1:def_19 ::_thesis: ( not y in proj2 f or y in INT ) assume y in rng f ; ::_thesis: y in INT then consider x being set such that A10: x in dom f and A11: f . x = y by FUNCT_1:def_3; f . x = H1(x) by A9, A10; hence y in INT by A11, INT_1:def_2; ::_thesis: verum end; hence ex f being INT -valued Function st ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in dom f holds f . x = H1(x) ) ) by A9; ::_thesis: for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = (t1 . s) mod (t2 . s) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = (t1 . s) mod (t2 . s) ) holds b1 = b2 let f1, f2 be INT -valued Function; ::_thesis: ( dom f1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f1 holds f1 . s = (t1 . s) mod (t2 . s) ) & dom f2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f2 holds f2 . s = (t1 . s) mod (t2 . s) ) implies f1 = f2 ) assume that A12: dom f1 = (dom t1) /\ (dom t2) and A13: for s being set st s in dom f1 holds f1 . s = H1(s) and A14: dom f2 = (dom t1) /\ (dom t2) and A15: for s being set st s in dom f2 holds f2 . s = H1(s) ; ::_thesis: f1 = f2 now__::_thesis:_for_s_being_set_st_s_in_(dom_t1)_/\_(dom_t2)_holds_ f1_._s_=_f2_._s let s be set ; ::_thesis: ( s in (dom t1) /\ (dom t2) implies f1 . s = f2 . s ) assume A16: s in (dom t1) /\ (dom t2) ; ::_thesis: f1 . s = f2 . s hence f1 . s = H1(s) by A12, A13 .= f2 . s by A14, A15, A16 ; ::_thesis: verum end; hence f1 = f2 by A12, A14, FUNCT_1:2; ::_thesis: verum end; func leq (t1,t2) -> INT -valued Function means :Def5: :: AOFA_I00:def 5 ( dom it = (dom t1) /\ (dom t2) & ( for s being set st s in dom it holds it . s = IFGT ((t1 . s),(t2 . s),0,1) ) ); correctness existence ex b1 being INT -valued Function st ( dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFGT ((t1 . s),(t2 . s),0,1) ) ); uniqueness for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFGT ((t1 . s),(t2 . s),0,1) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = IFGT ((t1 . s),(t2 . s),0,1) ) holds b1 = b2; proof deffunc H1( set ) -> set = IFGT ((t1 . \$1),(t2 . \$1),0,1); consider f being Function such that A17: ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in (dom t1) /\ (dom t2) holds f . x = H1(x) ) ) from FUNCT_1:sch_3(); f is INT -valued proof let y be set ; :: according to TARSKI:def_3,RELAT_1:def_19 ::_thesis: ( not y in proj2 f or y in INT ) assume y in rng f ; ::_thesis: y in INT then consider x being set such that A18: x in dom f and A19: f . x = y by FUNCT_1:def_3; f . x = H1(x) by A17, A18; hence y in INT by A19, INT_1:def_2; ::_thesis: verum end; hence ex f being INT -valued Function st ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in dom f holds f . x = H1(x) ) ) by A17; ::_thesis: for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFGT ((t1 . s),(t2 . s),0,1) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = IFGT ((t1 . s),(t2 . s),0,1) ) holds b1 = b2 let f1, f2 be INT -valued Function; ::_thesis: ( dom f1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f1 holds f1 . s = IFGT ((t1 . s),(t2 . s),0,1) ) & dom f2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f2 holds f2 . s = IFGT ((t1 . s),(t2 . s),0,1) ) implies f1 = f2 ) assume that A20: dom f1 = (dom t1) /\ (dom t2) and A21: for s being set st s in dom f1 holds f1 . s = H1(s) and A22: dom f2 = (dom t1) /\ (dom t2) and A23: for s being set st s in dom f2 holds f2 . s = H1(s) ; ::_thesis: f1 = f2 now__::_thesis:_for_s_being_set_st_s_in_(dom_t1)_/\_(dom_t2)_holds_ f1_._s_=_f2_._s let s be set ; ::_thesis: ( s in (dom t1) /\ (dom t2) implies f1 . s = f2 . s ) assume A24: s in (dom t1) /\ (dom t2) ; ::_thesis: f1 . s = f2 . s hence f1 . s = H1(s) by A20, A21 .= f2 . s by A22, A23, A24 ; ::_thesis: verum end; hence f1 = f2 by A20, A22, FUNCT_1:2; ::_thesis: verum end; func gt (t1,t2) -> INT -valued Function means :Def6: :: AOFA_I00:def 6 ( dom it = (dom t1) /\ (dom t2) & ( for s being set st s in dom it holds it . s = IFGT ((t1 . s),(t2 . s),1,0) ) ); correctness existence ex b1 being INT -valued Function st ( dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFGT ((t1 . s),(t2 . s),1,0) ) ); uniqueness for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFGT ((t1 . s),(t2 . s),1,0) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = IFGT ((t1 . s),(t2 . s),1,0) ) holds b1 = b2; proof deffunc H1( set ) -> set = IFGT ((t1 . \$1),(t2 . \$1),1,0); consider f being Function such that A25: ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in (dom t1) /\ (dom t2) holds f . x = H1(x) ) ) from FUNCT_1:sch_3(); f is INT -valued proof let y be set ; :: according to TARSKI:def_3,RELAT_1:def_19 ::_thesis: ( not y in proj2 f or y in INT ) assume y in rng f ; ::_thesis: y in INT then consider x being set such that A26: x in dom f and A27: f . x = y by FUNCT_1:def_3; f . x = H1(x) by A25, A26; hence y in INT by A27, INT_1:def_2; ::_thesis: verum end; hence ex f being INT -valued Function st ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in dom f holds f . x = H1(x) ) ) by A25; ::_thesis: for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFGT ((t1 . s),(t2 . s),1,0) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = IFGT ((t1 . s),(t2 . s),1,0) ) holds b1 = b2 let f1, f2 be INT -valued Function; ::_thesis: ( dom f1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f1 holds f1 . s = IFGT ((t1 . s),(t2 . s),1,0) ) & dom f2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f2 holds f2 . s = IFGT ((t1 . s),(t2 . s),1,0) ) implies f1 = f2 ) assume that A28: dom f1 = (dom t1) /\ (dom t2) and A29: for s being set st s in dom f1 holds f1 . s = H1(s) and A30: dom f2 = (dom t1) /\ (dom t2) and A31: for s being set st s in dom f2 holds f2 . s = H1(s) ; ::_thesis: f1 = f2 now__::_thesis:_for_s_being_set_st_s_in_(dom_t1)_/\_(dom_t2)_holds_ f1_._s_=_f2_._s let s be set ; ::_thesis: ( s in (dom t1) /\ (dom t2) implies f1 . s = f2 . s ) assume A32: s in (dom t1) /\ (dom t2) ; ::_thesis: f1 . s = f2 . s hence f1 . s = H1(s) by A28, A29 .= f2 . s by A30, A31, A32 ; ::_thesis: verum end; hence f1 = f2 by A28, A30, FUNCT_1:2; ::_thesis: verum end; func eq (t1,t2) -> INT -valued Function means :Def7: :: AOFA_I00:def 7 ( dom it = (dom t1) /\ (dom t2) & ( for s being set st s in dom it holds it . s = IFEQ ((t1 . s),(t2 . s),1,0) ) ); correctness existence ex b1 being INT -valued Function st ( dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) ); uniqueness for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) holds b1 = b2; proof deffunc H1( set ) -> Element of NAT = IFEQ ((t1 . \$1),(t2 . \$1),1,0); consider f being Function such that A33: ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in (dom t1) /\ (dom t2) holds f . x = H1(x) ) ) from FUNCT_1:sch_3(); f is INT -valued proof let y be set ; :: according to TARSKI:def_3,RELAT_1:def_19 ::_thesis: ( not y in proj2 f or y in INT ) assume y in rng f ; ::_thesis: y in INT then consider x being set such that A34: x in dom f and A35: f . x = y by FUNCT_1:def_3; f . x = H1(x) by A33, A34; hence y in INT by A35, INT_1:def_2; ::_thesis: verum end; hence ex f being INT -valued Function st ( dom f = (dom t1) /\ (dom t2) & ( for x being set st x in dom f holds f . x = H1(x) ) ) by A33; ::_thesis: for b1, b2 being INT -valued Function st dom b1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b1 holds b1 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) & dom b2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b2 holds b2 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) holds b1 = b2 let f1, f2 be INT -valued Function; ::_thesis: ( dom f1 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f1 holds f1 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) & dom f2 = (dom t1) /\ (dom t2) & ( for s being set st s in dom f2 holds f2 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) implies f1 = f2 ) assume that A36: dom f1 = (dom t1) /\ (dom t2) and A37: for s being set st s in dom f1 holds f1 . s = H1(s) and A38: dom f2 = (dom t1) /\ (dom t2) and A39: for s being set st s in dom f2 holds f2 . s = H1(s) ; ::_thesis: f1 = f2 now__::_thesis:_for_s_being_set_st_s_in_(dom_t1)_/\_(dom_t2)_holds_ f1_._s_=_f2_._s let s be set ; ::_thesis: ( s in (dom t1) /\ (dom t2) implies f1 . s = f2 . s ) assume A40: s in (dom t1) /\ (dom t2) ; ::_thesis: f1 . s = f2 . s hence f1 . s = H1(s) by A36, A37 .= f2 . s by A38, A39, A40 ; ::_thesis: verum end; hence f1 = f2 by A36, A38, FUNCT_1:2; ::_thesis: verum end; end; :: deftheorem Def3 defines div AOFA_I00:def_3_:_ for t1, t2, b3 being INT -valued Function holds ( b3 = t1 div t2 iff ( dom b3 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b3 holds b3 . s = (t1 . s) div (t2 . s) ) ) ); :: deftheorem Def4 defines mod AOFA_I00:def_4_:_ for t1, t2, b3 being INT -valued Function holds ( b3 = t1 mod t2 iff ( dom b3 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b3 holds b3 . s = (t1 . s) mod (t2 . s) ) ) ); :: deftheorem Def5 defines leq AOFA_I00:def_5_:_ for t1, t2, b3 being INT -valued Function holds ( b3 = leq (t1,t2) iff ( dom b3 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b3 holds b3 . s = IFGT ((t1 . s),(t2 . s),0,1) ) ) ); :: deftheorem Def6 defines gt AOFA_I00:def_6_:_ for t1, t2, b3 being INT -valued Function holds ( b3 = gt (t1,t2) iff ( dom b3 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b3 holds b3 . s = IFGT ((t1 . s),(t2 . s),1,0) ) ) ); :: deftheorem Def7 defines eq AOFA_I00:def_7_:_ for t1, t2, b3 being INT -valued Function holds ( b3 = eq (t1,t2) iff ( dom b3 = (dom t1) /\ (dom t2) & ( for s being set st s in dom b3 holds b3 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) ) ); definition let X be non empty set ; let f be Function of X,INT; let x be integer number ; :: original: + redefine funcf + x -> Function of X,INT means :Def8: :: AOFA_I00:def 8 for s being Element of X holds it . s = (f . s) + x; compatibility for b1 being Function of X,INT holds ( b1 = x + f iff for s being Element of X holds b1 . s = (f . s) + x ) proof let ti be Function of X,INT; ::_thesis: ( ti = x + f iff for s being Element of X holds ti . s = (f . s) + x ) A1: dom f = X by FUNCT_2:def_1; dom (f + x) = dom f by VALUED_1:def_2; hence ( ti = f + x implies for s being Element of X holds ti . s = (f . s) + x ) by A1, VALUED_1:def_2; ::_thesis: ( ( for s being Element of X holds ti . s = (f . s) + x ) implies ti = x + f ) A2: dom ti = X by FUNCT_2:def_1; assume for s being Element of X holds ti . s = (f . s) + x ; ::_thesis: ti = x + f then for s being set st s in X holds ti . s = x + (f . s) ; hence ti = x + f by A1, A2, VALUED_1:def_2; ::_thesis: verum end; coherence x + f is Function of X,INT proof x + f is Function of X,INT ; hence x + f is Function of X,INT ; ::_thesis: verum end; :: original: - redefine funcf - x -> Function of X,INT means :: AOFA_I00:def 9 for s being Element of X holds it . s = (f . s) - x; compatibility for b1 being Function of X,INT holds ( b1 = f - x iff for s being Element of X holds b1 . s = (f . s) - x ) proof let ti be Function of X,INT; ::_thesis: ( ti = f - x iff for s being Element of X holds ti . s = (f . s) - x ) A3: dom ti = X by FUNCT_2:def_1; A4: dom f = X by FUNCT_2:def_1; hence ( ti = f - x implies for s being Element of X holds ti . s = (f . s) - x ) by VALUED_1:3; ::_thesis: ( ( for s being Element of X holds ti . s = (f . s) - x ) implies ti = f - x ) assume A5: for s being Element of X holds ti . s = (f . s) - x ; ::_thesis: ti = f - x A6: now__::_thesis:_for_s_being_set_st_s_in_dom_ti_holds_ ti_._s_=_(f_-_x)_._s let s be set ; ::_thesis: ( s in dom ti implies ti . s = (f - x) . s ) assume A7: s in dom ti ; ::_thesis: ti . s = (f - x) . s hence ti . s = (f . s) - x by A5 .= (f - x) . s by A4, A7, VALUED_1:3 ; ::_thesis: verum end; dom (f - x) = dom f by VALUED_1:3; hence ti = f - x by A4, A3, A6, FUNCT_1:2; ::_thesis: verum end; coherence f - x is Function of X,INT proof thus f - x is Function of X,INT ; ::_thesis: verum end; :: original: * redefine funcf * x -> Function of X,INT means :Def10: :: AOFA_I00:def 10 for s being Element of X holds it . s = (f . s) * x; compatibility for b1 being Function of X,INT holds ( b1 = f * x iff for s being Element of X holds b1 . s = (f . s) * x ) proof let ti be Function of X,INT; ::_thesis: ( ti = f * x iff for s being Element of X holds ti . s = (f . s) * x ) A8: dom (f * x) = dom f by VALUED_1:def_5; A9: dom f = X by FUNCT_2:def_1; hence ( ti = f * x implies for s being Element of X holds ti . s = (f . s) * x ) by A8, VALUED_1:def_5; ::_thesis: ( ( for s being Element of X holds ti . s = (f . s) * x ) implies ti = f * x ) A10: dom ti = X by FUNCT_2:def_1; assume for s being Element of X holds ti . s = (f . s) * x ; ::_thesis: ti = f * x then for s being set st s in dom (f * x) holds ti . s = x * (f . s) ; hence ti = f * x by A8, A9, A10, VALUED_1:def_5; ::_thesis: verum end; coherence f * x is Function of X,INT proof x (#) f is Function of X,INT ; hence f * x is Function of X,INT ; ::_thesis: verum end; end; :: deftheorem Def8 defines + AOFA_I00:def_8_:_ for X being non empty set for f being Function of X,INT for x being integer number for b4 being Function of X,INT holds ( b4 = f + x iff for s being Element of X holds b4 . s = (f . s) + x ); :: deftheorem defines - AOFA_I00:def_9_:_ for X being non empty set for f being Function of X,INT for x being integer number for b4 being Function of X,INT holds ( b4 = f - x iff for s being Element of X holds b4 . s = (f . s) - x ); :: deftheorem Def10 defines * AOFA_I00:def_10_:_ for X being non empty set for f being Function of X,INT for x being integer number for b4 being Function of X,INT holds ( b4 = f * x iff for s being Element of X holds b4 . s = (f . s) * x ); definition let X be set ; let f, g be Function of X,INT; :: original: div redefine funcf div g -> Function of X,INT; coherence f div g is Function of X,INT proof A1: dom g = X by FUNCT_2:def_1; A2: dom (f div g) = (dom f) /\ (dom g) by Def3; A3: dom f = X by FUNCT_2:def_1; rng (f div g) c= INT ; hence f div g is Function of X,INT by A2, A3, A1, FUNCT_2:2; ::_thesis: verum end; :: original: mod redefine funcf mod g -> Function of X,INT; coherence f mod g is Function of X,INT proof A4: dom g = X by FUNCT_2:def_1; A5: dom (f mod g) = (dom f) /\ (dom g) by Def4; A6: dom f = X by FUNCT_2:def_1; rng (f mod g) c= INT ; hence f mod g is Function of X,INT by A5, A6, A4, FUNCT_2:2; ::_thesis: verum end; :: original: leq redefine func leq (f,g) -> Function of X,INT; coherence leq (f,g) is Function of X,INT proof A7: dom g = X by FUNCT_2:def_1; A8: dom (leq (f,g)) = (dom f) /\ (dom g) by Def5; A9: dom f = X by FUNCT_2:def_1; rng (leq (f,g)) c= INT ; hence leq (f,g) is Function of X,INT by A8, A9, A7, FUNCT_2:2; ::_thesis: verum end; :: original: gt redefine func gt (f,g) -> Function of X,INT; coherence gt (f,g) is Function of X,INT proof A10: dom g = X by FUNCT_2:def_1; A11: dom (gt (f,g)) = (dom f) /\ (dom g) by Def6; A12: dom f = X by FUNCT_2:def_1; rng (gt (f,g)) c= INT ; hence gt (f,g) is Function of X,INT by A11, A12, A10, FUNCT_2:2; ::_thesis: verum end; :: original: eq redefine func eq (f,g) -> Function of X,INT; coherence eq (f,g) is Function of X,INT proof A13: dom g = X by FUNCT_2:def_1; A14: dom (eq (f,g)) = (dom f) /\ (dom g) by Def7; A15: dom f = X by FUNCT_2:def_1; rng (eq (f,g)) c= INT ; hence eq (f,g) is Function of X,INT by A14, A15, A13, FUNCT_2:2; ::_thesis: verum end; end; definition let X be non empty set ; let t1, t2 be Function of X,INT; :: original: - redefine funct1 - t2 -> Function of X,INT means :Def11: :: AOFA_I00:def 11 for s being Element of X holds it . s = (t1 . s) - (t2 . s); compatibility for b1 being Function of X,INT holds ( b1 = t1 - t2 iff for s being Element of X holds b1 . s = (t1 . s) - (t2 . s) ) proof let ti be Function of X,INT; ::_thesis: ( ti = t1 - t2 iff for s being Element of X holds ti . s = (t1 . s) - (t2 . s) ) A1: dom t1 = X by FUNCT_2:def_1; thus ( ti = t1 - t2 implies for s being Element of X holds ti . s = (t1 . s) - (t2 . s) ) by VALUED_1:15; ::_thesis: ( ( for s being Element of X holds ti . s = (t1 . s) - (t2 . s) ) implies ti = t1 - t2 ) A2: dom ti = X by FUNCT_2:def_1; assume A3: for s being Element of X holds ti . s = (t1 . s) - (t2 . s) ; ::_thesis: ti = t1 - t2 A4: now__::_thesis:_for_s_being_set_st_s_in_X_holds_ ti_._s_=_(t1_-_t2)_._s let s be set ; ::_thesis: ( s in X implies ti . s = (t1 - t2) . s ) assume A5: s in X ; ::_thesis: ti . s = (t1 - t2) . s hence ti . s = (t1 . s) - (t2 . s) by A3 .= (t1 - t2) . s by A5, VALUED_1:15 ; ::_thesis: verum end; A6: dom t2 = X by FUNCT_2:def_1; dom (t1 - t2) = (dom t1) /\ (dom t2) by VALUED_1:12; hence ti = t1 - t2 by A1, A6, A2, A4, FUNCT_1:2; ::_thesis: verum end; coherence t1 - t2 is Function of X,INT proof thus t1 - t2 is Function of X,INT ; ::_thesis: verum end; :: original: + redefine funct1 + t2 -> Function of X,INT means :: AOFA_I00:def 12 for s being Element of X holds it . s = (t1 . s) + (t2 . s); compatibility for b1 being Function of X,INT holds ( b1 = t1 + t2 iff for s being Element of X holds b1 . s = (t1 . s) + (t2 . s) ) proof let ti be Function of X,INT; ::_thesis: ( ti = t1 + t2 iff for s being Element of X holds ti . s = (t1 . s) + (t2 . s) ) A7: dom t1 = X by FUNCT_2:def_1; A8: dom t2 = X by FUNCT_2:def_1; A9: dom (t1 + t2) = (dom t1) /\ (dom t2) by VALUED_1:def_1; hence ( ti = t1 + t2 implies for s being Element of X holds ti . s = (t1 . s) + (t2 . s) ) by A7, A8, VALUED_1:def_1; ::_thesis: ( ( for s being Element of X holds ti . s = (t1 . s) + (t2 . s) ) implies ti = t1 + t2 ) A10: dom ti = X by FUNCT_2:def_1; assume for s being Element of X holds ti . s = (t1 . s) + (t2 . s) ; ::_thesis: ti = t1 + t2 then for s being set st s in X holds ti . s = (t1 . s) + (t2 . s) ; hence ti = t1 + t2 by A9, A7, A8, A10, VALUED_1:def_1; ::_thesis: verum end; coherence t1 + t2 is Function of X,INT proof thus t1 + t2 is Function of X,INT ; ::_thesis: verum end; end; :: deftheorem Def11 defines - AOFA_I00:def_11_:_ for X being non empty set for t1, t2, b4 being Function of X,INT holds ( b4 = t1 - t2 iff for s being Element of X holds b4 . s = (t1 . s) - (t2 . s) ); :: deftheorem defines + AOFA_I00:def_12_:_ for X being non empty set for t1, t2, b4 being Function of X,INT holds ( b4 = t1 + t2 iff for s being Element of X holds b4 . s = (t1 . s) + (t2 . s) ); registration let A be non empty set ; let B be infinite set ; cluster Funcs (A,B) -> infinite ; coherence not Funcs (A,B) is finite proof A1: card (card B) = card B ; card A = card (card A) ; then A2: card (Funcs (A,B)) = exp ((card B),(card A)) by A1, FUNCT_5:61; set a = the Element of A; A3: card { the Element of A} = 1 by CARD_1:30; { the Element of A} c= A by ZFMISC_1:31; then 1 c= card A by A3, CARD_1:11; then exp ((card B),1) c= card (Funcs (A,B)) by A2, CARD_2:93; hence not Funcs (A,B) is finite by CARD_2:27; ::_thesis: verum end; end; definition let N be set ; let v, f be Function; funcv ** (f,N) -> Function means :Def13: :: AOFA_I00:def 13 ( ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom it iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom it holds it . g = v . (g * f) ) ); uniqueness for b1, b2 being Function st ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom b1 iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom b1 holds b1 . g = v . (g * f) ) & ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom b2 iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom b2 holds b2 . g = v . (g * f) ) holds b1 = b2 proof let F1, F2 be Function; ::_thesis: ( ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom F1 iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom F1 holds F1 . g = v . (g * f) ) & ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom F2 iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom F2 holds F2 . g = v . (g * f) ) implies F1 = F2 ) given Y1 being set such that A1: for y being set holds ( y in Y1 iff ex h being Function st ( h in dom v & y in rng h ) ) and A2: for a being set holds ( a in dom F1 iff ( a in Funcs (N,Y1) & ex g being Function st ( a = g & g * f in dom v ) ) ) ; ::_thesis: ( ex g being Function st ( g in dom F1 & not F1 . g = v . (g * f) ) or for Y being set holds ( ex y being set st ( ( y in Y implies ex h being Function st ( h in dom v & y in rng h ) ) implies ( ex h being Function st ( h in dom v & y in rng h ) & not y in Y ) ) or ex a being set st ( ( a in dom F2 implies ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) implies ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) & not a in dom F2 ) ) ) or ex g being Function st ( g in dom F2 & not F2 . g = v . (g * f) ) or F1 = F2 ) assume A3: for g being Function st g in dom F1 holds F1 . g = v . (g * f) ; ::_thesis: ( for Y being set holds ( ex y being set st ( ( y in Y implies ex h being Function st ( h in dom v & y in rng h ) ) implies ( ex h being Function st ( h in dom v & y in rng h ) & not y in Y ) ) or ex a being set st ( ( a in dom F2 implies ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) implies ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) & not a in dom F2 ) ) ) or ex g being Function st ( g in dom F2 & not F2 . g = v . (g * f) ) or F1 = F2 ) given Y2 being set such that A4: for y being set holds ( y in Y2 iff ex h being Function st ( h in dom v & y in rng h ) ) and A5: for a being set holds ( a in dom F2 iff ( a in Funcs (N,Y2) & ex g being Function st ( a = g & g * f in dom v ) ) ) ; ::_thesis: ( ex g being Function st ( g in dom F2 & not F2 . g = v . (g * f) ) or F1 = F2 ) now__::_thesis:_for_a_being_set_holds_ (_a_in_Y1_iff_a_in_Y2_) let a be set ; ::_thesis: ( a in Y1 iff a in Y2 ) ( a in Y1 iff ex h being Function st ( h in dom v & a in rng h ) ) by A1; hence ( a in Y1 iff a in Y2 ) by A4; ::_thesis: verum end; then A6: Y1 = Y2 by TARSKI:1; now__::_thesis:_for_a_being_set_holds_ (_a_in_dom_F1_iff_a_in_dom_F2_) let a be set ; ::_thesis: ( a in dom F1 iff a in dom F2 ) ( a in dom F1 iff ( a in Funcs (N,Y1) & ex g being Function st ( a = g & g * f in dom v ) ) ) by A2; hence ( a in dom F1 iff a in dom F2 ) by A5, A6; ::_thesis: verum end; then A7: dom F1 = dom F2 by TARSKI:1; assume A8: for g being Function st g in dom F2 holds F2 . g = v . (g * f) ; ::_thesis: F1 = F2 now__::_thesis:_for_a_being_set_st_a_in_dom_F1_holds_ F1_._a_=_F2_._a let a be set ; ::_thesis: ( a in dom F1 implies F1 . a = F2 . a ) assume A9: a in dom F1 ; ::_thesis: F1 . a = F2 . a then consider g being Function such that A10: a = g and g * f in dom v by A2; thus F1 . a = v . (g * f) by A3, A9, A10 .= F2 . a by A8, A7, A9, A10 ; ::_thesis: verum end; hence F1 = F2 by A7, FUNCT_1:2; ::_thesis: verum end; existence ex b1 being Function st ( ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom b1 iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom b1 holds b1 . g = v . (g * f) ) ) proof defpred S1[ set , set ] means ex g being Function st ( g = \$1 & \$2 = v . (g * f) ); defpred S2[ set ] means ex g being Function st ( g = \$1 & g * f in dom v ); defpred S3[ set , set ] means ex g being Function st ( \$1 = g & \$2 = rng g ); A11: for x, y, z being set st S3[x,y] & S3[x,z] holds y = z ; consider X being set such that A12: for x being set holds ( x in X iff ex y being set st ( y in dom v & S3[y,x] ) ) from TARSKI:sch_1(A11); set Y = union X; consider D being set such that A13: for x being set holds ( x in D iff ( x in Funcs (N,(union X)) & S2[x] ) ) from XBOOLE_0:sch_1(); A14: for x being set st x in D holds ex y being set st S1[x,y] proof let x be set ; ::_thesis: ( x in D implies ex y being set st S1[x,y] ) assume x in D ; ::_thesis: ex y being set st S1[x,y] then consider y being Function such that A15: y = x and y * f in dom v by A13; take v . (y * f) ; ::_thesis: S1[x,v . (y * f)] thus S1[x,v . (y * f)] by A15; ::_thesis: verum end; consider F being Function such that A16: ( dom F = D & ( for g being set st g in D holds S1[g,F . g] ) ) from CLASSES1:sch_1(A14); take F ; ::_thesis: ( ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom F iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom F holds F . g = v . (g * f) ) ) hereby ::_thesis: for g being Function st g in dom F holds F . g = v . (g * f) take Y = union X; ::_thesis: ( ( for y being set holds ( ( y in Y implies ex h being Function st ( h in dom v & y in rng h ) ) & ( ex h being Function st ( h in dom v & y in rng h ) implies y in Y ) ) ) & ( for a being set holds ( a in dom F iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) hereby ::_thesis: for a being set holds ( a in dom F iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) let y be set ; ::_thesis: ( ( y in Y implies ex h being Function st ( h in dom v & y in rng h ) ) & ( ex h being Function st ( h in dom v & y in rng h ) implies y in Y ) ) hereby ::_thesis: ( ex h being Function st ( h in dom v & y in rng h ) implies y in Y ) assume y in Y ; ::_thesis: ex h being Function st ( h in dom v & y in rng h ) then consider a being set such that A17: y in a and A18: a in X by TARSKI:def_4; ex z being set st ( z in dom v & S3[z,a] ) by A12, A18; hence ex h being Function st ( h in dom v & y in rng h ) by A17; ::_thesis: verum end; given h being Function such that A19: h in dom v and A20: y in rng h ; ::_thesis: y in Y rng h in X by A12, A19; hence y in Y by A20, TARSKI:def_4; ::_thesis: verum end; let a be set ; ::_thesis: ( a in dom F iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) thus ( a in dom F iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) by A13, A16; ::_thesis: verum end; let g be Function; ::_thesis: ( g in dom F implies F . g = v . (g * f) ) assume g in dom F ; ::_thesis: F . g = v . (g * f) then S1[g,F . g] by A16; hence F . g = v . (g * f) ; ::_thesis: verum end; end; :: deftheorem Def13 defines ** AOFA_I00:def_13_:_ for N being set for v, f, b4 being Function holds ( b4 = v ** (f,N) iff ( ex Y being set st ( ( for y being set holds ( y in Y iff ex h being Function st ( h in dom v & y in rng h ) ) ) & ( for a being set holds ( a in dom b4 iff ( a in Funcs (N,Y) & ex g being Function st ( a = g & g * f in dom v ) ) ) ) ) & ( for g being Function st g in dom b4 holds b4 . g = v . (g * f) ) ) ); definition let X, Y, Z, N be non empty set ; let v be Element of Funcs ((Funcs (X,Y)),Z); let f be Function of X,N; :: original: ** redefine funcv ** (f,N) -> Element of Funcs ((Funcs (N,Y)),Z); coherence v ** (f,N) is Element of Funcs ((Funcs (N,Y)),Z) proof consider Y0 being set such that A1: for y being set holds ( y in Y0 iff ex h being Function st ( h in dom v & y in rng h ) ) and A2: for a being set holds ( a in dom (v ** (f,N)) iff ( a in Funcs (N,Y0) & ex g being Function st ( a = g & g * f in dom v ) ) ) by Def13; A3: dom v = Funcs (X,Y) by FUNCT_2:def_1; A4: Y0 = Y proof thus Y0 c= Y :: according to XBOOLE_0:def_10 ::_thesis: Y c= Y0 proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in Y0 or y in Y ) assume y in Y0 ; ::_thesis: y in Y then consider h being Function such that A5: h in dom v and A6: y in rng h by A1; rng h c= Y by A5, FUNCT_2:92; hence y in Y by A6; ::_thesis: verum end; let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in Y or y in Y0 ) assume y in Y ; ::_thesis: y in Y0 then reconsider y = y as Element of Y ; reconsider h = X --> y as Function of X,Y ; A7: rng h = {y} by FUNCOP_1:8; A8: h in Funcs (X,Y) by FUNCT_2:8; y in {y} by TARSKI:def_1; hence y in Y0 by A3, A1, A7, A8; ::_thesis: verum end; A9: dom (v ** (f,N)) = Funcs (N,Y) proof thus dom (v ** (f,N)) c= Funcs (N,Y) :: according to XBOOLE_0:def_10 ::_thesis: Funcs (N,Y) c= dom (v ** (f,N)) proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in dom (v ** (f,N)) or a in Funcs (N,Y) ) thus ( not a in dom (v ** (f,N)) or a in Funcs (N,Y) ) by A2, A4; ::_thesis: verum end; let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in Funcs (N,Y) or a in dom (v ** (f,N)) ) assume A10: a in Funcs (N,Y) ; ::_thesis: a in dom (v ** (f,N)) then reconsider g = a as Function of N,Y by FUNCT_2:66; g * f in Funcs (X,Y) by FUNCT_2:8; hence a in dom (v ** (f,N)) by A3, A2, A4, A10; ::_thesis: verum end; rng (v ** (f,N)) c= Z proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in rng (v ** (f,N)) or a in Z ) assume a in rng (v ** (f,N)) ; ::_thesis: a in Z then consider g being set such that A11: g in dom (v ** (f,N)) and A12: a = (v ** (f,N)) . g by FUNCT_1:def_3; reconsider g = g as Element of Funcs (N,Y) by A9, A11; reconsider gf = g * f as Element of Funcs (X,Y) by FUNCT_2:8; a = v . gf by A11, A12, Def13; hence a in Z ; ::_thesis: verum end; hence v ** (f,N) is Element of Funcs ((Funcs (N,Y)),Z) by A9, FUNCT_2:def_2; ::_thesis: verum end; end; theorem Th3: :: AOFA_I00:3 for f1, f2, g being Function st rng g c= dom f2 holds (f1 +* f2) * g = f2 * g proof let f1, f2, g be Function; ::_thesis: ( rng g c= dom f2 implies (f1 +* f2) * g = f2 * g ) assume A1: rng g c= dom f2 ; ::_thesis: (f1 +* f2) * g = f2 * g A2: now__::_thesis:_for_x_being_set_st_x_in_dom_g_holds_ ((f1_+*_f2)_*_g)_._x_=_(f2_*_g)_._x let x be set ; ::_thesis: ( x in dom g implies ((f1 +* f2) * g) . x = (f2 * g) . x ) assume A3: x in dom g ; ::_thesis: ((f1 +* f2) * g) . x = (f2 * g) . x then A4: (f2 * g) . x = f2 . (g . x) by FUNCT_1:13; A5: g . x in rng g by A3, FUNCT_1:3; ((f1 +* f2) * g) . x = (f1 +* f2) . (g . x) by A3, FUNCT_1:13; hence ((f1 +* f2) * g) . x = (f2 * g) . x by A1, A4, A5, FUNCT_4:13; ::_thesis: verum end; dom (f1 +* f2) = (dom f1) \/ (dom f2) by FUNCT_4:def_1; then A6: dom ((f1 +* f2) * g) = dom g by A1, RELAT_1:27, XBOOLE_1:10; dom (f2 * g) = dom g by A1, RELAT_1:27; hence (f1 +* f2) * g = f2 * g by A6, A2, FUNCT_1:2; ::_thesis: verum end; theorem Th4: :: AOFA_I00:4 for X, N, I being non empty set for s being Function of X,I for c being Function of X,N st c is one-to-one holds for n being Element of I holds (N --> n) +* (s * (c ")) is Function of N,I proof let X, N, I be non empty set ; ::_thesis: for s being Function of X,I for c being Function of X,N st c is one-to-one holds for n being Element of I holds (N --> n) +* (s * (c ")) is Function of N,I let s be Function of X,I; ::_thesis: for c being Function of X,N st c is one-to-one holds for n being Element of I holds (N --> n) +* (s * (c ")) is Function of N,I let c be Function of X,N; ::_thesis: ( c is one-to-one implies for n being Element of I holds (N --> n) +* (s * (c ")) is Function of N,I ) assume c is one-to-one ; ::_thesis: for n being Element of I holds (N --> n) +* (s * (c ")) is Function of N,I then A1: dom (c ") = rng c by FUNCT_1:33; let n be Element of I; ::_thesis: (N --> n) +* (s * (c ")) is Function of N,I set f = N --> n; set g = s * (c "); A2: dom (s * (c ")) c= dom (c ") by RELAT_1:25; rng (s * (c ")) c= rng s by RELAT_1:26; then rng (s * (c ")) c= I by XBOOLE_1:1; then A3: (rng (N --> n)) \/ (rng (s * (c "))) c= I by XBOOLE_1:8; A4: dom (N --> n) = N by FUNCOP_1:13; A5: rng ((N --> n) +* (s * (c "))) c= (rng (N --> n)) \/ (rng (s * (c "))) by FUNCT_4:17; dom ((N --> n) +* (s * (c "))) = (dom (N --> n)) \/ (dom (s * (c "))) by FUNCT_4:def_1; then dom ((N --> n) +* (s * (c "))) = N by A2, A4, A1, XBOOLE_1:1, XBOOLE_1:12; hence (N --> n) +* (s * (c ")) is Function of N,I by A5, A3, FUNCT_2:2, XBOOLE_1:1; ::_thesis: verum end; theorem Th5: :: AOFA_I00:5 for N, X, I being non empty set for v1, v2 being Function st dom v1 = dom v2 & dom v1 = Funcs (X,I) holds for f being Function of X,N st f is one-to-one & v1 ** (f,N) = v2 ** (f,N) holds v1 = v2 proof let N, X, I be non empty set ; ::_thesis: for v1, v2 being Function st dom v1 = dom v2 & dom v1 = Funcs (X,I) holds for f being Function of X,N st f is one-to-one & v1 ** (f,N) = v2 ** (f,N) holds v1 = v2 let v1, v2 be Function; ::_thesis: ( dom v1 = dom v2 & dom v1 = Funcs (X,I) implies for f being Function of X,N st f is one-to-one & v1 ** (f,N) = v2 ** (f,N) holds v1 = v2 ) assume that A1: dom v1 = dom v2 and A2: dom v1 = Funcs (X,I) ; ::_thesis: for f being Function of X,N st f is one-to-one & v1 ** (f,N) = v2 ** (f,N) holds v1 = v2 reconsider rv1 = rng v1, rv2 = rng v2 as non empty set by A1, A2, RELAT_1:42; reconsider Z = rv1 \/ rv2 as non empty set ; A3: rng v2 c= Z by XBOOLE_1:7; rng v1 c= Z by XBOOLE_1:7; then reconsider f1 = v1, f2 = v2 as Element of Funcs ((Funcs (X,I)),Z) by A1, A2, A3, FUNCT_2:def_2; let f be Function of X,N; ::_thesis: ( f is one-to-one & v1 ** (f,N) = v2 ** (f,N) implies v1 = v2 ) assume that A4: f is one-to-one and A5: v1 ** (f,N) = v2 ** (f,N) ; ::_thesis: v1 = v2 A6: dom (f2 ** (f,N)) = Funcs (N,I) by FUNCT_2:def_1; A7: dom (f1 ** (f,N)) = Funcs (N,I) by FUNCT_2:def_1; now__::_thesis:_for_a_being_set_st_a_in_Funcs_(X,I)_holds_ v1_._a_=_v2_._a set i = the Element of I; let a be set ; ::_thesis: ( a in Funcs (X,I) implies v1 . a = v2 . a ) A8: dom f = X by FUNCT_2:def_1; assume a in Funcs (X,I) ; ::_thesis: v1 . a = v2 . a then reconsider h = a as Element of Funcs (X,I) ; set g = (N --> the Element of I) +* (h * (f ")); A9: dom h = X by FUNCT_2:def_1; rng (f ") = dom f by A4, FUNCT_1:33; then dom (h * (f ")) = dom (f ") by A9, RELAT_1:27 .= rng f by A4, FUNCT_1:33 ; then A10: ((N --> the Element of I) +* (h * (f "))) * f = (h * (f ")) * f by Th3 .= h * ((f ") * f) by RELAT_1:36 .= h * (id X) by A4, A8, FUNCT_1:39 .= a by A9, RELAT_1:52 ; (N --> the Element of I) +* (h * (f ")) is Function of N,I by A4, Th4; then A11: (N --> the Element of I) +* (h * (f ")) in Funcs (N,I) by FUNCT_2:8; then (v1 ** (f,N)) . ((N --> the Element of I) +* (h * (f "))) = v1 . a by A7, A10, Def13; hence v1 . a = v2 . a by A5, A6, A11, A10, Def13; ::_thesis: verum end; hence v1 = v2 by A1, A2, FUNCT_1:2; ::_thesis: verum end; registration let X be set ; cluster Relation-like X -defined card X -valued Function-like one-to-one quasi_total onto for Element of bool [:X,(card X):]; existence ex b1 being Function of X,(card X) st ( b1 is one-to-one & b1 is onto ) proof X, card X are_equipotent by CARD_1:def_2; then consider f being Function such that A1: f is one-to-one and A2: dom f = X and A3: rng f = card X by WELLORD2:def_4; reconsider f = f as Function of X,(card X) by A2, A3, FUNCT_2:2; take f ; ::_thesis: ( f is one-to-one & f is onto ) thus f is one-to-one by A1; ::_thesis: f is onto thus rng f = card X by A3; :: according to FUNCT_2:def_3 ::_thesis: verum end; cluster Relation-like card X -defined X -valued Function-like one-to-one quasi_total onto for Element of bool [:(card X),X:]; existence ex b1 being Function of (card X),X st ( b1 is one-to-one & b1 is onto ) proof X, card X are_equipotent by CARD_1:def_2; then consider f being Function such that A4: f is one-to-one and A5: dom f = card X and A6: rng f = X by WELLORD2:def_4; reconsider f = f as Function of (card X),X by A5, A6, FUNCT_2:2; take f ; ::_thesis: ( f is one-to-one & f is onto ) thus f is one-to-one by A4; ::_thesis: f is onto thus rng f = X by A6; :: according to FUNCT_2:def_3 ::_thesis: verum end; end; definition let X be set ; mode Enumeration of X is one-to-one onto Function of X,(card X); mode Denumeration of X is one-to-one onto Function of (card X),X; end; theorem Th6: :: AOFA_I00:6 for X being set for f being Function holds ( f is Enumeration of X iff ( dom f = X & rng f = card X & f is one-to-one ) ) proof let X be set ; ::_thesis: for f being Function holds ( f is Enumeration of X iff ( dom f = X & rng f = card X & f is one-to-one ) ) let f be Function; ::_thesis: ( f is Enumeration of X iff ( dom f = X & rng f = card X & f is one-to-one ) ) ( card X = {} implies X = {} ) ; hence ( f is Enumeration of X iff ( dom f = X & rng f = card X & f is one-to-one ) ) by FUNCT_2:2, FUNCT_2:def_1, FUNCT_2:def_3; ::_thesis: verum end; theorem Th7: :: AOFA_I00:7 for X being set for f being Function holds ( f is Denumeration of X iff ( dom f = card X & rng f = X & f is one-to-one ) ) proof let X be set ; ::_thesis: for f being Function holds ( f is Denumeration of X iff ( dom f = card X & rng f = X & f is one-to-one ) ) let f be Function; ::_thesis: ( f is Denumeration of X iff ( dom f = card X & rng f = X & f is one-to-one ) ) ( X = {} implies card X = {} ) ; hence ( f is Denumeration of X iff ( dom f = card X & rng f = X & f is one-to-one ) ) by FUNCT_2:2, FUNCT_2:def_1, FUNCT_2:def_3; ::_thesis: verum end; theorem Th8: :: AOFA_I00:8 for X being non empty set for x, y being Element of X for f being Enumeration of X holds (f +* (x,(f . y))) +* (y,(f . x)) is Enumeration of X proof let X be non empty set ; ::_thesis: for x, y being Element of X for f being Enumeration of X holds (f +* (x,(f . y))) +* (y,(f . x)) is Enumeration of X let x, y be Element of X; ::_thesis: for f being Enumeration of X holds (f +* (x,(f . y))) +* (y,(f . x)) is Enumeration of X let f be Enumeration of X; ::_thesis: (f +* (x,(f . y))) +* (y,(f . x)) is Enumeration of X set g = (f +* (x,(f . y))) +* (y,(f . x)); set A = dom ((f +* (x,(f . y))) +* (y,(f . x))); A1: dom (f +* (x,(f . y))) = dom f by FUNCT_7:30; A2: dom ((f +* (x,(f . y))) +* (y,(f . x))) = dom (f +* (x,(f . y))) by FUNCT_7:30; A3: dom f = X by Th6; A4: rng f = card X by Th6; A5: rng ((f +* (x,(f . y))) +* (y,(f . x))) = rng f proof {(f . x)} c= rng f by A4, ZFMISC_1:31; then A6: (rng f) \/ {(f . x)} = rng f by XBOOLE_1:12; A7: rng ((f +* (x,(f . y))) +* (y,(f . x))) c= (rng (f +* (x,(f . y)))) \/ {(f . x)} by FUNCT_7:100; {(f . y)} c= rng f by A4, ZFMISC_1:31; then (rng f) \/ {(f . y)} = rng f by XBOOLE_1:12; then (rng (f +* (x,(f . y)))) \/ {(f . x)} c= rng f by A6, FUNCT_7:100, XBOOLE_1:9; hence rng ((f +* (x,(f . y))) +* (y,(f . x))) c= rng f by A7, XBOOLE_1:1; :: according to XBOOLE_0:def_10 ::_thesis: rng f c= rng ((f +* (x,(f . y))) +* (y,(f . x))) let z be set ; :: according to TARSKI:def_3 ::_thesis: ( not z in rng f or z in rng ((f +* (x,(f . y))) +* (y,(f . x))) ) assume z in rng f ; ::_thesis: z in rng ((f +* (x,(f . y))) +* (y,(f . x))) then consider a being set such that A8: a in dom f and A9: z = f . a by FUNCT_1:def_3; percases ( ( a <> x & a <> y ) or a = x or a = y ) ; supposeA10: ( a <> x & a <> y ) ; ::_thesis: z in rng ((f +* (x,(f . y))) +* (y,(f . x))) then A11: ((f +* (x,(f . y))) +* (y,(f . x))) . a = (f +* (x,(f . y))) . a by FUNCT_7:32; (f +* (x,(f . y))) . a = z by A9, A10, FUNCT_7:32; hence z in rng ((f +* (x,(f . y))) +* (y,(f . x))) by A1, A2, A8, A11, FUNCT_1:def_3; ::_thesis: verum end; suppose a = x ; ::_thesis: z in rng ((f +* (x,(f . y))) +* (y,(f . x))) then ((f +* (x,(f . y))) +* (y,(f . x))) . y = z by A1, A3, A9, FUNCT_7:31; hence z in rng ((f +* (x,(f . y))) +* (y,(f . x))) by A1, A2, A3, FUNCT_1:def_3; ::_thesis: verum end; supposeA12: a = y ; ::_thesis: z in rng ((f +* (x,(f . y))) +* (y,(f . x))) then A13: ( x <> y implies ((f +* (x,(f . y))) +* (y,(f . x))) . x = (f +* (x,z)) . x ) by A9, FUNCT_7:32; A14: (f +* (x,z)) . x = z by A3, FUNCT_7:31; ( x = y implies ((f +* (x,(f . y))) +* (y,(f . x))) . x = z ) by A1, A3, A9, A12, FUNCT_7:31; hence z in rng ((f +* (x,(f . y))) +* (y,(f . x))) by A1, A2, A3, A14, A13, FUNCT_1:def_3; ::_thesis: verum end; end; end; (f +* (x,(f . y))) +* (y,(f . x)) is one-to-one proof let a, b be set ; :: according to FUNCT_1:def_4 ::_thesis: ( not a in proj1 ((f +* (x,(f . y))) +* (y,(f . x))) or not b in proj1 ((f +* (x,(f . y))) +* (y,(f . x))) or not ((f +* (x,(f . y))) +* (y,(f . x))) . a = ((f +* (x,(f . y))) +* (y,(f . x))) . b or a = b ) A15: ( a <> y implies ((f +* (x,(f . y))) +* (y,(f . x))) . a = (f +* (x,(f . y))) . a ) by FUNCT_7:32; A16: ( a <> x implies (f +* (x,(f . y))) . a = f . a ) by FUNCT_7:32; A17: ( b = y implies ((f +* (x,(f . y))) +* (y,(f . x))) . b = f . x ) by A1, A3, FUNCT_7:31; A18: ( b <> y implies ((f +* (x,(f . y))) +* (y,(f . x))) . b = (f +* (x,(f . y))) . b ) by FUNCT_7:32; A19: ( b = x implies (f +* (x,(f . y))) . b = f . y ) by A3, FUNCT_7:31; A20: ( a = x implies (f +* (x,(f . y))) . a = f . y ) by A3, FUNCT_7:31; A21: ( b <> x implies (f +* (x,(f . y))) . b = f . b ) by FUNCT_7:32; ( a = y implies ((f +* (x,(f . y))) +* (y,(f . x))) . a = f . x ) by A1, A3, FUNCT_7:31; hence ( not a in proj1 ((f +* (x,(f . y))) +* (y,(f . x))) or not b in proj1 ((f +* (x,(f . y))) +* (y,(f . x))) or not ((f +* (x,(f . y))) +* (y,(f . x))) . a = ((f +* (x,(f . y))) +* (y,(f . x))) . b or a = b ) by A2, A3, A15, A20, A16, A17, A18, A19, A21, FUNCT_1:def_4; ::_thesis: verum end; hence (f +* (x,(f . y))) +* (y,(f . x)) is Enumeration of X by A1, A2, A3, A4, A5, Th6; ::_thesis: verum end; theorem :: AOFA_I00:9 for X being non empty set for x being Element of X ex f being Enumeration of X st f . x = 0 proof let X be non empty set ; ::_thesis: for x being Element of X ex f being Enumeration of X st f . x = 0 let x be Element of X; ::_thesis: ex f being Enumeration of X st f . x = 0 set f = the Enumeration of X; A1: 0 in card X by ORDINAL3:8; A2: rng the Enumeration of X = card X by Th6; dom the Enumeration of X = X by Th6; then consider y being set such that A3: y in X and A4: 0 = the Enumeration of X . y by A1, A2, FUNCT_1:def_3; reconsider y = y as Element of X by A3; reconsider g = ( the Enumeration of X +* (y,( the Enumeration of X . x))) +* (x,0) as Enumeration of X by A4, Th8; take g ; ::_thesis: g . x = 0 dom the Enumeration of X = X by Th6; then dom ( the Enumeration of X +* (y,( the Enumeration of X . x))) = X by FUNCT_7:30; hence g . x = 0 by FUNCT_7:31; ::_thesis: verum end; theorem :: AOFA_I00:10 for X being non empty set for f being Denumeration of X holds f . 0 in X by FUNCT_2:5, ORDINAL3:8; theorem Th11: :: AOFA_I00:11 for X being countable set for f being Enumeration of X holds rng f c= NAT proof let X be countable set ; ::_thesis: for f being Enumeration of X holds rng f c= NAT let f be Enumeration of X; ::_thesis: rng f c= NAT card X c= NAT by CARD_3:def_14; hence rng f c= NAT by Th6; ::_thesis: verum end; definition let X be set ; let f be Enumeration of X; :: original: " redefine funcf " -> Denumeration of X; coherence f " is Denumeration of X proof rng f = card X by Th6; then A1: dom (f ") = card X by FUNCT_1:33; dom f = X by Th6; then rng (f ") = X by FUNCT_1:33; hence f " is Denumeration of X by A1, Th7; ::_thesis: verum end; end; definition let X be set ; let f be Denumeration of X; :: original: " redefine funcf " -> Enumeration of X; coherence f " is Enumeration of X proof rng f = X by Th7; then A1: dom (f ") = X by FUNCT_1:33; dom f = card X by Th7; then rng (f ") = card X by FUNCT_1:33; hence f " is Enumeration of X by A1, Th6; ::_thesis: verum end; end; theorem :: AOFA_I00:12 for n, m being Nat holds 0 to_power (n + m) = (0 to_power n) * (0 to_power m) proof let n, m be Nat; ::_thesis: 0 to_power (n + m) = (0 to_power n) * (0 to_power m) percases ( n > 0 or m > 0 or ( n = 0 & m = 0 ) ) ; supposeA1: ( n > 0 or m > 0 ) ; ::_thesis: 0 to_power (n + m) = (0 to_power n) * (0 to_power m) then ( 0 to_power n = 0 or 0 to_power m = 0 ) by POWER:def_2; hence 0 to_power (n + m) = (0 to_power n) * (0 to_power m) by A1, POWER:def_2; ::_thesis: verum end; supposeA2: ( n = 0 & m = 0 ) ; ::_thesis: 0 to_power (n + m) = (0 to_power n) * (0 to_power m) then 0 to_power (n + m) = 1 by POWER:24; hence 0 to_power (n + m) = (0 to_power n) * (0 to_power m) by A2; ::_thesis: verum end; end; end; theorem :: AOFA_I00:13 for x being real number for n, m being Nat holds (x to_power n) to_power m = x to_power (n * m) by NEWTON:9; begin definition let X be non empty set ; mode INT-Variable of X is Function of (Funcs (X,INT)),X; mode INT-Expression of X is Function of (Funcs (X,INT)),INT; mode INT-Array of X is Function of INT,X; end; definition let A be preIfWhileAlgebra; let I be Element of A; let X be non empty set ; let T be Subset of (Funcs (X,INT)); let f be ExecutionFunction of A, Funcs (X,INT),T; predI is_assignment_wrt A,X,f means :Def14: :: AOFA_I00:def 14 ( I in ElementaryInstructions A & ex v being INT-Variable of X ex t being INT-Expression of X st for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ); end; :: deftheorem Def14 defines is_assignment_wrt AOFA_I00:def_14_:_ for A being preIfWhileAlgebra for I being Element of A for X being non empty set for T being Subset of (Funcs (X,INT)) for f being ExecutionFunction of A, Funcs (X,INT),T holds ( I is_assignment_wrt A,X,f iff ( I in ElementaryInstructions A & ex v being INT-Variable of X ex t being INT-Expression of X st for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ); definition let A be preIfWhileAlgebra; let X be non empty set ; let T be Subset of (Funcs (X,INT)); let f be ExecutionFunction of A, Funcs (X,INT),T; let v be INT-Variable of X; let t be INT-Expression of X; predv,t form_assignment_wrt f means :Def15: :: AOFA_I00:def 15 ex I being Element of A st ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ); end; :: deftheorem Def15 defines form_assignment_wrt AOFA_I00:def_15_:_ for A being preIfWhileAlgebra for X being non empty set for T being Subset of (Funcs (X,INT)) for f being ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of X for t being INT-Expression of X holds ( v,t form_assignment_wrt f iff ex I being Element of A st ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) ); definition let A be preIfWhileAlgebra; let X be non empty set ; let T be Subset of (Funcs (X,INT)); let f be ExecutionFunction of A, Funcs (X,INT),T; assume B1: ex I being Element of A st I is_assignment_wrt A,X,f ; mode INT-Variable of A,f -> INT-Variable of X means :: AOFA_I00:def 16 ex t being INT-Expression of X st it,t form_assignment_wrt f; existence ex b1 being INT-Variable of X ex t being INT-Expression of X st b1,t form_assignment_wrt f proof consider I being Element of A such that A1: I is_assignment_wrt A,X,f by B1; consider v being INT-Variable of X, t being INT-Expression of X such that A2: for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) by A1, Def14; take v ; ::_thesis: ex t being INT-Expression of X st v,t form_assignment_wrt f take t ; ::_thesis: v,t form_assignment_wrt f take I ; :: according to AOFA_I00:def_15 ::_thesis: ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) thus ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) by A1, A2, Def14; ::_thesis: verum end; end; :: deftheorem defines INT-Variable AOFA_I00:def_16_:_ for A being preIfWhileAlgebra for X being non empty set for T being Subset of (Funcs (X,INT)) for f being ExecutionFunction of A, Funcs (X,INT),T st ex I being Element of A st I is_assignment_wrt A,X,f holds for b5 being INT-Variable of X holds ( b5 is INT-Variable of A,f iff ex t being INT-Expression of X st b5,t form_assignment_wrt f ); definition let A be preIfWhileAlgebra; let X be non empty set ; let T be Subset of (Funcs (X,INT)); let f be ExecutionFunction of A, Funcs (X,INT),T; assume B1: ex I being Element of A st I is_assignment_wrt A,X,f ; mode INT-Expression of A,f -> INT-Expression of X means :: AOFA_I00:def 17 ex v being INT-Variable of X st v,it form_assignment_wrt f; existence ex b1 being INT-Expression of X ex v being INT-Variable of X st v,b1 form_assignment_wrt f proof consider I being Element of A such that A1: I is_assignment_wrt A,X,f by B1; consider v being INT-Variable of X, t being INT-Expression of X such that A2: for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) by A1, Def14; take t ; ::_thesis: ex v being INT-Variable of X st v,t form_assignment_wrt f take v ; ::_thesis: v,t form_assignment_wrt f take I ; :: according to AOFA_I00:def_15 ::_thesis: ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) thus ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) by A1, A2, Def14; ::_thesis: verum end; end; :: deftheorem defines INT-Expression AOFA_I00:def_17_:_ for A being preIfWhileAlgebra for X being non empty set for T being Subset of (Funcs (X,INT)) for f being ExecutionFunction of A, Funcs (X,INT),T st ex I being Element of A st I is_assignment_wrt A,X,f holds for b5 being INT-Expression of X holds ( b5 is INT-Expression of A,f iff ex v being INT-Variable of X st v,b5 form_assignment_wrt f ); definition let X, Y be non empty set ; let f be Element of Funcs (X,Y); let x be Element of X; :: original: . redefine funcf . x -> Element of Y; coherence f . x is Element of Y proof f . x in rng f by FUNCT_2:4; hence f . x is Element of Y ; ::_thesis: verum end; end; definition let X be non empty set ; let x be Element of X; func . x -> INT-Expression of X means :Def18: :: AOFA_I00:def 18 for s being Element of Funcs (X,INT) holds it . s = s . x; correctness existence ex b1 being INT-Expression of X st for s being Element of Funcs (X,INT) holds b1 . s = s . x; uniqueness for b1, b2 being INT-Expression of X st ( for s being Element of Funcs (X,INT) holds b1 . s = s . x ) & ( for s being Element of Funcs (X,INT) holds b2 . s = s . x ) holds b1 = b2; proof deffunc H1( Element of Funcs (X,INT)) -> Element of INT = \$1 . x; thus ex f being Function of (Funcs (X,INT)),INT st for x being Element of Funcs (X,INT) holds f . x = H1(x) from FUNCT_2:sch_4(); ::_thesis: for b1, b2 being INT-Expression of X st ( for s being Element of Funcs (X,INT) holds b1 . s = s . x ) & ( for s being Element of Funcs (X,INT) holds b2 . s = s . x ) holds b1 = b2 let f1, f2 be INT-Expression of X; ::_thesis: ( ( for s being Element of Funcs (X,INT) holds f1 . s = s . x ) & ( for s being Element of Funcs (X,INT) holds f2 . s = s . x ) implies f1 = f2 ) assume that A1: for s being Element of Funcs (X,INT) holds f1 . s = s . x and A2: for s being Element of Funcs (X,INT) holds f2 . s = s . x ; ::_thesis: f1 = f2 now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_f1_._s_=_f2_._s let s be Element of Funcs (X,INT); ::_thesis: f1 . s = f2 . s thus f1 . s = s . x by A1 .= f2 . s by A2 ; ::_thesis: verum end; hence f1 = f2 by FUNCT_2:63; ::_thesis: verum end; end; :: deftheorem Def18 defines . AOFA_I00:def_18_:_ for X being non empty set for x being Element of X for b3 being INT-Expression of X holds ( b3 = . x iff for s being Element of Funcs (X,INT) holds b3 . s = s . x ); definition let X be non empty set ; let v be INT-Variable of X; func . v -> INT-Expression of X means :Def19: :: AOFA_I00:def 19 for s being Element of Funcs (X,INT) holds it . s = s . (v . s); correctness existence ex b1 being INT-Expression of X st for s being Element of Funcs (X,INT) holds b1 . s = s . (v . s); uniqueness for b1, b2 being INT-Expression of X st ( for s being Element of Funcs (X,INT) holds b1 . s = s . (v . s) ) & ( for s being Element of Funcs (X,INT) holds b2 . s = s . (v . s) ) holds b1 = b2; proof deffunc H1( Element of Funcs (X,INT)) -> Element of INT = \$1 . (v . \$1); thus ex f being Function of (Funcs (X,INT)),INT st for x being Element of Funcs (X,INT) holds f . x = H1(x) from FUNCT_2:sch_4(); ::_thesis: for b1, b2 being INT-Expression of X st ( for s being Element of Funcs (X,INT) holds b1 . s = s . (v . s) ) & ( for s being Element of Funcs (X,INT) holds b2 . s = s . (v . s) ) holds b1 = b2 let f1, f2 be INT-Expression of X; ::_thesis: ( ( for s being Element of Funcs (X,INT) holds f1 . s = s . (v . s) ) & ( for s being Element of Funcs (X,INT) holds f2 . s = s . (v . s) ) implies f1 = f2 ) assume that A1: for s being Element of Funcs (X,INT) holds f1 . s = s . (v . s) and A2: for s being Element of Funcs (X,INT) holds f2 . s = s . (v . s) ; ::_thesis: f1 = f2 now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_f1_._s_=_f2_._s let s be Element of Funcs (X,INT); ::_thesis: f1 . s = f2 . s thus f1 . s = s . (v . s) by A1 .= f2 . s by A2 ; ::_thesis: verum end; hence f1 = f2 by FUNCT_2:63; ::_thesis: verum end; end; :: deftheorem Def19 defines . AOFA_I00:def_19_:_ for X being non empty set for v being INT-Variable of X for b3 being INT-Expression of X holds ( b3 = . v iff for s being Element of Funcs (X,INT) holds b3 . s = s . (v . s) ); definition let X be non empty set ; let x be Element of X; func ^ x -> INT-Variable of X equals :: AOFA_I00:def 20 (Funcs (X,INT)) --> x; correctness coherence (Funcs (X,INT)) --> x is INT-Variable of X; ; end; :: deftheorem defines ^ AOFA_I00:def_20_:_ for X being non empty set for x being Element of X holds ^ x = (Funcs (X,INT)) --> x; theorem :: AOFA_I00:14 for X being non empty set for x being Element of X holds . x = . (^ x) proof let X be non empty set ; ::_thesis: for x being Element of X holds . x = . (^ x) let x be Element of X; ::_thesis: . x = . (^ x) for s being Element of Funcs (X,INT) holds (. (^ x)) . s = s . x proof let s be Element of Funcs (X,INT); ::_thesis: (. (^ x)) . s = s . x thus (. (^ x)) . s = s . ((^ x) . s) by Def19 .= s . x by FUNCOP_1:7 ; ::_thesis: verum end; hence . x = . (^ x) by Def18; ::_thesis: verum end; definition let X be non empty set ; let i be integer number ; func . (i,X) -> INT-Expression of X equals :: AOFA_I00:def 21 (Funcs (X,INT)) --> i; correctness coherence (Funcs (X,INT)) --> i is INT-Expression of X; proof i in INT by INT_1:def_2; hence (Funcs (X,INT)) --> i is INT-Expression of X by FUNCOP_1:45; ::_thesis: verum end; end; :: deftheorem defines . AOFA_I00:def_21_:_ for X being non empty set for i being integer number holds . (i,X) = (Funcs (X,INT)) --> i; theorem :: AOFA_I00:15 for X being non empty set for t being INT-Expression of X holds ( t + (. (0,X)) = t & t (#) (. (1,X)) = t ) proof let X be non empty set ; ::_thesis: for t being INT-Expression of X holds ( t + (. (0,X)) = t & t (#) (. (1,X)) = t ) let t be INT-Expression of X; ::_thesis: ( t + (. (0,X)) = t & t (#) (. (1,X)) = t ) now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_(t_+_(._(0,X)))_._s_=_t_._s let s be Element of Funcs (X,INT); ::_thesis: (t + (. (0,X))) . s = t . s A1: (. (0,X)) . s = 0 by FUNCOP_1:7; dom (t + (. (0,X))) = Funcs (X,INT) by FUNCT_2:def_1; hence (t + (. (0,X))) . s = (t . s) + ((. (0,X)) . s) by VALUED_1:def_1 .= t . s by A1 ; ::_thesis: verum end; hence t + (. (0,X)) = t by FUNCT_2:63; ::_thesis: t (#) (. (1,X)) = t now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_(t_(#)_(._(1,X)))_._s_=_t_._s let s be Element of Funcs (X,INT); ::_thesis: (t (#) (. (1,X))) . s = t . s dom (t (#) (. (1,X))) = Funcs (X,INT) by FUNCT_2:def_1; hence (t (#) (. (1,X))) . s = (t . s) * ((. (1,X)) . s) by VALUED_1:def_4 .= (t . s) * 1 by FUNCOP_1:7 .= t . s ; ::_thesis: verum end; hence t (#) (. (1,X)) = t by FUNCT_2:63; ::_thesis: verum end; definition let A be preIfWhileAlgebra; let X be non empty set ; let T be Subset of (Funcs (X,INT)); let f be ExecutionFunction of A, Funcs (X,INT),T; attrf is Euclidean means :Def22: :: AOFA_I00:def 22 ( ( for v being INT-Variable of A,f for t being INT-Expression of A,f holds v,t form_assignment_wrt f ) & ( for i being integer number holds . (i,X) is INT-Expression of A,f ) & ( for v being INT-Variable of A,f holds . v is INT-Expression of A,f ) & ( for x being Element of X holds ^ x is INT-Variable of A,f ) & ex a being INT-Array of X st ( a | (card X) is one-to-one & ( for t being INT-Expression of A,f holds a * t is INT-Variable of A,f ) ) & ( for t being INT-Expression of A,f holds - t is INT-Expression of A,f ) & ( for t1, t2 being INT-Expression of A,f holds ( t1 (#) t2 is INT-Expression of A,f & t1 + t2 is INT-Expression of A,f & t1 div t2 is INT-Expression of A,f & t1 mod t2 is INT-Expression of A,f & leq (t1,t2) is INT-Expression of A,f & gt (t1,t2) is INT-Expression of A,f ) ) ); end; :: deftheorem Def22 defines Euclidean AOFA_I00:def_22_:_ for A being preIfWhileAlgebra for X being non empty set for T being Subset of (Funcs (X,INT)) for f being ExecutionFunction of A, Funcs (X,INT),T holds ( f is Euclidean iff ( ( for v being INT-Variable of A,f for t being INT-Expression of A,f holds v,t form_assignment_wrt f ) & ( for i being integer number holds . (i,X) is INT-Expression of A,f ) & ( for v being INT-Variable of A,f holds . v is INT-Expression of A,f ) & ( for x being Element of X holds ^ x is INT-Variable of A,f ) & ex a being INT-Array of X st ( a | (card X) is one-to-one & ( for t being INT-Expression of A,f holds a * t is INT-Variable of A,f ) ) & ( for t being INT-Expression of A,f holds - t is INT-Expression of A,f ) & ( for t1, t2 being INT-Expression of A,f holds ( t1 (#) t2 is INT-Expression of A,f & t1 + t2 is INT-Expression of A,f & t1 div t2 is INT-Expression of A,f & t1 mod t2 is INT-Expression of A,f & leq (t1,t2) is INT-Expression of A,f & gt (t1,t2) is INT-Expression of A,f ) ) ) ); definition let A be preIfWhileAlgebra; attrA is Euclidean means :Def23: :: AOFA_I00:def 23 for X being non empty countable set for T being Subset of (Funcs (X,INT)) ex f being ExecutionFunction of A, Funcs (X,INT),T st f is Euclidean ; end; :: deftheorem Def23 defines Euclidean AOFA_I00:def_23_:_ for A being preIfWhileAlgebra holds ( A is Euclidean iff for X being non empty countable set for T being Subset of (Funcs (X,INT)) ex f being ExecutionFunction of A, Funcs (X,INT),T st f is Euclidean ); definition func INT-ElemIns -> infinite disjoint_with_NAT set equals :: AOFA_I00:def 24 [:(Funcs ((Funcs (NAT,INT)),NAT)),(Funcs ((Funcs (NAT,INT)),INT)):]; coherence [:(Funcs ((Funcs (NAT,INT)),NAT)),(Funcs ((Funcs (NAT,INT)),INT)):] is infinite disjoint_with_NAT set ; end; :: deftheorem defines INT-ElemIns AOFA_I00:def_24_:_ INT-ElemIns = [:(Funcs ((Funcs (NAT,INT)),NAT)),(Funcs ((Funcs (NAT,INT)),INT)):]; definition mode INT-Exec -> ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (NAT,INT),(Funcs (NAT,INT)) \ (0,0) means :Def25: :: AOFA_I00:def 25 for s being Element of Funcs (NAT,INT) for v being Element of Funcs ((Funcs (NAT,INT)),NAT) for e being Element of Funcs ((Funcs (NAT,INT)),INT) holds it . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)); existence ex b1 being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (NAT,INT),(Funcs (NAT,INT)) \ (0,0) st for s being Element of Funcs (NAT,INT) for v being Element of Funcs ((Funcs (NAT,INT)),NAT) for e being Element of Funcs ((Funcs (NAT,INT)),INT) holds b1 . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) proof reconsider i0 = 0 as Element of INT by INT_1:def_1; set Q = Funcs (NAT,INT); set T = (Funcs (NAT,INT)) \ (0,0); set S = ECIW-signature ; set G = INT-ElemIns ; set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); A1: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; reconsider q0 = NAT --> i0 as Element of Funcs (NAT,INT) by FUNCT_2:8; defpred S1[ set , set ] means ex s being Element of Funcs (NAT,INT) ex v being Element of Funcs ((Funcs (NAT,INT)),NAT) ex e being Element of Funcs ((Funcs (NAT,INT)),INT) st ( \$1 = [s,(root-tree [v,e])] & \$2 = s +* ((v . s),(e . s)) ); A2: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; A3: for x being set st x in [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] holds ex y being set st ( y in Funcs (NAT,INT) & S1[x,y] ) proof let x be set ; ::_thesis: ( x in [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] implies ex y being set st ( y in Funcs (NAT,INT) & S1[x,y] ) ) assume x in [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] ; ::_thesis: ex y being set st ( y in Funcs (NAT,INT) & S1[x,y] ) then consider s, I being set such that A4: s in Funcs (NAT,INT) and A5: I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) and A6: x = [s,I] by ZFMISC_1:def_2; reconsider s = s as Element of Funcs (NAT,INT) by A4; consider a being Symbol of (DTConUA (ECIW-signature,INT-ElemIns)) such that A7: I = root-tree a and A8: a in Terminals (DTConUA (ECIW-signature,INT-ElemIns)) by A2, A5; consider v, e being set such that A9: v in Funcs ((Funcs (NAT,INT)),NAT) and A10: e in Funcs ((Funcs (NAT,INT)),INT) and A11: a = [v,e] by A1, A8, ZFMISC_1:def_2; reconsider e = e as Element of Funcs ((Funcs (NAT,INT)),INT) by A10; reconsider v = v as Element of Funcs ((Funcs (NAT,INT)),NAT) by A9; take y = s +* ((v . s),(e . s)); ::_thesis: ( y in Funcs (NAT,INT) & S1[x,y] ) thus y in Funcs (NAT,INT) by FUNCT_2:8; ::_thesis: S1[x,y] take s ; ::_thesis: ex v being Element of Funcs ((Funcs (NAT,INT)),NAT) ex e being Element of Funcs ((Funcs (NAT,INT)),INT) st ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) take v ; ::_thesis: ex e being Element of Funcs ((Funcs (NAT,INT)),INT) st ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) take e ; ::_thesis: ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) thus ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) by A6, A7, A11; ::_thesis: verum end; consider g being Function such that A12: ( dom g = [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] & rng g c= Funcs (NAT,INT) ) and A13: for x being set st x in [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] holds S1[x,g . x] from FUNCT_1:sch_5(A3); reconsider g = g as Function of [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):],(Funcs (NAT,INT)) by A12, FUNCT_2:2; consider f being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (NAT,INT),(Funcs (NAT,INT)) \ (0,0) such that A14: f | [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] = g and for s being Element of Funcs (NAT,INT) for C, I being Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) st not f iteration_terminates_for I \; C,f . (s,C) holds f . (s,(while (C,I))) = q0 by AOFA_000:91; take f ; ::_thesis: for s being Element of Funcs (NAT,INT) for v being Element of Funcs ((Funcs (NAT,INT)),NAT) for e being Element of Funcs ((Funcs (NAT,INT)),INT) holds f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) let s be Element of Funcs (NAT,INT); ::_thesis: for v being Element of Funcs ((Funcs (NAT,INT)),NAT) for e being Element of Funcs ((Funcs (NAT,INT)),INT) holds f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) let v be Element of Funcs ((Funcs (NAT,INT)),NAT); ::_thesis: for e being Element of Funcs ((Funcs (NAT,INT)),INT) holds f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) let e be Element of Funcs ((Funcs (NAT,INT)),INT); ::_thesis: f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) set I = root-tree [v,e]; [v,e] in INT-ElemIns by ZFMISC_1:87; then root-tree [v,e] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A2, A1; then A15: [s,(root-tree [v,e])] in [:(Funcs (NAT,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] by ZFMISC_1:87; then consider s9 being Element of Funcs (NAT,INT), v9 being Element of Funcs ((Funcs (NAT,INT)),NAT), e9 being Element of Funcs ((Funcs (NAT,INT)),INT) such that A16: [s,(root-tree [v,e])] = [s9,(root-tree [v9,e9])] and A17: g . [s,(root-tree [v,e])] = s9 +* ((v9 . s9),(e9 . s9)) by A13; root-tree [v,e] = root-tree [v9,e9] by A16, XTUPLE_0:1; then A18: [v,e] = [v9,e9] by TREES_4:4; then A19: v = v9 by XTUPLE_0:1; A20: e = e9 by A18, XTUPLE_0:1; s = s9 by A16, XTUPLE_0:1; hence f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) by A14, A15, A17, A19, A20, FUNCT_1:49; ::_thesis: verum end; end; :: deftheorem Def25 defines INT-Exec AOFA_I00:def_25_:_ for b1 being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (NAT,INT),(Funcs (NAT,INT)) \ (0,0) holds ( b1 is INT-Exec iff for s being Element of Funcs (NAT,INT) for v being Element of Funcs ((Funcs (NAT,INT)),NAT) for e being Element of Funcs ((Funcs (NAT,INT)),INT) holds b1 . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) ); definition let X be non empty set ; func INT-ElemIns X -> infinite disjoint_with_NAT set equals :: AOFA_I00:def 26 [:(Funcs ((Funcs (X,INT)),X)),(Funcs ((Funcs (X,INT)),INT)):]; coherence [:(Funcs ((Funcs (X,INT)),X)),(Funcs ((Funcs (X,INT)),INT)):] is infinite disjoint_with_NAT set ; end; :: deftheorem defines INT-ElemIns AOFA_I00:def_26_:_ for X being non empty set holds INT-ElemIns X = [:(Funcs ((Funcs (X,INT)),X)),(Funcs ((Funcs (X,INT)),INT)):]; definition let X be non empty set ; let x be Element of X; mode INT-Exec of x -> ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)), Funcs (X,INT),(Funcs (X,INT)) \ (x,0) means :: AOFA_I00:def 27 for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds it . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)); existence ex b1 being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)), Funcs (X,INT),(Funcs (X,INT)) \ (x,0) st for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds b1 . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) proof reconsider i0 = 0 as Element of INT by INT_1:def_1; set Q = Funcs (X,INT); set T = (Funcs (X,INT)) \ (x,0); set S = ECIW-signature ; set G = INT-ElemIns X; set A = FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)); A1: Terminals (DTConUA (ECIW-signature,(INT-ElemIns X))) = INT-ElemIns X by FREEALG:3; reconsider q0 = X --> i0 as Element of Funcs (X,INT) by FUNCT_2:8; defpred S1[ set , set ] means ex s being Element of Funcs (X,INT) ex v being Element of Funcs ((Funcs (X,INT)),X) ex e being Element of Funcs ((Funcs (X,INT)),INT) st ( \$1 = [s,(root-tree [v,e])] & \$2 = s +* ((v . s),(e . s)) ); A2: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X))) = FreeGenSetNSG (ECIW-signature,(INT-ElemIns X)) by AOFA_000:70; A3: for x being set st x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):] holds ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) proof let x be set ; ::_thesis: ( x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):] implies ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) ) assume x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):] ; ::_thesis: ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) then consider s, I being set such that A4: s in Funcs (X,INT) and A5: I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X))) and A6: x = [s,I] by ZFMISC_1:def_2; reconsider s = s as Element of Funcs (X,INT) by A4; consider a being Symbol of (DTConUA (ECIW-signature,(INT-ElemIns X))) such that A7: I = root-tree a and A8: a in Terminals (DTConUA (ECIW-signature,(INT-ElemIns X))) by A2, A5; consider v, e being set such that A9: v in Funcs ((Funcs (X,INT)),X) and A10: e in Funcs ((Funcs (X,INT)),INT) and A11: a = [v,e] by A1, A8, ZFMISC_1:def_2; reconsider e = e as Element of Funcs ((Funcs (X,INT)),INT) by A10; reconsider v = v as Element of Funcs ((Funcs (X,INT)),X) by A9; take y = s +* ((v . s),(e . s)); ::_thesis: ( y in Funcs (X,INT) & S1[x,y] ) thus y in Funcs (X,INT) by FUNCT_2:8; ::_thesis: S1[x,y] take s ; ::_thesis: ex v being Element of Funcs ((Funcs (X,INT)),X) ex e being Element of Funcs ((Funcs (X,INT)),INT) st ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) take v ; ::_thesis: ex e being Element of Funcs ((Funcs (X,INT)),INT) st ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) take e ; ::_thesis: ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) thus ( x = [s,(root-tree [v,e])] & y = s +* ((v . s),(e . s)) ) by A6, A7, A11; ::_thesis: verum end; consider g being Function such that A12: ( dom g = [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):] & rng g c= Funcs (X,INT) ) and A13: for x being set st x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):] holds S1[x,g . x] from FUNCT_1:sch_5(A3); reconsider g = g as Function of [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):],(Funcs (X,INT)) by A12, FUNCT_2:2; consider f being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)), Funcs (X,INT),(Funcs (X,INT)) \ (x,0) such that A14: f | [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):] = g and for s being Element of Funcs (X,INT) for C, I being Element of (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X))) st not f iteration_terminates_for I \; C,f . (s,C) holds f . (s,(while (C,I))) = q0 by AOFA_000:91; take f ; ::_thesis: for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) let s be Element of Funcs (X,INT); ::_thesis: for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) let v be Element of Funcs ((Funcs (X,INT)),X); ::_thesis: for e being Element of Funcs ((Funcs (X,INT)),INT) holds f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) let e be Element of Funcs ((Funcs (X,INT)),INT); ::_thesis: f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) set I = root-tree [v,e]; [v,e] in INT-ElemIns X by ZFMISC_1:87; then root-tree [v,e] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X))) by A2, A1; then A15: [s,(root-tree [v,e])] in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)))):] by ZFMISC_1:87; then consider s9 being Element of Funcs (X,INT), v9 being Element of Funcs ((Funcs (X,INT)),X), e9 being Element of Funcs ((Funcs (X,INT)),INT) such that A16: [s,(root-tree [v,e])] = [s9,(root-tree [v9,e9])] and A17: g . [s,(root-tree [v,e])] = s9 +* ((v9 . s9),(e9 . s9)) by A13; root-tree [v,e] = root-tree [v9,e9] by A16, XTUPLE_0:1; then A18: [v,e] = [v9,e9] by TREES_4:4; then A19: v = v9 by XTUPLE_0:1; A20: e = e9 by A18, XTUPLE_0:1; s = s9 by A16, XTUPLE_0:1; hence f . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) by A14, A15, A17, A19, A20, FUNCT_1:49; ::_thesis: verum end; end; :: deftheorem defines INT-Exec AOFA_I00:def_27_:_ for X being non empty set for x being Element of X for b3 being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,(INT-ElemIns X)), Funcs (X,INT),(Funcs (X,INT)) \ (x,0) holds ( b3 is INT-Exec of x iff for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds b3 . (s,(root-tree [v,e])) = s +* ((v . s),(e . s)) ); definition let X be non empty set ; let T be Subset of (Funcs (X,INT)); let c be Enumeration of X; assume A1: rng c c= NAT ; mode INT-Exec of c,T -> ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (X,INT),T means :Def28: :: AOFA_I00:def 28 for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds it . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)); existence ex b1 being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (X,INT),T st for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds b1 . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)) proof dom c = X by Th6; then reconsider c9 = c as Function of X,NAT by A1, FUNCT_2:2; reconsider i0 = 0 as Element of INT by INT_1:def_1; set Q = Funcs (X,INT); set S = ECIW-signature ; set G = INT-ElemIns ; set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); reconsider q0 = X --> i0 as Element of Funcs (X,INT) by FUNCT_2:8; A1: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; defpred S1[ set , set ] means ex s being Element of Funcs (X,INT) st ( \$1 `1 = s & ( ( \$2 = s & ( for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds not \$1 `2 = root-tree [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] ) ) or ex v being Element of Funcs ((Funcs (X,INT)),X) ex e being Element of Funcs ((Funcs (X,INT)),INT) st ( \$1 `2 = root-tree [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] & \$2 = s +* ((v . s),(e . s)) ) ) ); A2: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; A3: for x being set st x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] holds ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) proof let x be set ; ::_thesis: ( x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] implies ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) ) assume x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] ; ::_thesis: ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) then consider s, I being set such that A4: s in Funcs (X,INT) and A5: I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) and A6: x = [s,I] by ZFMISC_1:def_2; A7: x `1 = s by A6, MCART_1:7; reconsider s = s as Element of Funcs (X,INT) by A4; A8: x `2 = I by A6, MCART_1:7; consider a being Symbol of (DTConUA (ECIW-signature,INT-ElemIns)) such that A9: I = root-tree a and a in Terminals (DTConUA (ECIW-signature,INT-ElemIns)) by A2, A5; percases ( ex v being Element of Funcs ((Funcs (X,INT)),X) ex e being Element of Funcs ((Funcs (X,INT)),INT) st a = [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] or for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds not a = [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] ) ; suppose ex v being Element of Funcs ((Funcs (X,INT)),X) ex e being Element of Funcs ((Funcs (X,INT)),INT) st a = [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] ; ::_thesis: ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) then consider v being Element of Funcs ((Funcs (X,INT)),X), e being Element of Funcs ((Funcs (X,INT)),INT) such that A10: a = [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] ; take y = s +* ((v . s),(e . s)); ::_thesis: ( y in Funcs (X,INT) & S1[x,y] ) thus y in Funcs (X,INT) by FUNCT_2:8; ::_thesis: S1[x,y] thus S1[x,y] by A7, A8, A9, A10; ::_thesis: verum end; supposeA11: for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds not a = [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] ; ::_thesis: ex y being set st ( y in Funcs (X,INT) & S1[x,y] ) take y = s; ::_thesis: ( y in Funcs (X,INT) & S1[x,y] ) thus y in Funcs (X,INT) ; ::_thesis: S1[x,y] for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds not x `2 = root-tree [((c * v) ** (c9,NAT)),(e ** (c9,NAT))] by A8, A9, A11, TREES_4:4; hence S1[x,y] by A7; ::_thesis: verum end; end; end; consider g being Function such that A12: ( dom g = [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] & rng g c= Funcs (X,INT) ) and A13: for x being set st x in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] holds S1[x,g . x] from FUNCT_1:sch_5(A3); reconsider g = g as Function of [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):],(Funcs (X,INT)) by A12, FUNCT_2:2; consider f being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (X,INT),T such that A14: f | [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] = g and for s being Element of Funcs (X,INT) for C, I being Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) st not f iteration_terminates_for I \; C,f . (s,C) holds f . (s,(while (C,I))) = q0 by AOFA_000:91; take f ; ::_thesis: for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds f . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)) let s be Element of Funcs (X,INT); ::_thesis: for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds f . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)) let v be Element of Funcs ((Funcs (X,INT)),X); ::_thesis: for e being Element of Funcs ((Funcs (X,INT)),INT) holds f . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)) let e be Element of Funcs ((Funcs (X,INT)),INT); ::_thesis: f . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)) reconsider vv = v as Function of (Funcs (X,INT)),X ; reconsider cv = c9 * vv as Element of Funcs ((Funcs (X,INT)),NAT) by FUNCT_2:8; set v0 = cv ** (c9,NAT); set e0 = e ** (c9,NAT); set I = root-tree [(cv ** (c9,NAT)),(e ** (c9,NAT))]; [(cv ** (c9,NAT)),(e ** (c9,NAT))] in INT-ElemIns by ZFMISC_1:87; then root-tree [(cv ** (c9,NAT)),(e ** (c9,NAT))] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A2, A1; then A15: [s,(root-tree [(cv ** (c9,NAT)),(e ** (c9,NAT))])] in [:(Funcs (X,INT)),(ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns))):] by ZFMISC_1:87; then S1[[s,(root-tree [(cv ** (c9,NAT)),(e ** (c9,NAT))])],g . [s,(root-tree [(cv ** (c9,NAT)),(e ** (c9,NAT))])]] by A13; then consider v9 being Element of Funcs ((Funcs (X,INT)),X), e9 being Element of Funcs ((Funcs (X,INT)),INT) such that A16: [s,(root-tree [(cv ** (c9,NAT)),(e ** (c9,NAT))])] `2 = root-tree [((c * v9) ** (c9,NAT)),(e9 ** (c9,NAT))] and A17: g . [s,(root-tree [(cv ** (c9,NAT)),(e ** (c9,NAT))])] = s +* ((v9 . s),(e9 . s)) ; A18: dom (c9 * v9) = Funcs (X,INT) by FUNCT_2:def_1; A19: dom e = Funcs (X,INT) by FUNCT_2:def_1; A20: dom v = Funcs (X,INT) by FUNCT_2:def_1; A21: dom cv = Funcs (X,INT) by FUNCT_2:def_1; A22: dom c9 = X by FUNCT_2:def_1; A23: rng v c= X ; A24: dom e9 = Funcs (X,INT) by FUNCT_2:def_1; A25: dom v9 = Funcs (X,INT) by FUNCT_2:def_1; A26: [(cv ** (c9,NAT)),(e ** (c9,NAT))] = [((c * v9) ** (c9,NAT)),(e9 ** (c9,NAT))] by A16, TREES_4:4; then cv ** (c9,NAT) = (c * v9) ** (c9,NAT) by XTUPLE_0:1; then A27: cv = c * v9 by A21, A18, Th5; e ** (c9,NAT) = e9 ** (c9,NAT) by A26, XTUPLE_0:1; then A28: e = e9 by A19, A24, Th5; rng v9 c= X ; then v = v9 by A23, A22, A25, A20, A27, FUNCT_1:27; hence f . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)) by A14, A15, A17, A28, FUNCT_1:49; ::_thesis: verum end; end; :: deftheorem Def28 defines INT-Exec AOFA_I00:def_28_:_ for X being non empty set for T being Subset of (Funcs (X,INT)) for c being Enumeration of X st rng c c= NAT holds for b4 being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (X,INT),T holds ( b4 is INT-Exec of c,T iff for s being Element of Funcs (X,INT) for v being Element of Funcs ((Funcs (X,INT)),X) for e being Element of Funcs ((Funcs (X,INT)),INT) holds b4 . (s,(root-tree [((c * v) ** (c,NAT)),(e ** (c,NAT))])) = s +* ((v . s),(e . s)) ); theorem Th16: :: AOFA_I00:16 for f being INT-Exec for v being INT-Variable of NAT for t being INT-Expression of NAT holds v,t form_assignment_wrt f proof let f be INT-Exec ; ::_thesis: for v being INT-Variable of NAT for t being INT-Expression of NAT holds v,t form_assignment_wrt f set S = ECIW-signature ; set G = INT-ElemIns ; set X = NAT ; set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); let v be INT-Variable of NAT; ::_thesis: for t being INT-Expression of NAT holds v,t form_assignment_wrt f let t be INT-Expression of NAT; ::_thesis: v,t form_assignment_wrt f reconsider v9 = v as Element of Funcs ((Funcs (NAT,INT)),NAT) by FUNCT_2:8; reconsider t9 = t as Element of Funcs ((Funcs (NAT,INT)),INT) by FUNCT_2:8; A1: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; A2: [v9,t9] in INT-ElemIns by ZFMISC_1:87; A3: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; then root-tree [v9,t9] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A2; then reconsider I = root-tree [v9,t9] as Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) ; take I ; :: according to AOFA_I00:def_15 ::_thesis: ( I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) & ( for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) thus I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A3, A1, A2; ::_thesis: for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),(t . s)) thus for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),(t . s)) by Def25; ::_thesis: verum end; theorem Th17: :: AOFA_I00:17 for f being INT-Exec for v being INT-Variable of NAT holds v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f proof set t = the INT-Expression of NAT; let f be INT-Exec ; ::_thesis: for v being INT-Variable of NAT holds v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f set S = ECIW-signature ; set G = INT-ElemIns ; set X = NAT ; set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); let v be INT-Variable of NAT; ::_thesis: v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f A1: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; reconsider t9 = the INT-Expression of NAT as Element of Funcs ((Funcs (NAT,INT)),INT) by FUNCT_2:8; reconsider v9 = v as Element of Funcs ((Funcs (NAT,INT)),NAT) by FUNCT_2:8; A2: [v9,t9] in INT-ElemIns by ZFMISC_1:87; A3: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; then root-tree [v9,t9] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A2; then reconsider I = root-tree [v9,t9] as Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) ; hereby :: according to AOFA_I00:def_16 ::_thesis: ex t being INT-Expression of NAT st v,t form_assignment_wrt f take I = I; ::_thesis: I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), NAT ,f thus I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), NAT ,f ::_thesis: verum proof thus I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A3, A1, A2; :: according to AOFA_I00:def_14 ::_thesis: ex v being INT-Variable of NAT ex t being INT-Expression of NAT st for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),(t . s)) take v ; ::_thesis: ex t being INT-Expression of NAT st for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),(t . s)) take the INT-Expression of NAT ; ::_thesis: for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),( the INT-Expression of NAT . s)) thus for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),( the INT-Expression of NAT . s)) by Def25; ::_thesis: verum end; end; take the INT-Expression of NAT ; ::_thesis: v, the INT-Expression of NAT form_assignment_wrt f thus v, the INT-Expression of NAT form_assignment_wrt f by Th16; ::_thesis: verum end; theorem Th18: :: AOFA_I00:18 for f being INT-Exec for t being INT-Expression of NAT holds t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f proof set v = the INT-Variable of NAT; let f be INT-Exec ; ::_thesis: for t being INT-Expression of NAT holds t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f set S = ECIW-signature ; set G = INT-ElemIns ; set X = NAT ; set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); let t be INT-Expression of NAT; ::_thesis: t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f A1: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; reconsider t9 = t as Element of Funcs ((Funcs (NAT,INT)),INT) by FUNCT_2:8; reconsider v9 = the INT-Variable of NAT as Element of Funcs ((Funcs (NAT,INT)),NAT) by FUNCT_2:8; A2: [v9,t9] in INT-ElemIns by ZFMISC_1:87; A3: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; then root-tree [v9,t9] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A2; then reconsider I = root-tree [v9,t9] as Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) ; hereby :: according to AOFA_I00:def_17 ::_thesis: ex v being INT-Variable of NAT st v,t form_assignment_wrt f take I = I; ::_thesis: I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), NAT ,f thus I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), NAT ,f ::_thesis: verum proof thus I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A3, A1, A2; :: according to AOFA_I00:def_14 ::_thesis: ex v being INT-Variable of NAT ex t being INT-Expression of NAT st for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* ((v . s),(t . s)) take the INT-Variable of NAT ; ::_thesis: ex t being INT-Expression of NAT st for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* (( the INT-Variable of NAT . s),(t . s)) take t ; ::_thesis: for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* (( the INT-Variable of NAT . s),(t . s)) thus for s being Element of Funcs (NAT,INT) holds f . (s,I) = s +* (( the INT-Variable of NAT . s),(t . s)) by Def25; ::_thesis: verum end; end; take the INT-Variable of NAT ; ::_thesis: the INT-Variable of NAT,t form_assignment_wrt f thus the INT-Variable of NAT,t form_assignment_wrt f by Th16; ::_thesis: verum end; registration cluster -> Euclidean for INT-Exec ; coherence for b1 being INT-Exec holds b1 is Euclidean proof set X = NAT ; set a = (INT --> 0) +* (id NAT); A1: dom (id NAT) = NAT by RELAT_1:45; A2: INT \/ NAT = INT by NUMBERS:17, XBOOLE_1:12; dom (INT --> 0) = INT by FUNCOP_1:13; then A3: dom ((INT --> 0) +* (id NAT)) = INT by A1, A2, FUNCT_4:def_1; A4: rng (id NAT) = NAT by RELAT_1:45; {0} c= NAT by ZFMISC_1:31; then A5: {0} \/ NAT = NAT by XBOOLE_1:12; rng (INT --> 0) = {0} by FUNCOP_1:8; then rng ((INT --> 0) +* (id NAT)) c= NAT by A4, A5, FUNCT_4:17; then reconsider a = (INT --> 0) +* (id NAT) as INT-Array of NAT by A3, FUNCT_2:2; let f be INT-Exec ; ::_thesis: f is Euclidean set S = ECIW-signature ; set G = INT-ElemIns ; set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); thus for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds v,t form_assignment_wrt f by Th16; :: according to AOFA_I00:def_22 ::_thesis: ( ( for i being integer number holds . (i,NAT) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds . v is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for x being Element of NAT holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ex a being INT-Array of NAT st ( a | (card NAT) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) thus for i being integer number holds . (i,NAT) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th18; ::_thesis: ( ( for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds . v is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for x being Element of NAT holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ex a being INT-Array of NAT st ( a | (card NAT) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) thus for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds . v is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th18; ::_thesis: ( ( for x being Element of NAT holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ex a being INT-Array of NAT st ( a | (card NAT) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) thus for x being Element of NAT holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th17; ::_thesis: ( ex a being INT-Array of NAT st ( a | (card NAT) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) hereby ::_thesis: ( ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) take a = a; ::_thesis: ( a | (card NAT) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) dom (id NAT) = NAT by RELAT_1:45; hence a | (card NAT) is one-to-one by CARD_1:47, FUNCT_4:23; ::_thesis: for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f thus for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th17; ::_thesis: verum end; thus ( ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) by Th18; ::_thesis: verum end; end; theorem Th19: :: AOFA_I00:19 for X being non empty countable set for T being Subset of (Funcs (X,INT)) for c being Enumeration of X for f being INT-Exec of c,T for v being INT-Variable of X for t being INT-Expression of X holds v,t form_assignment_wrt f proof set S = ECIW-signature ; set G = INT-ElemIns ; let X be non empty countable set ; ::_thesis: for T being Subset of (Funcs (X,INT)) for c being Enumeration of X for f being INT-Exec of c,T for v being INT-Variable of X for t being INT-Expression of X holds v,t form_assignment_wrt f let T be Subset of (Funcs (X,INT)); ::_thesis: for c being Enumeration of X for f being INT-Exec of c,T for v being INT-Variable of X for t being INT-Expression of X holds v,t form_assignment_wrt f let c be Enumeration of X; ::_thesis: for f being INT-Exec of c,T for v being INT-Variable of X for t being INT-Expression of X holds v,t form_assignment_wrt f set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); let f be INT-Exec of c,T; ::_thesis: for v being INT-Variable of X for t being INT-Expression of X holds v,t form_assignment_wrt f let v be INT-Variable of X; ::_thesis: for t being INT-Expression of X holds v,t form_assignment_wrt f let t be INT-Expression of X; ::_thesis: v,t form_assignment_wrt f reconsider v9 = v as Element of Funcs ((Funcs (X,INT)),X) by FUNCT_2:8; reconsider t9 = t as Element of Funcs ((Funcs (X,INT)),INT) by FUNCT_2:8; A1: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; A2: rng c c= NAT by Th11; dom c = X by Th6; then reconsider c9 = c as Function of X,NAT by A2, FUNCT_2:2; reconsider cv = c9 * v as Element of Funcs ((Funcs (X,INT)),NAT) by FUNCT_2:8; set v1 = cv ** (c9,NAT); set t1 = t9 ** (c9,NAT); A3: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; A4: [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] in INT-ElemIns by ZFMISC_1:87; then root-tree [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A3; then reconsider I = root-tree [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] as Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) ; take I ; :: according to AOFA_I00:def_15 ::_thesis: ( I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) for s being Element of Funcs (X,INT) holds f . (s,(root-tree [((c * v9) ** (c,NAT)),(t9 ** (c,NAT))])) = s +* ((v9 . s),(t9 . s)) by A2, Def28; hence ( I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) by A1, A3, A4; ::_thesis: verum end; theorem Th20: :: AOFA_I00:20 for X being non empty countable set for T being Subset of (Funcs (X,INT)) for c being Enumeration of X for f being INT-Exec of c,T for v being INT-Variable of X holds v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f proof set S = ECIW-signature ; set G = INT-ElemIns ; let X be non empty countable set ; ::_thesis: for T being Subset of (Funcs (X,INT)) for c being Enumeration of X for f being INT-Exec of c,T for v being INT-Variable of X holds v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f let T be Subset of (Funcs (X,INT)); ::_thesis: for c being Enumeration of X for f being INT-Exec of c,T for v being INT-Variable of X holds v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f let c be Enumeration of X; ::_thesis: for f being INT-Exec of c,T for v being INT-Variable of X holds v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); let f be INT-Exec of c,T; ::_thesis: for v being INT-Variable of X holds v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f let v be INT-Variable of X; ::_thesis: v is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f set t = the INT-Expression of X; A1: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; A2: rng c c= NAT by Th11; dom c = X by Th6; then reconsider c9 = c as Function of X,NAT by A2, FUNCT_2:2; reconsider cv = c9 * v as Element of Funcs ((Funcs (X,INT)),NAT) by FUNCT_2:8; reconsider v9 = v as Element of Funcs ((Funcs (X,INT)),X) by FUNCT_2:8; reconsider t9 = the INT-Expression of X as Element of Funcs ((Funcs (X,INT)),INT) by FUNCT_2:8; A3: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; set v1 = cv ** (c9,NAT); set t1 = t9 ** (c9,NAT); A4: [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] in INT-ElemIns by ZFMISC_1:87; then root-tree [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A3; then reconsider I = root-tree [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] as Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) ; hereby :: according to AOFA_I00:def_16 ::_thesis: ex t being INT-Expression of X st v,t form_assignment_wrt f take I = I; ::_thesis: I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),X,f thus I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),X,f ::_thesis: verum proof thus I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A3, A4; :: according to AOFA_I00:def_14 ::_thesis: ex v being INT-Variable of X ex t being INT-Expression of X st for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) take v ; ::_thesis: ex t being INT-Expression of X st for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) take the INT-Expression of X ; ::_thesis: for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),( the INT-Expression of X . s)) for s being Element of Funcs (X,INT) holds f . (s,(root-tree [((c * v9) ** (c,NAT)),(t9 ** (c,NAT))])) = s +* ((v9 . s),(t9 . s)) by A2, Def28; hence for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),( the INT-Expression of X . s)) ; ::_thesis: verum end; end; take the INT-Expression of X ; ::_thesis: v, the INT-Expression of X form_assignment_wrt f thus v, the INT-Expression of X form_assignment_wrt f by Th19; ::_thesis: verum end; theorem Th21: :: AOFA_I00:21 for X being non empty countable set for T being Subset of (Funcs (X,INT)) for c being Enumeration of X for f being INT-Exec of c,T for t being INT-Expression of X holds t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f proof set S = ECIW-signature ; set G = INT-ElemIns ; let X be non empty countable set ; ::_thesis: for T being Subset of (Funcs (X,INT)) for c being Enumeration of X for f being INT-Exec of c,T for t being INT-Expression of X holds t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f let T be Subset of (Funcs (X,INT)); ::_thesis: for c being Enumeration of X for f being INT-Exec of c,T for t being INT-Expression of X holds t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f let c be Enumeration of X; ::_thesis: for f being INT-Exec of c,T for t being INT-Expression of X holds t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); let f be INT-Exec of c,T; ::_thesis: for t being INT-Expression of X holds t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f set v = the INT-Variable of X; let t be INT-Expression of X; ::_thesis: t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f A1: ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) = FreeGenSetNSG (ECIW-signature,INT-ElemIns) by AOFA_000:70; A2: rng c c= NAT by Th11; dom c = X by Th6; then reconsider c9 = c as Function of X,NAT by A2, FUNCT_2:2; reconsider cv = c9 * the INT-Variable of X as Element of Funcs ((Funcs (X,INT)),NAT) by FUNCT_2:8; reconsider v9 = the INT-Variable of X as Element of Funcs ((Funcs (X,INT)),X) by FUNCT_2:8; reconsider t9 = t as Element of Funcs ((Funcs (X,INT)),INT) by FUNCT_2:8; A3: Terminals (DTConUA (ECIW-signature,INT-ElemIns)) = INT-ElemIns by FREEALG:3; set v1 = cv ** (c9,NAT); set t1 = t9 ** (c9,NAT); A4: [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] in INT-ElemIns by ZFMISC_1:87; then root-tree [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A3; then reconsider I = root-tree [(cv ** (c9,NAT)),(t9 ** (c9,NAT))] as Element of (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) ; hereby :: according to AOFA_I00:def_17 ::_thesis: ex v being INT-Variable of X st v,t form_assignment_wrt f take I = I; ::_thesis: I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),X,f thus I is_assignment_wrt FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),X,f ::_thesis: verum proof thus I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,INT-ElemIns)) by A1, A3, A4; :: according to AOFA_I00:def_14 ::_thesis: ex v being INT-Variable of X ex t being INT-Expression of X st for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) take the INT-Variable of X ; ::_thesis: ex t being INT-Expression of X st for s being Element of Funcs (X,INT) holds f . (s,I) = s +* (( the INT-Variable of X . s),(t . s)) take t ; ::_thesis: for s being Element of Funcs (X,INT) holds f . (s,I) = s +* (( the INT-Variable of X . s),(t . s)) for s being Element of Funcs (X,INT) holds f . (s,(root-tree [((c * v9) ** (c,NAT)),(t9 ** (c,NAT))])) = s +* ((v9 . s),(t9 . s)) by A2, Def28; hence for s being Element of Funcs (X,INT) holds f . (s,I) = s +* (( the INT-Variable of X . s),(t . s)) ; ::_thesis: verum end; end; take the INT-Variable of X ; ::_thesis: the INT-Variable of X,t form_assignment_wrt f thus the INT-Variable of X,t form_assignment_wrt f by Th19; ::_thesis: verum end; registration let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let c be Enumeration of X; cluster -> Euclidean for INT-Exec of c,T; coherence for b1 being INT-Exec of c,T holds b1 is Euclidean proof A1: rng c c= NAT by Th11; card X = rng c by Th6; then A2: INT \/ (card X) = INT by A1, NUMBERS:17, XBOOLE_1:1, XBOOLE_1:12; set x = (c ") . 0; set a = (INT --> ((c ") . 0)) +* (c "); A3: dom (INT --> ((c ") . 0)) = INT by FUNCOP_1:13; A4: rng (INT --> ((c ") . 0)) = {((c ") . 0)} by FUNCOP_1:8; (c ") . 0 in X by FUNCT_2:5, ORDINAL3:8; then {((c ") . 0)} c= X by ZFMISC_1:31; then A5: {((c ") . 0)} \/ X = X by XBOOLE_1:12; rng (c ") = X by Th7; then A6: rng ((INT --> ((c ") . 0)) +* (c ")) c= X by A4, A5, FUNCT_4:17; dom (c ") = card X by Th7; then dom ((INT --> ((c ") . 0)) +* (c ")) = INT by A3, A2, FUNCT_4:def_1; then reconsider a = (INT --> ((c ") . 0)) +* (c ") as INT-Array of X by A6, FUNCT_2:2; let f be INT-Exec of c,T; ::_thesis: f is Euclidean set S = ECIW-signature ; set G = INT-ElemIns ; set A = FreeUnivAlgNSG (ECIW-signature,INT-ElemIns); thus for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds v,t form_assignment_wrt f by Th19; :: according to AOFA_I00:def_22 ::_thesis: ( ( for i being integer number holds . (i,X) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds . v is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for x being Element of X holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ex a being INT-Array of X st ( a | (card X) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) thus for i being integer number holds . (i,X) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th21; ::_thesis: ( ( for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds . v is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for x being Element of X holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ex a being INT-Array of X st ( a | (card X) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) thus for v being INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds . v is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th21; ::_thesis: ( ( for x being Element of X holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ex a being INT-Array of X st ( a | (card X) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) thus for x being Element of X holds ^ x is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th20; ::_thesis: ( ex a being INT-Array of X st ( a | (card X) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) hereby ::_thesis: ( ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) take a = a; ::_thesis: ( a | (card X) is one-to-one & ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) dom (c ") = card X by Th7; hence a | (card X) is one-to-one by FUNCT_4:23; ::_thesis: for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f thus for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds a * t is INT-Variable of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f by Th20; ::_thesis: verum end; thus ( ( for t being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds - t is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) & ( for t1, t2 being INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f holds ( t1 (#) t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 + t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 div t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & t1 mod t2 is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & leq (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f & gt (t1,t2) is INT-Expression of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns),f ) ) ) by Th21; ::_thesis: verum end; end; registration cluster FreeUnivAlgNSG (ECIW-signature,INT-ElemIns) -> Euclidean ; coherence FreeUnivAlgNSG (ECIW-signature,INT-ElemIns) is Euclidean proof let X be non empty countable set ; :: according to AOFA_I00:def_23 ::_thesis: for T being Subset of (Funcs (X,INT)) ex f being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (X,INT),T st f is Euclidean let T be Subset of (Funcs (X,INT)); ::_thesis: ex f being ExecutionFunction of FreeUnivAlgNSG (ECIW-signature,INT-ElemIns), Funcs (X,INT),T st f is Euclidean set c = the Enumeration of X; set f = the INT-Exec of the Enumeration of X,T; take the INT-Exec of the Enumeration of X,T ; ::_thesis: the INT-Exec of the Enumeration of X,T is Euclidean thus the INT-Exec of the Enumeration of X,T is Euclidean ; ::_thesis: verum end; end; registration cluster non empty V157() V158() V159() with_empty-instruction with_catenation with_if-instruction with_while-instruction non degenerated Euclidean for L9(); existence ex b1 being preIfWhileAlgebra st ( b1 is Euclidean & not b1 is degenerated ) proof take FreeUnivAlgNSG (ECIW-signature,INT-ElemIns) ; ::_thesis: ( FreeUnivAlgNSG (ECIW-signature,INT-ElemIns) is Euclidean & not FreeUnivAlgNSG (ECIW-signature,INT-ElemIns) is degenerated ) thus ( FreeUnivAlgNSG (ECIW-signature,INT-ElemIns) is Euclidean & not FreeUnivAlgNSG (ECIW-signature,INT-ElemIns) is degenerated ) ; ::_thesis: verum end; end; registration let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); cluster non empty Relation-like [:(Funcs (X,INT)), the carrier of A:] -defined Funcs (X,INT) -valued Function-like V29([:(Funcs (X,INT)), the carrier of A:]) quasi_total Function-yielding V89() complying_with_empty-instruction complying_with_catenation Euclidean for ExecutionFunction of A, Funcs (X,INT),T; existence ex b1 being ExecutionFunction of A, Funcs (X,INT),T st b1 is Euclidean by Def23; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let t be INT-Expression of A,f; :: original: - redefine func - t -> INT-Expression of A,f; coherence - t is INT-Expression of A,f by Def22; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let t be INT-Expression of A,f; let i be integer number ; :: original: + redefine funct + i -> INT-Expression of A,f; coherence i + t is INT-Expression of A,f proof A1: dom (t + (. (i,X))) = Funcs (X,INT) by FUNCT_2:def_1; A2: now__::_thesis:_for_a_being_set_st_a_in_Funcs_(X,INT)_holds_ (t_+_(._(i,X)))_._a_=_i_+_(t_._a) let a be set ; ::_thesis: ( a in Funcs (X,INT) implies (t + (. (i,X))) . a = i + (t . a) ) assume a in Funcs (X,INT) ; ::_thesis: (t + (. (i,X))) . a = i + (t . a) then reconsider s = a as Element of Funcs (X,INT) ; thus (t + (. (i,X))) . a = (t . s) + ((. (i,X)) . s) by A1, VALUED_1:def_1 .= i + (t . a) by FUNCOP_1:7 ; ::_thesis: verum end; . (i,X) is INT-Expression of A,f by Def22; then A3: t + (. (i,X)) is INT-Expression of A,f by Def22; dom t = Funcs (X,INT) by FUNCT_2:def_1; hence i + t is INT-Expression of A,f by A3, A1, A2, VALUED_1:def_2; ::_thesis: verum end; :: original: - redefine funct - i -> INT-Expression of A,f; coherence t - i is INT-Expression of A,f proof . (i,X) is INT-Expression of A,f by Def22; then - (. (i,X)) is INT-Expression of A,f by Def22; then A4: t + (- (. (i,X))) is INT-Expression of A,f by Def22; A5: dom t = Funcs (X,INT) by FUNCT_2:def_1; A6: dom (t + (- (. (i,X)))) = Funcs (X,INT) by FUNCT_2:def_1; A7: now__::_thesis:_for_a_being_set_st_a_in_Funcs_(X,INT)_holds_ (t_+_(-_(._(i,X))))_._a_=_(t_-_i)_._a let a be set ; ::_thesis: ( a in Funcs (X,INT) implies (t + (- (. (i,X)))) . a = (t - i) . a ) assume a in Funcs (X,INT) ; ::_thesis: (t + (- (. (i,X)))) . a = (t - i) . a then reconsider s = a as Element of Funcs (X,INT) ; thus (t + (- (. (i,X)))) . a = (t . s) + ((- (. (i,X))) . s) by A6, VALUED_1:def_1 .= (t . s) + (- ((. (i,X)) . s)) by VALUED_1:8 .= (t . s) - i by FUNCOP_1:7 .= (t - i) . a by A5, VALUED_1:3 ; ::_thesis: verum end; dom (t - i) = dom t by VALUED_1:3; hence t - i is INT-Expression of A,f by A4, A6, A5, A7, FUNCT_1:2; ::_thesis: verum end; :: original: * redefine funct * i -> INT-Expression of A,f; coherence t * i is INT-Expression of A,f proof A8: dom (t (#) (. (i,X))) = Funcs (X,INT) by FUNCT_2:def_1; A9: now__::_thesis:_for_a_being_set_st_a_in_Funcs_(X,INT)_holds_ (t_(#)_(._(i,X)))_._a_=_i_*_(t_._a) let a be set ; ::_thesis: ( a in Funcs (X,INT) implies (t (#) (. (i,X))) . a = i * (t . a) ) assume a in Funcs (X,INT) ; ::_thesis: (t (#) (. (i,X))) . a = i * (t . a) then reconsider s = a as Element of Funcs (X,INT) ; thus (t (#) (. (i,X))) . a = (t . s) * ((. (i,X)) . s) by A8, VALUED_1:def_4 .= i * (t . a) by FUNCOP_1:7 ; ::_thesis: verum end; . (i,X) is INT-Expression of A,f by Def22; then A10: t (#) (. (i,X)) is INT-Expression of A,f by Def22; dom t = Funcs (X,INT) by FUNCT_2:def_1; hence t * i is INT-Expression of A,f by A10, A8, A9, VALUED_1:def_5; ::_thesis: verum end; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let t1, t2 be INT-Expression of A,f; :: original: - redefine funct1 - t2 -> INT-Expression of A,f; coherence t1 - t2 is INT-Expression of A,f proof - t2 is INT-Expression of A,f ; hence t1 - t2 is INT-Expression of A,f by Def22; ::_thesis: verum end; :: original: + redefine funct1 + t2 -> INT-Expression of A,f; coherence t1 + t2 is INT-Expression of A,f by Def22; :: original: (#) redefine funct1 (#) t2 -> INT-Expression of A,f; coherence t1 (#) t2 is INT-Expression of A,f by Def22; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let t1, t2 be INT-Expression of A,f; :: original: div redefine funct1 div t2 -> INT-Expression of A,f means :Def29: :: AOFA_I00:def 29 for s being Element of Funcs (X,INT) holds it . s = (t1 . s) div (t2 . s); coherence t1 div t2 is INT-Expression of A,f by Def22; compatibility for b1 being INT-Expression of A,f holds ( b1 = t1 div t2 iff for s being Element of Funcs (X,INT) holds b1 . s = (t1 . s) div (t2 . s) ) proof let ti be INT-Expression of A,f; ::_thesis: ( ti = t1 div t2 iff for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) div (t2 . s) ) A1: dom t1 = Funcs (X,INT) by FUNCT_2:def_1; A2: dom t2 = Funcs (X,INT) by FUNCT_2:def_1; A3: dom (t1 div t2) = (dom t1) /\ (dom t2) by Def3; hence ( ti = t1 div t2 implies for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) div (t2 . s) ) by A1, A2, Def3; ::_thesis: ( ( for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) div (t2 . s) ) implies ti = t1 div t2 ) A4: dom ti = Funcs (X,INT) by FUNCT_2:def_1; assume for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) div (t2 . s) ; ::_thesis: ti = t1 div t2 then for s being set st s in Funcs (X,INT) holds ti . s = (t1 . s) div (t2 . s) ; hence ti = t1 div t2 by A3, A1, A2, A4, Def3; ::_thesis: verum end; :: original: mod redefine funct1 mod t2 -> INT-Expression of A,f means :Def30: :: AOFA_I00:def 30 for s being Element of Funcs (X,INT) holds it . s = (t1 . s) mod (t2 . s); coherence t1 mod t2 is INT-Expression of A,f by Def22; compatibility for b1 being INT-Expression of A,f holds ( b1 = t1 mod t2 iff for s being Element of Funcs (X,INT) holds b1 . s = (t1 . s) mod (t2 . s) ) proof let ti be INT-Expression of A,f; ::_thesis: ( ti = t1 mod t2 iff for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) mod (t2 . s) ) A5: dom t1 = Funcs (X,INT) by FUNCT_2:def_1; A6: dom t2 = Funcs (X,INT) by FUNCT_2:def_1; A7: dom (t1 mod t2) = (dom t1) /\ (dom t2) by Def4; hence ( ti = t1 mod t2 implies for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) mod (t2 . s) ) by A5, A6, Def4; ::_thesis: ( ( for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) mod (t2 . s) ) implies ti = t1 mod t2 ) A8: dom ti = Funcs (X,INT) by FUNCT_2:def_1; assume for s being Element of Funcs (X,INT) holds ti . s = (t1 . s) mod (t2 . s) ; ::_thesis: ti = t1 mod t2 then for s being set st s in Funcs (X,INT) holds ti . s = (t1 . s) mod (t2 . s) ; hence ti = t1 mod t2 by A7, A5, A6, A8, Def4; ::_thesis: verum end; :: original: leq redefine func leq (t1,t2) -> INT-Expression of A,f means :Def31: :: AOFA_I00:def 31 for s being Element of Funcs (X,INT) holds it . s = IFGT ((t1 . s),(t2 . s),0,1); compatibility for b1 being INT-Expression of A,f holds ( b1 = leq (t1,t2) iff for s being Element of Funcs (X,INT) holds b1 . s = IFGT ((t1 . s),(t2 . s),0,1) ) proof let ti be INT-Expression of A,f; ::_thesis: ( ti = leq (t1,t2) iff for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),0,1) ) A9: dom t1 = Funcs (X,INT) by FUNCT_2:def_1; A10: dom t2 = Funcs (X,INT) by FUNCT_2:def_1; A11: dom (leq (t1,t2)) = (dom t1) /\ (dom t2) by Def5; hence ( ti = leq (t1,t2) implies for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),0,1) ) by A9, A10, Def5; ::_thesis: ( ( for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),0,1) ) implies ti = leq (t1,t2) ) A12: dom ti = Funcs (X,INT) by FUNCT_2:def_1; assume for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),0,1) ; ::_thesis: ti = leq (t1,t2) then for s being set st s in Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),0,1) ; hence ti = leq (t1,t2) by A11, A9, A10, A12, Def5; ::_thesis: verum end; coherence leq (t1,t2) is INT-Expression of A,f by Def22; :: original: gt redefine func gt (t1,t2) -> INT-Expression of A,f means :Def32: :: AOFA_I00:def 32 for s being Element of Funcs (X,INT) holds it . s = IFGT ((t1 . s),(t2 . s),1,0); coherence gt (t1,t2) is INT-Expression of A,f by Def22; compatibility for b1 being INT-Expression of A,f holds ( b1 = gt (t1,t2) iff for s being Element of Funcs (X,INT) holds b1 . s = IFGT ((t1 . s),(t2 . s),1,0) ) proof let ti be INT-Expression of A,f; ::_thesis: ( ti = gt (t1,t2) iff for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),1,0) ) A13: dom t1 = Funcs (X,INT) by FUNCT_2:def_1; A14: dom t2 = Funcs (X,INT) by FUNCT_2:def_1; A15: dom (gt (t1,t2)) = (dom t1) /\ (dom t2) by Def6; hence ( ti = gt (t1,t2) implies for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),1,0) ) by A13, A14, Def6; ::_thesis: ( ( for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),1,0) ) implies ti = gt (t1,t2) ) A16: dom ti = Funcs (X,INT) by FUNCT_2:def_1; assume for s being Element of Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),1,0) ; ::_thesis: ti = gt (t1,t2) then for s being set st s in Funcs (X,INT) holds ti . s = IFGT ((t1 . s),(t2 . s),1,0) ; hence ti = gt (t1,t2) by A15, A13, A14, A16, Def6; ::_thesis: verum end; end; :: deftheorem Def29 defines div AOFA_I00:def_29_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t1, t2, b7 being INT-Expression of A,f holds ( b7 = t1 div t2 iff for s being Element of Funcs (X,INT) holds b7 . s = (t1 . s) div (t2 . s) ); :: deftheorem Def30 defines mod AOFA_I00:def_30_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t1, t2, b7 being INT-Expression of A,f holds ( b7 = t1 mod t2 iff for s being Element of Funcs (X,INT) holds b7 . s = (t1 . s) mod (t2 . s) ); :: deftheorem Def31 defines leq AOFA_I00:def_31_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t1, t2, b7 being INT-Expression of A,f holds ( b7 = leq (t1,t2) iff for s being Element of Funcs (X,INT) holds b7 . s = IFGT ((t1 . s),(t2 . s),0,1) ); :: deftheorem Def32 defines gt AOFA_I00:def_32_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t1, t2, b7 being INT-Expression of A,f holds ( b7 = gt (t1,t2) iff for s being Element of Funcs (X,INT) holds b7 . s = IFGT ((t1 . s),(t2 . s),1,0) ); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let t1, t2 be INT-Expression of A,f; :: original: eq redefine func eq (t1,t2) -> INT-Expression of A,f means :: AOFA_I00:def 33 for s being Element of Funcs (X,INT) holds it . s = IFEQ ((t1 . s),(t2 . s),1,0); compatibility for b1 being INT-Expression of A,f holds ( b1 = eq (t1,t2) iff for s being Element of Funcs (X,INT) holds b1 . s = IFEQ ((t1 . s),(t2 . s),1,0) ) proof let ti be INT-Expression of A,f; ::_thesis: ( ti = eq (t1,t2) iff for s being Element of Funcs (X,INT) holds ti . s = IFEQ ((t1 . s),(t2 . s),1,0) ) A1: dom t1 = Funcs (X,INT) by FUNCT_2:def_1; A2: dom t2 = Funcs (X,INT) by FUNCT_2:def_1; A3: dom (eq (t1,t2)) = (dom t1) /\ (dom t2) by Def7; hence ( ti = eq (t1,t2) implies for s being Element of Funcs (X,INT) holds ti . s = IFEQ ((t1 . s),(t2 . s),1,0) ) by A1, A2, Def7; ::_thesis: ( ( for s being Element of Funcs (X,INT) holds ti . s = IFEQ ((t1 . s),(t2 . s),1,0) ) implies ti = eq (t1,t2) ) A4: dom ti = Funcs (X,INT) by FUNCT_2:def_1; assume for s being Element of Funcs (X,INT) holds ti . s = IFEQ ((t1 . s),(t2 . s),1,0) ; ::_thesis: ti = eq (t1,t2) then for s being set st s in Funcs (X,INT) holds ti . s = IFEQ ((t1 . s),(t2 . s),1,0) ; hence ti = eq (t1,t2) by A3, A1, A2, A4, Def7; ::_thesis: verum end; coherence eq (t1,t2) is INT-Expression of A,f proof reconsider l1 = leq (t1,t2), l2 = leq (t2,t1) as INT-Expression of A,f ; A5: dom (l1 (#) l2) = Funcs (X,INT) by FUNCT_2:def_1; A6: dom (eq (t1,t2)) = Funcs (X,INT) by FUNCT_2:def_1; now__::_thesis:_for_a_being_set_st_a_in_Funcs_(X,INT)_holds_ (eq_(t1,t2))_._a_=_(l1_(#)_l2)_._a let a be set ; ::_thesis: ( a in Funcs (X,INT) implies (eq (t1,t2)) . a = (l1 (#) l2) . a ) assume a in Funcs (X,INT) ; ::_thesis: (eq (t1,t2)) . a = (l1 (#) l2) . a then reconsider s = a as Element of Funcs (X,INT) ; A7: ( t1 . s = t2 . s or t1 . s < t2 . s or t2 . s < t1 . s ) by XXREAL_0:1; A8: l2 . s = IFGT ((t2 . s),(t1 . s),0,1) by Def31; A9: (l1 (#) l2) . s = (l1 . s) * (l2 . s) by A5, VALUED_1:def_4; A10: l1 . s = IFGT ((t1 . s),(t2 . s),0,1) by Def31; (eq (t1,t2)) . s = IFEQ ((t1 . s),(t2 . s),1,0) by A6, Def7; then ( ( (eq (t1,t2)) . s = 1 & l1 . s = 1 & l2 . s = 1 ) or ( (eq (t1,t2)) . s = 0 & l1 . s = 0 & l2 . s = 1 ) or ( (eq (t1,t2)) . s = 0 & l1 . s = 1 & l2 . s = 0 ) ) by A8, A10, A7, FUNCOP_1:def_8, XXREAL_0:def_11; hence (eq (t1,t2)) . a = (l1 (#) l2) . a by A9; ::_thesis: verum end; hence eq (t1,t2) is INT-Expression of A,f by A6, A5, FUNCT_1:2; ::_thesis: verum end; end; :: deftheorem defines eq AOFA_I00:def_33_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t1, t2, b7 being INT-Expression of A,f holds ( b7 = eq (t1,t2) iff for s being Element of Funcs (X,INT) holds b7 . s = IFEQ ((t1 . s),(t2 . s),1,0) ); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v be INT-Variable of A,f; func . v -> INT-Expression of A,f equals :: AOFA_I00:def 34 . v; coherence . v is INT-Expression of A,f by Def22; end; :: deftheorem defines . AOFA_I00:def_34_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f holds . v = . v; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Element of X; funcx ^ (A,f) -> INT-Variable of A,f equals :: AOFA_I00:def 35 ^ x; coherence ^ x is INT-Variable of A,f by Def22; end; :: deftheorem defines ^ AOFA_I00:def_35_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Element of X holds x ^ (A,f) = ^ x; notation let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Variable of f; synonym ^ x for x ^ (A,f); end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Variable of f; func . x -> INT-Expression of A,f equals :: AOFA_I00:def 36 . (^ x); coherence . (^ x) is INT-Expression of A,f ; end; :: deftheorem defines . AOFA_I00:def_36_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f holds . x = . (^ x); theorem Th22: :: AOFA_I00:22 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for s being Element of Funcs (X,INT) holds (. x) . s = s . x proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for s being Element of Funcs (X,INT) holds (. x) . s = s . x let X be non empty countable set ; ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for s being Element of Funcs (X,INT) holds (. x) . s = s . x let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for s being Element of Funcs (X,INT) holds (. x) . s = s . x let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x being Variable of f for s being Element of Funcs (X,INT) holds (. x) . s = s . x let x be Variable of f; ::_thesis: for s being Element of Funcs (X,INT) holds (. x) . s = s . x let s be Element of Funcs (X,INT); ::_thesis: (. x) . s = s . x thus (. x) . s = s . ((x ^ (A,f)) . s) by Def19 .= s . x by FUNCOP_1:7 ; ::_thesis: verum end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let i be integer number ; func . (i,A,f) -> INT-Expression of A,f equals :: AOFA_I00:def 37 . (i,X); coherence . (i,X) is INT-Expression of A,f by Def22; end; :: deftheorem defines . AOFA_I00:def_37_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number holds . (i,A,f) = . (i,X); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v be INT-Variable of A,f; let t be INT-Expression of A,f; funcv := t -> Element of A equals :: AOFA_I00:def 38 choose { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; coherence choose { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } is Element of A proof set Y = { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; A1: { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } c= the carrier of A proof let i be set ; :: according to TARSKI:def_3 ::_thesis: ( not i in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } or i in the carrier of A ) assume i in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; ::_thesis: i in the carrier of A then ex I being Element of A st ( i = I & I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) ; hence i in the carrier of A ; ::_thesis: verum end; v,t form_assignment_wrt f by Def22; then consider I0 being Element of A such that A2: I0 in ElementaryInstructions A and A3: for s being Element of Funcs (X,INT) holds f . (s,I0) = s +* ((v . s),(t . s)) by Def15; I0 in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } by A2, A3; then choose { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; hence choose { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } is Element of A by A1; ::_thesis: verum end; end; :: deftheorem defines := AOFA_I00:def_38_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds v := t = choose { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; theorem Th23: :: AOFA_I00:23 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds v := t in ElementaryInstructions A proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds v := t in ElementaryInstructions A let X be non empty countable set ; ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds v := t in ElementaryInstructions A let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds v := t in ElementaryInstructions A let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for v being INT-Variable of A,f for t being INT-Expression of A,f holds v := t in ElementaryInstructions A let v be INT-Variable of A,f; ::_thesis: for t being INT-Expression of A,f holds v := t in ElementaryInstructions A let t be INT-Expression of A,f; ::_thesis: v := t in ElementaryInstructions A set Y = { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; v,t form_assignment_wrt f by Def22; then consider I0 being Element of A such that A1: I0 in ElementaryInstructions A and A2: for s being Element of Funcs (X,INT) holds f . (s,I0) = s +* ((v . s),(t . s)) by Def15; I0 in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } by A1, A2; then v := t in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; then ex I being Element of A st ( v := t = I & I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) ; hence v := t in ElementaryInstructions A ; ::_thesis: verum end; registration let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v be INT-Variable of A,f; let t be INT-Expression of A,f; clusterv := t -> absolutely-terminating ; coherence v := t is absolutely-terminating by Th23, AOFA_000:95; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v be INT-Variable of A,f; let t be INT-Expression of A,f; funcv += t -> absolutely-terminating Element of A equals :: AOFA_I00:def 39 v := ((. v) + t); coherence v := ((. v) + t) is absolutely-terminating Element of A ; funcv *= t -> absolutely-terminating Element of A equals :: AOFA_I00:def 40 v := ((. v) (#) t); coherence v := ((. v) (#) t) is absolutely-terminating Element of A ; end; :: deftheorem defines += AOFA_I00:def_39_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds v += t = v := ((. v) + t); :: deftheorem defines *= AOFA_I00:def_40_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds v *= t = v := ((. v) (#) t); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Element of X; let t be INT-Expression of A,f; funcx := t -> absolutely-terminating Element of A equals :: AOFA_I00:def 41 (x ^ (A,f)) := t; correctness coherence (x ^ (A,f)) := t is absolutely-terminating Element of A; ; end; :: deftheorem defines := AOFA_I00:def_41_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Element of X for t being INT-Expression of A,f holds x := t = (x ^ (A,f)) := t; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Element of X; let y be Variable of f; funcx := y -> absolutely-terminating Element of A equals :: AOFA_I00:def 42 x := (. y); correctness coherence x := (. y) is absolutely-terminating Element of A; ; end; :: deftheorem defines := AOFA_I00:def_42_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Element of X for y being Variable of f holds x := y = x := (. y); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Element of X; let v be INT-Variable of A,f; funcx := v -> absolutely-terminating Element of A equals :: AOFA_I00:def 43 x := (. v); correctness coherence x := (. v) is absolutely-terminating Element of A; ; end; :: deftheorem defines := AOFA_I00:def_43_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Element of X for v being INT-Variable of A,f holds x := v = x := (. v); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v, w be INT-Variable of A,f; funcv := w -> absolutely-terminating Element of A equals :: AOFA_I00:def 44 v := (. w); correctness coherence v := (. w) is absolutely-terminating Element of A; ; end; :: deftheorem defines := AOFA_I00:def_44_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v, w being INT-Variable of A,f holds v := w = v := (. w); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Variable of f; let i be integer number ; funcx := i -> absolutely-terminating Element of A equals :: AOFA_I00:def 45 x := (. (i,A,f)); correctness coherence x := (. (i,A,f)) is absolutely-terminating Element of A; ; end; :: deftheorem defines := AOFA_I00:def_45_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds x := i = x := (. (i,A,f)); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v1, v2 be INT-Variable of A,f; let x be Variable of f; func swap (v1,x,v2) -> absolutely-terminating Element of A equals :: AOFA_I00:def 46 ((x := v1) \; (v1 := v2)) \; (v2 := (. x)); coherence ((x := v1) \; (v1 := v2)) \; (v2 := (. x)) is absolutely-terminating Element of A ; end; :: deftheorem defines swap AOFA_I00:def_46_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v1, v2 being INT-Variable of A,f for x being Variable of f holds swap (v1,x,v2) = ((x := v1) \; (v1 := v2)) \; (v2 := (. x)); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Variable of f; let t be INT-Expression of A,f; funcx += t -> absolutely-terminating Element of A equals :: AOFA_I00:def 47 x := ((. x) + t); correctness coherence x := ((. x) + t) is absolutely-terminating Element of A; ; funcx *= t -> absolutely-terminating Element of A equals :: AOFA_I00:def 48 x := ((. x) (#) t); correctness coherence x := ((. x) (#) t) is absolutely-terminating Element of A; ; funcx %= t -> absolutely-terminating Element of A equals :: AOFA_I00:def 49 x := ((. x) mod t); correctness coherence x := ((. x) mod t) is absolutely-terminating Element of A; ; funcx /= t -> absolutely-terminating Element of A equals :: AOFA_I00:def 50 x := ((. x) div t); correctness coherence x := ((. x) div t) is absolutely-terminating Element of A; ; end; :: deftheorem defines += AOFA_I00:def_47_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds x += t = x := ((. x) + t); :: deftheorem defines *= AOFA_I00:def_48_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds x *= t = x := ((. x) (#) t); :: deftheorem defines %= AOFA_I00:def_49_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds x %= t = x := ((. x) mod t); :: deftheorem defines /= AOFA_I00:def_50_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds x /= t = x := ((. x) div t); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x be Variable of f; let i be integer number ; funcx += i -> absolutely-terminating Element of A equals :: AOFA_I00:def 51 x := ((. x) + i); correctness coherence x := ((. x) + i) is absolutely-terminating Element of A; ; funcx *= i -> absolutely-terminating Element of A equals :: AOFA_I00:def 52 x := ((. x) * i); correctness coherence x := ((. x) * i) is absolutely-terminating Element of A; ; funcx %= i -> absolutely-terminating Element of A equals :: AOFA_I00:def 53 x := ((. x) mod (. (i,A,f))); correctness coherence x := ((. x) mod (. (i,A,f))) is absolutely-terminating Element of A; ; funcx /= i -> absolutely-terminating Element of A equals :: AOFA_I00:def 54 x := ((. x) div (. (i,A,f))); correctness coherence x := ((. x) div (. (i,A,f))) is absolutely-terminating Element of A; ; funcx div i -> INT-Expression of A,f equals :: AOFA_I00:def 55 (. x) div (. (i,A,f)); correctness coherence (. x) div (. (i,A,f)) is INT-Expression of A,f; ; end; :: deftheorem defines += AOFA_I00:def_51_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds x += i = x := ((. x) + i); :: deftheorem defines *= AOFA_I00:def_52_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds x *= i = x := ((. x) * i); :: deftheorem defines %= AOFA_I00:def_53_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds x %= i = x := ((. x) mod (. (i,A,f))); :: deftheorem defines /= AOFA_I00:def_54_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds x /= i = x := ((. x) div (. (i,A,f))); :: deftheorem defines div AOFA_I00:def_55_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds x div i = (. x) div (. (i,A,f)); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v be INT-Variable of A,f; let i be integer number ; funcv := i -> absolutely-terminating Element of A equals :: AOFA_I00:def 56 v := (. (i,A,f)); correctness coherence v := (. (i,A,f)) is absolutely-terminating Element of A; ; end; :: deftheorem defines := AOFA_I00:def_56_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for i being integer number holds v := i = v := (. (i,A,f)); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let v be INT-Variable of A,f; let i be integer number ; funcv += i -> absolutely-terminating Element of A equals :: AOFA_I00:def 57 v := ((. v) + i); correctness coherence v := ((. v) + i) is absolutely-terminating Element of A; ; funcv *= i -> absolutely-terminating Element of A equals :: AOFA_I00:def 58 v := ((. v) * i); correctness coherence v := ((. v) * i) is absolutely-terminating Element of A; ; end; :: deftheorem defines += AOFA_I00:def_57_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for i being integer number holds v += i = v := ((. v) + i); :: deftheorem defines *= AOFA_I00:def_58_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for i being integer number holds v *= i = v := ((. v) * i); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let b be Element of X; let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); let t1 be INT-Expression of A,g; funct1 is_odd -> absolutely-terminating Element of A equals :: AOFA_I00:def 59 b := (t1 mod (. (2,A,g))); coherence b := (t1 mod (. (2,A,g))) is absolutely-terminating Element of A ; funct1 is_even -> absolutely-terminating Element of A equals :: AOFA_I00:def 60 b := ((t1 + 1) mod (. (2,A,g))); coherence b := ((t1 + 1) mod (. (2,A,g))) is absolutely-terminating Element of A ; let t2 be INT-Expression of A,g; funct1 leq t2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 61 b := (leq (t1,t2)); coherence b := (leq (t1,t2)) is absolutely-terminating Element of A ; funct1 gt t2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 62 b := (gt (t1,t2)); coherence b := (gt (t1,t2)) is absolutely-terminating Element of A ; funct1 eq t2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 63 b := (eq (t1,t2)); coherence b := (eq (t1,t2)) is absolutely-terminating Element of A ; end; :: deftheorem defines is_odd AOFA_I00:def_59_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t1 being INT-Expression of A,g holds t1 is_odd = b := (t1 mod (. (2,A,g))); :: deftheorem defines is_even AOFA_I00:def_60_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t1 being INT-Expression of A,g holds t1 is_even = b := ((t1 + 1) mod (. (2,A,g))); :: deftheorem defines leq AOFA_I00:def_61_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t1, t2 being INT-Expression of A,g holds t1 leq t2 = b := (leq (t1,t2)); :: deftheorem defines gt AOFA_I00:def_62_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t1, t2 being INT-Expression of A,g holds t1 gt t2 = b := (gt (t1,t2)); :: deftheorem defines eq AOFA_I00:def_63_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t1, t2 being INT-Expression of A,g holds t1 eq t2 = b := (eq (t1,t2)); notation let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let b be Element of X; let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); let t1, t2 be INT-Expression of A,g; synonym t2 geq t1 for t1 leq t2; synonym t2 lt t1 for t1 gt t2; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let b be Element of X; let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); let v1, v2 be INT-Variable of A,g; funcv1 leq v2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 64 (. v1) leq (. v2); coherence (. v1) leq (. v2) is absolutely-terminating Element of A ; funcv1 gt v2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 65 (. v1) gt (. v2); coherence (. v1) gt (. v2) is absolutely-terminating Element of A ; end; :: deftheorem defines leq AOFA_I00:def_64_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for v1, v2 being INT-Variable of A,g holds v1 leq v2 = (. v1) leq (. v2); :: deftheorem defines gt AOFA_I00:def_65_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for v1, v2 being INT-Variable of A,g holds v1 gt v2 = (. v1) gt (. v2); notation let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let b be Element of X; let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); let v1, v2 be INT-Variable of A,g; synonym v2 geq v1 for v1 leq v2; synonym v2 lt v1 for v1 gt v2; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let b be Element of X; let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); let x1 be Variable of g; funcx1 is_odd -> absolutely-terminating Element of A equals :: AOFA_I00:def 66 (. x1) is_odd ; coherence (. x1) is_odd is absolutely-terminating Element of A ; funcx1 is_even -> absolutely-terminating Element of A equals :: AOFA_I00:def 67 (. x1) is_even ; coherence (. x1) is_even is absolutely-terminating Element of A ; let x2 be Variable of g; funcx1 leq x2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 68 (. x1) leq (. x2); coherence (. x1) leq (. x2) is absolutely-terminating Element of A ; funcx1 gt x2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 69 (. x1) gt (. x2); coherence (. x1) gt (. x2) is absolutely-terminating Element of A ; end; :: deftheorem defines is_odd AOFA_I00:def_66_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x1 being Variable of g holds x1 is_odd = (. x1) is_odd ; :: deftheorem defines is_even AOFA_I00:def_67_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x1 being Variable of g holds x1 is_even = (. x1) is_even ; :: deftheorem defines leq AOFA_I00:def_68_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x1, x2 being Variable of g holds x1 leq x2 = (. x1) leq (. x2); :: deftheorem defines gt AOFA_I00:def_69_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x1, x2 being Variable of g holds x1 gt x2 = (. x1) gt (. x2); notation let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let b be Element of X; let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); let x1, x2 be Variable of g; synonym x2 geq x1 for x1 leq x2; synonym x2 lt x1 for x1 gt x2; end; definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let b be Element of X; let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); let x be Variable of g; let i be integer number ; funcx leq i -> absolutely-terminating Element of A equals :: AOFA_I00:def 70 (. x) leq (. (i,A,g)); coherence (. x) leq (. (i,A,g)) is absolutely-terminating Element of A ; funcx geq i -> absolutely-terminating Element of A equals :: AOFA_I00:def 71 (. x) geq (. (i,A,g)); coherence (. x) geq (. (i,A,g)) is absolutely-terminating Element of A ; funcx gt i -> absolutely-terminating Element of A equals :: AOFA_I00:def 72 (. x) gt (. (i,A,g)); coherence (. x) gt (. (i,A,g)) is absolutely-terminating Element of A ; funcx lt i -> absolutely-terminating Element of A equals :: AOFA_I00:def 73 (. x) lt (. (i,A,g)); coherence (. x) lt (. (i,A,g)) is absolutely-terminating Element of A ; funcx / i -> INT-Expression of A,g equals :: AOFA_I00:def 74 (. x) div (. (i,A,g)); coherence (. x) div (. (i,A,g)) is INT-Expression of A,g ; end; :: deftheorem defines leq AOFA_I00:def_70_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds x leq i = (. x) leq (. (i,A,g)); :: deftheorem defines geq AOFA_I00:def_71_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds x geq i = (. x) geq (. (i,A,g)); :: deftheorem defines gt AOFA_I00:def_72_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds x gt i = (. x) gt (. (i,A,g)); :: deftheorem defines lt AOFA_I00:def_73_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds x lt i = (. x) lt (. (i,A,g)); :: deftheorem defines / AOFA_I00:def_74_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds x / i = (. x) div (. (i,A,g)); definition let A be Euclidean preIfWhileAlgebra; let X be non empty countable set ; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let x1, x2 be Variable of f; funcx1 += x2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 75 x1 += (. x2); coherence x1 += (. x2) is absolutely-terminating Element of A ; funcx1 *= x2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 76 x1 *= (. x2); coherence x1 *= (. x2) is absolutely-terminating Element of A ; funcx1 %= x2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 77 x1 := ((. x1) mod (. x2)); coherence x1 := ((. x1) mod (. x2)) is absolutely-terminating Element of A ; funcx1 /= x2 -> absolutely-terminating Element of A equals :: AOFA_I00:def 78 x1 := ((. x1) div (. x2)); coherence x1 := ((. x1) div (. x2)) is absolutely-terminating Element of A ; funcx1 + x2 -> INT-Expression of A,f equals :: AOFA_I00:def 79 (. x1) + (. x2); coherence (. x1) + (. x2) is INT-Expression of A,f ; funcx1 * x2 -> INT-Expression of A,f equals :: AOFA_I00:def 80 (. x1) (#) (. x2); coherence (. x1) (#) (. x2) is INT-Expression of A,f ; funcx1 mod x2 -> INT-Expression of A,f equals :: AOFA_I00:def 81 (. x1) mod (. x2); coherence (. x1) mod (. x2) is INT-Expression of A,f ; funcx1 div x2 -> INT-Expression of A,f equals :: AOFA_I00:def 82 (. x1) div (. x2); coherence (. x1) div (. x2) is INT-Expression of A,f ; end; :: deftheorem defines += AOFA_I00:def_75_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 += x2 = x1 += (. x2); :: deftheorem defines *= AOFA_I00:def_76_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 *= x2 = x1 *= (. x2); :: deftheorem defines %= AOFA_I00:def_77_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 %= x2 = x1 := ((. x1) mod (. x2)); :: deftheorem defines /= AOFA_I00:def_78_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 /= x2 = x1 := ((. x1) div (. x2)); :: deftheorem defines + AOFA_I00:def_79_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 + x2 = (. x1) + (. x2); :: deftheorem defines * AOFA_I00:def_80_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 * x2 = (. x1) (#) (. x2); :: deftheorem defines mod AOFA_I00:def_81_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 mod x2 = (. x1) mod (. x2); :: deftheorem defines div AOFA_I00:def_82_:_ for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x1, x2 being Variable of f holds x1 div x2 = (. x1) div (. x2); theorem Th24: :: AOFA_I00:24 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for v being INT-Variable of A,f for t being INT-Expression of A,f holds ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for v being INT-Variable of A,f for t being INT-Expression of A,f holds ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) let v be INT-Variable of A,f; ::_thesis: for t being INT-Expression of A,f holds ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) let t be INT-Expression of A,f; ::_thesis: ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) set Y = { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; v,t form_assignment_wrt f by Def22; then consider I0 being Element of A such that A1: I0 in ElementaryInstructions A and A2: for s being Element of Funcs (X,INT) holds f . (s,I0) = s +* ((v . s),(t . s)) by Def15; I0 in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } by A1, A2; then v := t in { I where I is Element of A : ( I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) } ; then ex I being Element of A st ( v := t = I & I in ElementaryInstructions A & ( for s being Element of Funcs (X,INT) holds f . (s,I) = s +* ((v . s),(t . s)) ) ) ; then A3: f . (s,(v := t)) = s +* ((v . s),(t . s)) ; dom s = X by FUNCT_2:def_1; hence ( (f . (s,(v := t))) . (v . s) = t . s & ( for z being Element of X st z <> v . s holds (f . (s,(v := t))) . z = s . z ) ) by A3, FUNCT_7:31, FUNCT_7:32; ::_thesis: verum end; theorem Th25: :: AOFA_I00:25 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for i being integer number holds ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x being Variable of f for i being integer number holds ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) let x be Variable of f; ::_thesis: for i being integer number holds ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) let i be integer number ; ::_thesis: ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) A1: (. (i,A,f)) . s = i by FUNCOP_1:7; (^ x) . s = x by FUNCOP_1:7; hence ( (f . (s,(x := i))) . x = i & ( for z being Element of X st z <> x holds (f . (s,(x := i))) . z = s . z ) ) by A1, Th24; ::_thesis: verum end; theorem Th26: :: AOFA_I00:26 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) let x be Variable of f; ::_thesis: for t being INT-Expression of A,f holds ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) let t be INT-Expression of A,f; ::_thesis: ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) (^ x) . s = x by FUNCOP_1:7; hence ( (f . (s,(x := t))) . x = t . s & ( for z being Element of X st z <> x holds (f . (s,(x := t))) . z = s . z ) ) by Th24; ::_thesis: verum end; theorem Th27: :: AOFA_I00:27 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x, y being Variable of f holds ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) let x, y be Variable of f; ::_thesis: ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) (. y) . s = s . y by Th22; hence ( (f . (s,(x := y))) . x = s . y & ( for z being Element of X st z <> x holds (f . (s,(x := y))) . z = s . z ) ) by Th26; ::_thesis: verum end; theorem Th28: :: AOFA_I00:28 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for i being integer number for x being Variable of f holds ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) let i be integer number ; ::_thesis: for x being Variable of f holds ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) let x be Variable of f; ::_thesis: ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) A1: (^ x) . s = x by FUNCOP_1:7; A2: (. (^ x)) . s = s . ((^ x) . s) by Def19; ((. x) + i) . s = ((. x) . s) + i by Def8; hence ( (f . (s,(x += i))) . x = (s . x) + i & ( for z being Element of X st z <> x holds (f . (s,(x += i))) . z = s . z ) ) by A1, A2, Th24; ::_thesis: verum end; theorem Th29: :: AOFA_I00:29 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) let x be Variable of f; ::_thesis: for t being INT-Expression of A,f holds ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) let t be INT-Expression of A,f; ::_thesis: ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) A1: (^ x) . s = x by FUNCOP_1:7; dom ((. x) + t) = Funcs (X,INT) by FUNCT_2:def_1; then A2: ((. x) + t) . s = ((. x) . s) + (t . s) by VALUED_1:def_1; (. x) . s = s . x by Th22; hence ( (f . (s,(x += t))) . x = (s . x) + (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x += t))) . z = s . z ) ) by A1, A2, Th24; ::_thesis: verum end; theorem Th30: :: AOFA_I00:30 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x, y being Variable of f holds ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) let x, y be Variable of f; ::_thesis: ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) (. y) . s = s . y by Th22; hence ( (f . (s,(x += y))) . x = (s . x) + (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x += y))) . z = s . z ) ) by Th29; ::_thesis: verum end; theorem Th31: :: AOFA_I00:31 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for i being integer number for x being Variable of f holds ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) let i be integer number ; ::_thesis: for x being Variable of f holds ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) let x be Variable of f; ::_thesis: ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) A1: (^ x) . s = x by FUNCOP_1:7; A2: (. (^ x)) . s = s . ((^ x) . s) by Def19; ((. x) * i) . s = ((. x) . s) * i by Def10; hence ( (f . (s,(x *= i))) . x = (s . x) * i & ( for z being Element of X st z <> x holds (f . (s,(x *= i))) . z = s . z ) ) by A1, A2, Th24; ::_thesis: verum end; theorem Th32: :: AOFA_I00:32 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) let x be Variable of f; ::_thesis: for t being INT-Expression of A,f holds ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) let t be INT-Expression of A,f; ::_thesis: ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) A1: (^ x) . s = x by FUNCOP_1:7; dom ((. x) (#) t) = Funcs (X,INT) by FUNCT_2:def_1; then A2: ((. x) (#) t) . s = ((. x) . s) * (t . s) by VALUED_1:def_4; (. x) . s = s . x by Th22; hence ( (f . (s,(x *= t))) . x = (s . x) * (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x *= t))) . z = s . z ) ) by A1, A2, Th24; ::_thesis: verum end; theorem Th33: :: AOFA_I00:33 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x *= y))) . x = (s . x) * (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x *= y))) . x = (s . x) * (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x *= y))) . x = (s . x) * (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x *= y))) . x = (s . x) * (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x *= y))) . x = (s . x) * (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x, y being Variable of f holds ( (f . (s,(x *= y))) . x = (s . x) * (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z ) ) let x, y be Variable of f; ::_thesis: ( (f . (s,(x *= y))) . x = (s . x) * (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z ) ) A1: dom ((. x) (#) (. y)) = Funcs (X,INT) by FUNCT_2:def_1; (^ x) . s = x by FUNCOP_1:7; hence (f . (s,(x *= y))) . x = ((. x) (#) (. y)) . s by Th24 .= ((. x) . s) * ((. y) . s) by A1, VALUED_1:def_4 .= (s . x) * ((. y) . s) by Th22 .= (s . x) * (s . y) by Th22 ; ::_thesis: for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z thus for z being Element of X st z <> x holds (f . (s,(x *= y))) . z = s . z by Th26; ::_thesis: verum end; theorem Th34: :: AOFA_I00:34 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies (g . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (g . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (g . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (g . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x leq i))) . z = s . z & (g . (s,(x geq i))) . z = s . z ) ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies (g . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (g . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (g . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (g . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x leq i))) . z = s . z & (g . (s,(x geq i))) . z = s . z ) ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies (g . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (g . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (g . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (g . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x leq i))) . z = s . z & (g . (s,(x geq i))) . z = s . z ) ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies (g . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (g . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (g . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (g . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x leq i))) . z = s . z & (g . (s,(x geq i))) . z = s . z ) ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies (g . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (g . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (g . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (g . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x leq i))) . z = s . z & (g . (s,(x geq i))) . z = s . z ) ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x being Variable of f for i being integer number holds ( ( s . x <= i implies (f . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (f . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (f . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (f . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x leq i))) . z = s . z & (f . (s,(x geq i))) . z = s . z ) ) ) reconsider b9 = b as Variable of f by Def2; let x be Variable of f; ::_thesis: for i being integer number holds ( ( s . x <= i implies (f . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (f . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (f . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (f . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x leq i))) . z = s . z & (f . (s,(x geq i))) . z = s . z ) ) ) let i be integer number ; ::_thesis: ( ( s . x <= i implies (f . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (f . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (f . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (f . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x leq i))) . z = s . z & (f . (s,(x geq i))) . z = s . z ) ) ) set v = ^ b9; A1: (. (i,A,f)) . s = i by FUNCOP_1:7; A2: (^ b9) . s = b by FUNCOP_1:7; A3: ( (. x) . s < i implies IFGT (i,((. x) . s),0,1) = 0 ) by XXREAL_0:def_11; A4: ( (. x) . s >= i implies IFGT (i,((. x) . s),0,1) = 1 ) by XXREAL_0:def_11; A5: (leq ((. (i,A,f)),(. x))) . s = IFGT (((. (i,A,f)) . s),((. x) . s),0,1) by Def31; A6: ( (. x) . s > i implies IFGT (((. x) . s),i,0,1) = 0 ) by XXREAL_0:def_11; A7: (leq ((. x),(. (i,A,f)))) . s = IFGT (((. x) . s),((. (i,A,f)) . s),0,1) by Def31; A8: ( (. x) . s <= i implies IFGT (((. x) . s),i,0,1) = 1 ) by XXREAL_0:def_11; (. x) . s = s . ((^ x) . s) by Def19; hence ( ( s . x <= i implies (f . (s,(x leq i))) . b = 1 ) & ( s . x > i implies (f . (s,(x leq i))) . b = 0 ) & ( s . x >= i implies (f . (s,(x geq i))) . b = 1 ) & ( s . x < i implies (f . (s,(x geq i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x leq i))) . z = s . z & (f . (s,(x geq i))) . z = s . z ) ) ) by A1, A2, A8, A6, A4, A3, A7, A5, Th24, FUNCOP_1:7; ::_thesis: verum end; theorem Th35: :: AOFA_I00:35 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies (g . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (g . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (g . (s,(x leq y))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies (g . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (g . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (g . (s,(x leq y))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies (g . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (g . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (g . (s,(x leq y))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies (g . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (g . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (g . (s,(x leq y))) . z = s . z ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies (g . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (g . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (g . (s,(x leq y))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y being Variable of f holds ( ( s . x <= s . y implies (f . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (f . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (f . (s,(x leq y))) . z = s . z ) ) reconsider b9 = b as Variable of f by Def2; let x, y be Variable of f; ::_thesis: ( ( s . x <= s . y implies (f . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (f . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (f . (s,(x leq y))) . z = s . z ) ) set v = ^ b9; A1: (^ b9) . s = b by FUNCOP_1:7; A2: ( (. x) . s <= (. y) . s implies IFGT (((. x) . s),((. y) . s),0,1) = 1 ) by XXREAL_0:def_11; (. x) . s = s . ((^ x) . s) by Def19; then A3: s . x = (. x) . s by FUNCOP_1:7; A4: ( (. x) . s > (. y) . s implies IFGT (((. x) . s),((. y) . s),0,1) = 0 ) by XXREAL_0:def_11; A5: (leq ((. x),(. y))) . s = IFGT (((. x) . s),((. y) . s),0,1) by Def31; (. y) . s = s . ((^ y) . s) by Def19; hence ( ( s . x <= s . y implies (f . (s,(x leq y))) . b = 1 ) & ( s . x > s . y implies (f . (s,(x leq y))) . b = 0 ) & ( for z being Element of X st z <> b holds (f . (s,(x leq y))) . z = s . z ) ) by A3, A1, A2, A4, A5, Th24, FUNCOP_1:7; ::_thesis: verum end; theorem :: AOFA_I00:36 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x being Variable of g for i being integer number holds ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) let x be Variable of g; ::_thesis: for i being integer number holds ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) let i be integer number ; ::_thesis: ( ( s . x <= i implies g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) implies s . x <= i ) & ( s . x >= i implies g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) implies s . x >= i ) ) ( g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x leq i))) . b <> 0 ) by Th2; hence ( s . x <= i iff g . (s,(x leq i)) in (Funcs (X,INT)) \ (b,0) ) by Th34; ::_thesis: ( s . x >= i iff g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) ( g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x geq i))) . b <> 0 ) by Th2; hence ( s . x >= i iff g . (s,(x geq i)) in (Funcs (X,INT)) \ (b,0) ) by Th34; ::_thesis: verum end; theorem :: AOFA_I00:37 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) implies s . x <= s . y ) & ( s . x >= s . y implies g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) implies s . x >= s . y ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) implies s . x <= s . y ) & ( s . x >= s . y implies g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) implies s . x >= s . y ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) implies s . x <= s . y ) & ( s . x >= s . y implies g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) implies s . x >= s . y ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) implies s . x <= s . y ) & ( s . x >= s . y implies g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) implies s . x >= s . y ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x <= s . y implies g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) implies s . x <= s . y ) & ( s . x >= s . y implies g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) implies s . x >= s . y ) ) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y being Variable of g holds ( ( s . x <= s . y implies g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) implies s . x <= s . y ) & ( s . x >= s . y implies g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) implies s . x >= s . y ) ) let x, y be Variable of g; ::_thesis: ( ( s . x <= s . y implies g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) implies s . x <= s . y ) & ( s . x >= s . y implies g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) implies s . x >= s . y ) ) ( g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x leq y))) . b <> 0 ) by Th2; hence ( s . x <= s . y iff g . (s,(x leq y)) in (Funcs (X,INT)) \ (b,0) ) by Th35; ::_thesis: ( s . x >= s . y iff g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) ( g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x geq y))) . b <> 0 ) by Th2; hence ( s . x >= s . y iff g . (s,(x geq y)) in (Funcs (X,INT)) \ (b,0) ) by Th35; ::_thesis: verum end; theorem Th38: :: AOFA_I00:38 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies (g . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (g . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (g . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (g . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt i))) . z = s . z & (g . (s,(x lt i))) . z = s . z ) ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies (g . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (g . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (g . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (g . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt i))) . z = s . z & (g . (s,(x lt i))) . z = s . z ) ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies (g . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (g . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (g . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (g . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt i))) . z = s . z & (g . (s,(x lt i))) . z = s . z ) ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies (g . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (g . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (g . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (g . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt i))) . z = s . z & (g . (s,(x lt i))) . z = s . z ) ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies (g . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (g . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (g . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (g . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt i))) . z = s . z & (g . (s,(x lt i))) . z = s . z ) ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x being Variable of f for i being integer number holds ( ( s . x > i implies (f . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (f . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (f . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (f . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x gt i))) . z = s . z & (f . (s,(x lt i))) . z = s . z ) ) ) reconsider b9 = b as Variable of f by Def2; let x be Variable of f; ::_thesis: for i being integer number holds ( ( s . x > i implies (f . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (f . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (f . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (f . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x gt i))) . z = s . z & (f . (s,(x lt i))) . z = s . z ) ) ) let i be integer number ; ::_thesis: ( ( s . x > i implies (f . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (f . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (f . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (f . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x gt i))) . z = s . z & (f . (s,(x lt i))) . z = s . z ) ) ) set v = ^ b9; A1: (. (i,A,f)) . s = i by FUNCOP_1:7; A2: (^ b9) . s = b by FUNCOP_1:7; A3: ( (. x) . s >= i implies IFGT (i,((. x) . s),1,0) = 0 ) by XXREAL_0:def_11; A4: ( (. x) . s < i implies IFGT (i,((. x) . s),1,0) = 1 ) by XXREAL_0:def_11; A5: (gt ((. (i,A,f)),(. x))) . s = IFGT (((. (i,A,f)) . s),((. x) . s),1,0) by Def32; A6: ( (. x) . s <= i implies IFGT (((. x) . s),i,1,0) = 0 ) by XXREAL_0:def_11; A7: (gt ((. x),(. (i,A,f)))) . s = IFGT (((. x) . s),((. (i,A,f)) . s),1,0) by Def32; A8: ( (. x) . s > i implies IFGT (((. x) . s),i,1,0) = 1 ) by XXREAL_0:def_11; (. x) . s = s . ((^ x) . s) by Def19; hence ( ( s . x > i implies (f . (s,(x gt i))) . b = 1 ) & ( s . x <= i implies (f . (s,(x gt i))) . b = 0 ) & ( s . x < i implies (f . (s,(x lt i))) . b = 1 ) & ( s . x >= i implies (f . (s,(x lt i))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x gt i))) . z = s . z & (f . (s,(x lt i))) . z = s . z ) ) ) by A1, A2, A8, A6, A4, A3, A7, A5, Th24, FUNCOP_1:7; ::_thesis: verum end; theorem Th39: :: AOFA_I00:39 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies (g . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (g . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (g . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (g . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt y))) . z = s . z & (g . (s,(x lt y))) . z = s . z ) ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies (g . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (g . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (g . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (g . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt y))) . z = s . z & (g . (s,(x lt y))) . z = s . z ) ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies (g . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (g . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (g . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (g . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt y))) . z = s . z & (g . (s,(x lt y))) . z = s . z ) ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies (g . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (g . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (g . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (g . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt y))) . z = s . z & (g . (s,(x lt y))) . z = s . z ) ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies (g . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (g . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (g . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (g . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (g . (s,(x gt y))) . z = s . z & (g . (s,(x lt y))) . z = s . z ) ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y being Variable of f holds ( ( s . x > s . y implies (f . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (f . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (f . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (f . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x gt y))) . z = s . z & (f . (s,(x lt y))) . z = s . z ) ) ) reconsider b9 = b as Variable of f by Def2; let x, y be Variable of f; ::_thesis: ( ( s . x > s . y implies (f . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (f . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (f . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (f . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x gt y))) . z = s . z & (f . (s,(x lt y))) . z = s . z ) ) ) set v = ^ b9; A1: (^ b9) . s = b by FUNCOP_1:7; A2: ( (. x) . s > (. y) . s implies IFGT (((. x) . s),((. y) . s),1,0) = 1 ) by XXREAL_0:def_11; A3: (gt ((. x),(. y))) . s = IFGT (((. x) . s),((. y) . s),1,0) by Def32; A4: ( (. x) . s < (. y) . s implies IFGT (((. y) . s),((. x) . s),1,0) = 1 ) by XXREAL_0:def_11; (. x) . s = s . ((^ x) . s) by Def19; then A5: s . x = (. x) . s by FUNCOP_1:7; A6: ( (. x) . s <= (. y) . s implies IFGT (((. x) . s),((. y) . s),1,0) = 0 ) by XXREAL_0:def_11; A7: (gt ((. y),(. x))) . s = IFGT (((. y) . s),((. x) . s),1,0) by Def32; A8: ( (. x) . s >= (. y) . s implies IFGT (((. y) . s),((. x) . s),1,0) = 0 ) by XXREAL_0:def_11; (. y) . s = s . ((^ y) . s) by Def19; hence ( ( s . x > s . y implies (f . (s,(x gt y))) . b = 1 ) & ( s . x <= s . y implies (f . (s,(x gt y))) . b = 0 ) & ( s . x < s . y implies (f . (s,(x lt y))) . b = 1 ) & ( s . x >= s . y implies (f . (s,(x lt y))) . b = 0 ) & ( for z being Element of X st z <> b holds ( (f . (s,(x gt y))) . z = s . z & (f . (s,(x lt y))) . z = s . z ) ) ) by A5, A1, A2, A6, A4, A8, A3, A7, Th24, FUNCOP_1:7; ::_thesis: verum end; theorem Th40: :: AOFA_I00:40 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g for i being integer number holds ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x being Variable of g for i being integer number holds ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) let x be Variable of g; ::_thesis: for i being integer number holds ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) let i be integer number ; ::_thesis: ( ( s . x > i implies g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) implies s . x > i ) & ( s . x < i implies g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) implies s . x < i ) ) ( g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x gt i))) . b <> 0 ) by Th2; hence ( s . x > i iff g . (s,(x gt i)) in (Funcs (X,INT)) \ (b,0) ) by Th38; ::_thesis: ( s . x < i iff g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) ( g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x lt i))) . b <> 0 ) by Th2; hence ( s . x < i iff g . (s,(x lt i)) in (Funcs (X,INT)) \ (b,0) ) by Th38; ::_thesis: verum end; theorem :: AOFA_I00:41 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) implies s . x > s . y ) & ( s . x < s . y implies g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) implies s . x < s . y ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) implies s . x > s . y ) & ( s . x < s . y implies g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) implies s . x < s . y ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) implies s . x > s . y ) & ( s . x < s . y implies g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) implies s . x < s . y ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) implies s . x > s . y ) & ( s . x < s . y implies g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) implies s . x < s . y ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y being Variable of g holds ( ( s . x > s . y implies g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) implies s . x > s . y ) & ( s . x < s . y implies g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) implies s . x < s . y ) ) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y being Variable of g holds ( ( s . x > s . y implies g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) implies s . x > s . y ) & ( s . x < s . y implies g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) implies s . x < s . y ) ) let x, y be Variable of g; ::_thesis: ( ( s . x > s . y implies g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) implies s . x > s . y ) & ( s . x < s . y implies g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) implies s . x < s . y ) ) ( g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x gt y))) . b <> 0 ) by Th2; hence ( s . x > s . y iff g . (s,(x gt y)) in (Funcs (X,INT)) \ (b,0) ) by Th39; ::_thesis: ( s . x < s . y iff g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) ( g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) iff (g . (s,(x lt y))) . b <> 0 ) by Th2; hence ( s . x < s . y iff g . (s,(x lt y)) in (Funcs (X,INT)) \ (b,0) ) by Th39; ::_thesis: verum end; theorem :: AOFA_I00:42 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for i being integer number for x being Variable of f holds ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) let i be integer number ; ::_thesis: for x being Variable of f holds ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) let x be Variable of f; ::_thesis: ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) A1: (. (i,A,f)) . s = i by FUNCOP_1:7; A2: (^ x) . s = x by FUNCOP_1:7; A3: (. (^ x)) . s = s . ((^ x) . s) by Def19; ((. x) mod (. (i,A,f))) . s = ((. x) . s) mod ((. (i,A,f)) . s) by Def30; hence ( (f . (s,(x %= i))) . x = (s . x) mod i & ( for z being Element of X st z <> x holds (f . (s,(x %= i))) . z = s . z ) ) by A1, A2, A3, Th24; ::_thesis: verum end; theorem Th43: :: AOFA_I00:43 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) let x be Variable of f; ::_thesis: for t being INT-Expression of A,f holds ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) let t be INT-Expression of A,f; ::_thesis: ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) A1: (^ x) . s = x by FUNCOP_1:7; A2: (. x) . s = s . x by Th22; ((. x) mod t) . s = ((. x) . s) mod (t . s) by Def30; hence ( (f . (s,(x %= t))) . x = (s . x) mod (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x %= t))) . z = s . z ) ) by A1, A2, Th24; ::_thesis: verum end; theorem Th44: :: AOFA_I00:44 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x, y being Variable of f holds ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) let x, y be Variable of f; ::_thesis: ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) A1: x %= y = x %= (. y) ; (. y) . s = s . y by Th22; hence ( (f . (s,(x %= y))) . x = (s . x) mod (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x %= y))) . z = s . z ) ) by A1, Th43; ::_thesis: verum end; theorem Th45: :: AOFA_I00:45 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for i being integer number for x being Variable of f holds ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for i being integer number for x being Variable of f holds ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) let i be integer number ; ::_thesis: for x being Variable of f holds ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) let x be Variable of f; ::_thesis: ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) A1: (. (i,A,f)) . s = i by FUNCOP_1:7; A2: (^ x) . s = x by FUNCOP_1:7; A3: (. (^ x)) . s = s . ((^ x) . s) by Def19; ((. x) div (. (i,A,f))) . s = ((. x) . s) div ((. (i,A,f)) . s) by Def29; hence ( (f . (s,(x /= i))) . x = (s . x) div i & ( for z being Element of X st z <> x holds (f . (s,(x /= i))) . z = s . z ) ) by A1, A2, A3, Th24; ::_thesis: verum end; theorem Th46: :: AOFA_I00:46 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x being Variable of f for t being INT-Expression of A,f holds ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) let x be Variable of f; ::_thesis: for t being INT-Expression of A,f holds ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) let t be INT-Expression of A,f; ::_thesis: ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) A1: (^ x) . s = x by FUNCOP_1:7; A2: (. x) . s = s . x by Th22; ((. x) div t) . s = ((. x) . s) div (t . s) by Def29; hence ( (f . (s,(x /= t))) . x = (s . x) div (t . s) & ( for z being Element of X st z <> x holds (f . (s,(x /= t))) . z = s . z ) ) by A1, A2, Th24; ::_thesis: verum end; theorem :: AOFA_I00:47 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for x, y being Variable of f holds ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for x, y being Variable of f holds ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) let x, y be Variable of f; ::_thesis: ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) A1: x /= y = x /= (. y) ; (. y) . s = s . y by Th22; hence ( (f . (s,(x /= y))) . x = (s . x) div (s . y) & ( for z being Element of X st z <> x holds (f . (s,(x /= y))) . z = s . z ) ) by A1, Th46; ::_thesis: verum end; theorem Th48: :: AOFA_I00:48 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( (g . (s,(t is_odd))) . b = (t . s) mod 2 & (g . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (g . (s,(t is_odd))) . z = s . z & (g . (s,(t is_even))) . z = s . z ) ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( (g . (s,(t is_odd))) . b = (t . s) mod 2 & (g . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (g . (s,(t is_odd))) . z = s . z & (g . (s,(t is_even))) . z = s . z ) ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( (g . (s,(t is_odd))) . b = (t . s) mod 2 & (g . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (g . (s,(t is_odd))) . z = s . z & (g . (s,(t is_even))) . z = s . z ) ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( (g . (s,(t is_odd))) . b = (t . s) mod 2 & (g . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (g . (s,(t is_odd))) . z = s . z & (g . (s,(t is_even))) . z = s . z ) ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( (g . (s,(t is_odd))) . b = (t . s) mod 2 & (g . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (g . (s,(t is_odd))) . z = s . z & (g . (s,(t is_even))) . z = s . z ) ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for t being INT-Expression of A,f holds ( (f . (s,(t is_odd))) . b = (t . s) mod 2 & (f . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (f . (s,(t is_odd))) . z = s . z & (f . (s,(t is_even))) . z = s . z ) ) ) let t be INT-Expression of A,f; ::_thesis: ( (f . (s,(t is_odd))) . b = (t . s) mod 2 & (f . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (f . (s,(t is_odd))) . z = s . z & (f . (s,(t is_even))) . z = s . z ) ) ) reconsider y = b as Variable of f by Def2; A1: t is_odd = y := (t mod (. (2,A,f))) ; dom (t + 1) = Funcs (X,INT) by FUNCT_2:def_1; then A2: (t + 1) . s = 1 + (t . s) by VALUED_1:def_2; A3: (. (2,A,f)) . s = 2 by FUNCOP_1:7; then A4: ((t + 1) mod (. (2,A,f))) . s = ((t + 1) . s) mod 2 by Def30; (t mod (. (2,A,f))) . s = (t . s) mod 2 by A3, Def30; hence ( (f . (s,(t is_odd))) . b = (t . s) mod 2 & (f . (s,(t is_even))) . b = ((t . s) + 1) mod 2 & ( for z being Element of X st z <> b holds ( (f . (s,(t is_odd))) . z = s . z & (f . (s,(t is_even))) . z = s . z ) ) ) by A1, A2, A4, Th26; ::_thesis: verum end; theorem Th49: :: AOFA_I00:49 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( (g . (s,(x is_odd))) . b = (s . x) mod 2 & (g . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (g . (s,(x is_odd))) . z = s . z ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( (g . (s,(x is_odd))) . b = (s . x) mod 2 & (g . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (g . (s,(x is_odd))) . z = s . z ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( (g . (s,(x is_odd))) . b = (s . x) mod 2 & (g . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (g . (s,(x is_odd))) . z = s . z ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( (g . (s,(x is_odd))) . b = (s . x) mod 2 & (g . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (g . (s,(x is_odd))) . z = s . z ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( (g . (s,(x is_odd))) . b = (s . x) mod 2 & (g . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (g . (s,(x is_odd))) . z = s . z ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x being Variable of f holds ( (f . (s,(x is_odd))) . b = (s . x) mod 2 & (f . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (f . (s,(x is_odd))) . z = s . z ) ) let x be Variable of f; ::_thesis: ( (f . (s,(x is_odd))) . b = (s . x) mod 2 & (f . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (f . (s,(x is_odd))) . z = s . z ) ) (. x) . s = s . x by Th22; hence ( (f . (s,(x is_odd))) . b = (s . x) mod 2 & (f . (s,(x is_even))) . b = ((s . x) + 1) mod 2 & ( for z being Element of X st z <> b holds (f . (s,(x is_odd))) . z = s . z ) ) by Th48; ::_thesis: verum end; theorem Th50: :: AOFA_I00:50 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( ( t . s is odd implies g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) implies t . s is odd ) & ( t . s is even implies g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) implies t . s is even ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( ( t . s is odd implies g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) implies t . s is odd ) & ( t . s is even implies g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) implies t . s is even ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( ( t . s is odd implies g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) implies t . s is odd ) & ( t . s is even implies g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) implies t . s is even ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( ( t . s is odd implies g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) implies t . s is odd ) & ( t . s is even implies g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) implies t . s is even ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for t being INT-Expression of A,g holds ( ( t . s is odd implies g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) implies t . s is odd ) & ( t . s is even implies g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) implies t . s is even ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for t being INT-Expression of A,f holds ( ( t . s is odd implies f . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) implies t . s is odd ) & ( t . s is even implies f . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) implies t . s is even ) ) let t be INT-Expression of A,f; ::_thesis: ( ( t . s is odd implies f . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) implies t . s is odd ) & ( t . s is even implies f . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) implies t . s is even ) ) A1: ( (t . s) mod 2 = 0 or (t . s) mod 2 = 1 ) by PRE_FF:6; A2: t . s = (((t . s) div 2) * 2) + ((t . s) mod 2) by INT_1:59; (f . (s,(t is_odd))) . b = (t . s) mod 2 by Th48; hence ( t . s is odd iff f . (s,(t is_odd)) in (Funcs (X,INT)) \ (b,0) ) by A1, A2, Th2; ::_thesis: ( t . s is even iff f . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) A3: ( ((t . s) + 1) mod 2 = 0 or ((t . s) + 1) mod 2 = 1 ) by PRE_FF:6; A4: (t . s) + 1 = ((((t . s) + 1) div 2) * 2) + (((t . s) + 1) mod 2) by INT_1:59; (f . (s,(t is_even))) . b = ((t . s) + 1) mod 2 by Th48; hence ( t . s is even iff f . (s,(t is_even)) in (Funcs (X,INT)) \ (b,0) ) by A3, A4, Th2; ::_thesis: verum end; theorem :: AOFA_I00:51 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( ( s . x is odd implies g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( ( s . x is odd implies g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( ( s . x is odd implies g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( ( s . x is odd implies g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x being Variable of g holds ( ( s . x is odd implies g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) let f be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x being Variable of f holds ( ( s . x is odd implies f . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies f . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) let x be Variable of f; ::_thesis: ( ( s . x is odd implies f . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies f . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) (. x) . s = s . x by Th22; hence ( ( s . x is odd implies f . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(x is_odd)) in (Funcs (X,INT)) \ (b,0) implies s . x is odd ) & ( s . x is even implies f . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) ) & ( f . (s,(x is_even)) in (Funcs (X,INT)) \ (b,0) implies s . x is even ) ) by Th50; ::_thesis: verum end; scheme :: AOFA_I00:sch 1 ForToIteration{ F1() -> Euclidean preIfWhileAlgebra, F2() -> non empty countable set , F3() -> Element of F2(), F4() -> Element of F1(), F5() -> Element of F1(), F6() -> Euclidean ExecutionFunction of F1(), Funcs (F2(),INT),(Funcs (F2(),INT)) \ (F3(),0), F7() -> Variable of F6(), F8() -> Variable of F6(), F9() -> Element of Funcs (F2(),INT), F10() -> INT-Expression of F1(),F6(), P1[ set ] } : ( P1[F6() . (F9(),F5())] & ( F10() . F9() <= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) + 1 ) & ( F10() . F9() > F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) provided A1: F5() = for-do ((F7() := F10()),(F7() leq F8()),(F7() += 1),F4()) and A2: P1[F6() . (F9(),(F7() := F10()))] and A3: for s being Element of Funcs (F2(),INT) st P1[s] holds ( P1[F6() . (s,(F4() \; (F7() += 1)))] & P1[F6() . (s,(F7() leq F8()))] ) and A4: for s being Element of Funcs (F2(),INT) st P1[s] holds ( (F6() . (s,F4())) . F7() = s . F7() & (F6() . (s,F4())) . F8() = s . F8() ) and A5: ( F8() <> F7() & F8() <> F3() & F7() <> F3() ) proof set C = F7() leq F8(); set S = Funcs (F2(),INT); reconsider s1 = F6() . (F9(),(F7() := F10())) as Element of Funcs (F2(),INT) ; reconsider s2 = F6() . (s1,(F7() leq F8())) as Element of Funcs (F2(),INT) ; A6: P1[s2] by A2, A3; defpred S1[ Element of Funcs (F2(),INT)] means ( P1[\$1] & ( F10() . F9() <= F9() . F8() implies (\$1 . F7()) - 1 <= F9() . F8() ) & \$1 . F8() = F9() . F8() ); A7: s1 . F7() = F10() . F9() by Th26; then A8: s2 . F7() = F10() . F9() by A5, Th35; defpred S2[ Element of Funcs (F2(),INT)] means \$1 . F7() <= \$1 . F8(); set T = (Funcs (F2(),INT)) \ (F3(),0); A9: F6() complies_with_while_wrt (Funcs (F2(),INT)) \ (F3(),0) by AOFA_000:def_32; set II = F4() \; (F7() += 1); A10: F6() . (F9(),F5()) = F6() . (s1,(while ((F7() leq F8()),(F4() \; (F7() += 1))))) by A1, AOFA_000:def_29; (F10() . F9()) - 1 < F10() . F9() by XREAL_1:44; then A11: S1[s1] by A2, A5, A7, Th26, XXREAL_0:2; A12: s1 . F8() = F9() . F8() by A5, Th26; then A13: s2 . F8() = F9() . F8() by A5, Th35; percases ( F10() . F9() <= F9() . F8() or F10() . F9() > F9() . F8() ) ; supposeA14: F10() . F9() <= F9() . F8() ; ::_thesis: ( P1[F6() . (F9(),F5())] & ( F10() . F9() <= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) + 1 ) & ( F10() . F9() > F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) deffunc H1( Element of Funcs (F2(),INT)) -> Element of NAT = In ((((\$1 . F8()) + 1) - (\$1 . F7())),NAT); defpred S3[ Element of Funcs (F2(),INT)] means ( P1[\$1] & S2[\$1] ); A15: for s being Element of Funcs (F2(),INT) st S1[s] & s in (Funcs (F2(),INT)) \ (F3(),0) & S2[s] holds S1[F6() . (s,(F4() \; (F7() += 1)))] proof let s be Element of Funcs (F2(),INT); ::_thesis: ( S1[s] & s in (Funcs (F2(),INT)) \ (F3(),0) & S2[s] implies S1[F6() . (s,(F4() \; (F7() += 1)))] ) assume that A16: S1[s] and s in (Funcs (F2(),INT)) \ (F3(),0) and A17: S2[s] ; ::_thesis: S1[F6() . (s,(F4() \; (F7() += 1)))] thus P1[F6() . (s,(F4() \; (F7() += 1)))] by A3, A16; ::_thesis: ( ( F10() . F9() <= F9() . F8() implies ((F6() . (s,(F4() \; (F7() += 1)))) . F7()) - 1 <= F9() . F8() ) & (F6() . (s,(F4() \; (F7() += 1)))) . F8() = F9() . F8() ) reconsider s9 = F6() . (s,F4()) as Element of Funcs (F2(),INT) ; reconsider s99 = F6() . (s9,(F7() += 1)) as Element of Funcs (F2(),INT) ; A18: s99 = F6() . (s,(F4() \; (F7() += 1))) by AOFA_000:def_29; A19: s99 . F7() = (s9 . F7()) + 1 by Th28; s9 . F8() = s . F8() by A4, A16; hence ( ( F10() . F9() <= F9() . F8() implies ((F6() . (s,(F4() \; (F7() += 1)))) . F7()) - 1 <= F9() . F8() ) & (F6() . (s,(F4() \; (F7() += 1)))) . F8() = F9() . F8() ) by A4, A5, A16, A17, A19, A18, Th28; ::_thesis: verum end; A20: for s being Element of Funcs (F2(),INT) st S3[s] holds ( ( S3[F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))] implies F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) in (Funcs (F2(),INT)) \ (F3(),0) ) & ( F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) in (Funcs (F2(),INT)) \ (F3(),0) implies S3[F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))] ) & H1(F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))) < H1(s) ) proof let s be Element of Funcs (F2(),INT); ::_thesis: ( S3[s] implies ( ( S3[F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))] implies F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) in (Funcs (F2(),INT)) \ (F3(),0) ) & ( F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) in (Funcs (F2(),INT)) \ (F3(),0) implies S3[F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))] ) & H1(F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))) < H1(s) ) ) reconsider s9 = F6() . (s,F4()) as Element of Funcs (F2(),INT) ; reconsider s99 = F6() . (s9,(F7() += 1)) as Element of Funcs (F2(),INT) ; reconsider s999 = F6() . (s99,(F7() leq F8())) as Element of Funcs (F2(),INT) ; A21: F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) = F6() . ((F6() . (s,(F4() \; (F7() += 1)))),(F7() leq F8())) by AOFA_000:def_29; A22: s99 . F8() = s9 . F8() by A5, Th28; A23: ( s99 . F7() <= s99 . F8() implies s999 . F3() = 1 ) by Th35; A24: ( s99 . F7() > s99 . F8() implies s999 . F3() = 0 ) by Th35; assume A25: S3[s] ; ::_thesis: ( ( S3[F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))] implies F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) in (Funcs (F2(),INT)) \ (F3(),0) ) & ( F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) in (Funcs (F2(),INT)) \ (F3(),0) implies S3[F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))] ) & H1(F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))) < H1(s) ) then reconsider j = (s . F8()) - (s . F7()) as Element of NAT by INT_1:5; A26: s999 . F7() = s99 . F7() by A5, Th35; A27: s99 = F6() . (s,(F4() \; (F7() += 1))) by AOFA_000:def_29; then P1[s99] by A3, A25; hence ( S3[F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))] iff F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8()))) in (Funcs (F2(),INT)) \ (F3(),0) ) by A3, A5, A21, A27, A26, A24, A23, Th2, Th35; ::_thesis: H1(F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))) < H1(s) A28: s99 . F7() = (s9 . F7()) + 1 by Th28; A29: s9 . F8() = s . F8() by A4, A25; A30: s9 . F7() = s . F7() by A4, A25; s999 . F8() = s99 . F8() by A5, Th35; then H1(s999) = j by A26, A30, A29, A28, A22, FUNCT_7:def_1; then H1(s999) + 1 = H1(s) by FUNCT_7:def_1; hence H1(F6() . (s,((F4() \; (F7() += 1)) \; (F7() leq F8())))) < H1(s) by A21, A27, NAT_1:13; ::_thesis: verum end; A31: for s being Element of Funcs (F2(),INT) st S1[s] holds ( S1[F6() . (s,(F7() leq F8()))] & ( F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F7() leq F8()))] ) & ( S2[F6() . (s,(F7() leq F8()))] implies F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) proof let s be Element of Funcs (F2(),INT); ::_thesis: ( S1[s] implies ( S1[F6() . (s,(F7() leq F8()))] & ( F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F7() leq F8()))] ) & ( S2[F6() . (s,(F7() leq F8()))] implies F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) ) A32: ( s . F7() > s . F8() implies (F6() . (s,(F7() leq F8()))) . F3() = 0 ) by Th35; assume A33: S1[s] ; ::_thesis: ( S1[F6() . (s,(F7() leq F8()))] & ( F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F7() leq F8()))] ) & ( S2[F6() . (s,(F7() leq F8()))] implies F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) hence P1[F6() . (s,(F7() leq F8()))] by A3; ::_thesis: ( ( F10() . F9() <= F9() . F8() implies ((F6() . (s,(F7() leq F8()))) . F7()) - 1 <= F9() . F8() ) & (F6() . (s,(F7() leq F8()))) . F8() = F9() . F8() & ( F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F7() leq F8()))] ) & ( S2[F6() . (s,(F7() leq F8()))] implies F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) A34: ( s . F7() <= s . F8() implies (F6() . (s,(F7() leq F8()))) . F3() = 1 ) by Th35; (F6() . (s,(F7() leq F8()))) . F7() = s . F7() by A5, Th35; hence ( ( F10() . F9() <= F9() . F8() implies ((F6() . (s,(F7() leq F8()))) . F7()) - 1 <= F9() . F8() ) & (F6() . (s,(F7() leq F8()))) . F8() = F9() . F8() & ( F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F7() leq F8()))] ) & ( S2[F6() . (s,(F7() leq F8()))] implies F6() . (s,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) by A5, A33, A32, A34, Th2, Th35; ::_thesis: verum end; s2 . F3() = 1 by A7, A12, A14, Th35; then A35: ( F6() . (s1,(F7() leq F8())) in (Funcs (F2(),INT)) \ (F3(),0) iff S3[F6() . (s1,(F7() leq F8()))] ) by A2, A3, A5, A12, A8, A14, Th35; A36: F6() iteration_terminates_for (F4() \; (F7() += 1)) \; (F7() leq F8()),F6() . (s1,(F7() leq F8())) from AOFA_000:sch_3(A35, A20); A37: ( S1[F6() . (s1,(while ((F7() leq F8()),(F4() \; (F7() += 1)))))] & not S2[F6() . (s1,(while ((F7() leq F8()),(F4() \; (F7() += 1)))))] ) from AOFA_000:sch_5(A11, A36, A15, A31); then (F6() . (F9(),F5())) . F7() >= (F9() . F8()) + 1 by A10, INT_1:7; then ((F6() . (F9(),F5())) . F7()) - 1 >= ((F9() . F8()) + 1) - 1 by XREAL_1:13; then ((F6() . (F9(),F5())) . F7()) - 1 = F9() . F8() by A10, A14, A37, XXREAL_0:1; hence ( P1[F6() . (F9(),F5())] & ( F10() . F9() <= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) + 1 ) & ( F10() . F9() > F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) by A1, A14, A37, AOFA_000:def_29; ::_thesis: verum end; supposeA38: F10() . F9() > F9() . F8() ; ::_thesis: ( P1[F6() . (F9(),F5())] & ( F10() . F9() <= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) + 1 ) & ( F10() . F9() > F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) then s2 . F3() = 0 by A7, A12, Th35; then s2 nin (Funcs (F2(),INT)) \ (F3(),0) by Th2; hence ( P1[F6() . (F9(),F5())] & ( F10() . F9() <= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) + 1 ) & ( F10() . F9() > F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) by A9, A8, A13, A10, A6, A38, AOFA_000:def_31; ::_thesis: verum end; end; end; scheme :: AOFA_I00:sch 2 ForDowntoIteration{ F1() -> Euclidean preIfWhileAlgebra, F2() -> non empty countable set , F3() -> Element of F2(), F4() -> Element of F1(), F5() -> Element of F1(), F6() -> Euclidean ExecutionFunction of F1(), Funcs (F2(),INT),(Funcs (F2(),INT)) \ (F3(),0), F7() -> Variable of F6(), F8() -> Variable of F6(), F9() -> Element of Funcs (F2(),INT), F10() -> INT-Expression of F1(),F6(), P1[ set ] } : ( P1[F6() . (F9(),F5())] & ( F10() . F9() >= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) - 1 ) & ( F10() . F9() < F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) provided A1: F5() = for-do ((F7() := F10()),((. F8()) leq (. F7())),(F7() += (- 1)),F4()) and A2: P1[F6() . (F9(),(F7() := F10()))] and A3: for s being Element of Funcs (F2(),INT) st P1[s] holds ( P1[F6() . (s,(F4() \; (F7() += (- 1))))] & P1[F6() . (s,(F8() leq F7()))] ) and A4: for s being Element of Funcs (F2(),INT) st P1[s] holds ( (F6() . (s,F4())) . F7() = s . F7() & (F6() . (s,F4())) . F8() = s . F8() ) and A5: ( F8() <> F7() & F8() <> F3() & F7() <> F3() ) proof set S = Funcs (F2(),INT); reconsider s1 = F6() . (F9(),(F7() := F10())) as Element of Funcs (F2(),INT) ; set C = F8() leq F7(); reconsider s2 = F6() . (s1,(F8() leq F7())) as Element of Funcs (F2(),INT) ; A6: P1[s2] by A2, A3; defpred S1[ Element of Funcs (F2(),INT)] means ( P1[\$1] & ( F10() . F9() >= F9() . F8() implies (\$1 . F7()) + 1 >= F9() . F8() ) & \$1 . F8() = F9() . F8() ); A7: s1 . F7() = F10() . F9() by Th26; then A8: S1[s1] by A2, A5, Th26, XREAL_1:39; A9: s2 . F7() = F10() . F9() by A5, A7, Th35; defpred S2[ Element of Funcs (F2(),INT)] means \$1 . F7() >= \$1 . F8(); set T = (Funcs (F2(),INT)) \ (F3(),0); A10: F6() complies_with_while_wrt (Funcs (F2(),INT)) \ (F3(),0) by AOFA_000:def_32; set II = F4() \; (F7() += (- 1)); A11: F6() . (F9(),F5()) = F6() . (s1,(while ((F8() leq F7()),(F4() \; (F7() += (- 1)))))) by A1, AOFA_000:def_29; A12: s1 . F8() = F9() . F8() by A5, Th26; then A13: s2 . F8() = F9() . F8() by A5, Th35; percases ( F10() . F9() >= F9() . F8() or F10() . F9() < F9() . F8() ) ; supposeA14: F10() . F9() >= F9() . F8() ; ::_thesis: ( P1[F6() . (F9(),F5())] & ( F10() . F9() >= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) - 1 ) & ( F10() . F9() < F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) deffunc H1( Element of Funcs (F2(),INT)) -> Element of NAT = In ((((\$1 . F7()) + 1) - (\$1 . F8())),NAT); defpred S3[ Element of Funcs (F2(),INT)] means ( P1[\$1] & S2[\$1] ); A15: for s being Element of Funcs (F2(),INT) st S1[s] & s in (Funcs (F2(),INT)) \ (F3(),0) & S2[s] holds S1[F6() . (s,(F4() \; (F7() += (- 1))))] proof let s be Element of Funcs (F2(),INT); ::_thesis: ( S1[s] & s in (Funcs (F2(),INT)) \ (F3(),0) & S2[s] implies S1[F6() . (s,(F4() \; (F7() += (- 1))))] ) assume that A16: S1[s] and s in (Funcs (F2(),INT)) \ (F3(),0) and A17: S2[s] ; ::_thesis: S1[F6() . (s,(F4() \; (F7() += (- 1))))] thus P1[F6() . (s,(F4() \; (F7() += (- 1))))] by A3, A16; ::_thesis: ( ( F10() . F9() >= F9() . F8() implies ((F6() . (s,(F4() \; (F7() += (- 1))))) . F7()) + 1 >= F9() . F8() ) & (F6() . (s,(F4() \; (F7() += (- 1))))) . F8() = F9() . F8() ) reconsider s99 = F6() . (s,F4()) as Element of Funcs (F2(),INT) ; reconsider s999 = F6() . (s99,(F7() += (- 1))) as Element of Funcs (F2(),INT) ; A18: s999 = F6() . (s,(F4() \; (F7() += (- 1)))) by AOFA_000:def_29; A19: s999 . F7() = (s99 . F7()) - 1 by Th28; s99 . F8() = s . F8() by A4, A16; hence ( ( F10() . F9() >= F9() . F8() implies ((F6() . (s,(F4() \; (F7() += (- 1))))) . F7()) + 1 >= F9() . F8() ) & (F6() . (s,(F4() \; (F7() += (- 1))))) . F8() = F9() . F8() ) by A4, A5, A16, A17, A19, A18, Th28; ::_thesis: verum end; A20: for s being Element of Funcs (F2(),INT) st S3[s] holds ( ( S3[F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))] implies F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) in (Funcs (F2(),INT)) \ (F3(),0) ) & ( F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) in (Funcs (F2(),INT)) \ (F3(),0) implies S3[F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))] ) & H1(F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))) < H1(s) ) proof let s be Element of Funcs (F2(),INT); ::_thesis: ( S3[s] implies ( ( S3[F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))] implies F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) in (Funcs (F2(),INT)) \ (F3(),0) ) & ( F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) in (Funcs (F2(),INT)) \ (F3(),0) implies S3[F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))] ) & H1(F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))) < H1(s) ) ) reconsider s9 = F6() . (s,F4()) as Element of Funcs (F2(),INT) ; reconsider s99 = F6() . (s9,(F7() += (- 1))) as Element of Funcs (F2(),INT) ; reconsider s999 = F6() . (s99,(F8() leq F7())) as Element of Funcs (F2(),INT) ; A21: F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) = F6() . ((F6() . (s,(F4() \; (F7() += (- 1))))),(F8() leq F7())) by AOFA_000:def_29; A22: s99 . F8() = s9 . F8() by A5, Th28; A23: ( s99 . F7() >= s99 . F8() implies s999 . F3() = 1 ) by Th35; A24: ( s99 . F7() < s99 . F8() implies s999 . F3() = 0 ) by Th35; assume A25: S3[s] ; ::_thesis: ( ( S3[F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))] implies F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) in (Funcs (F2(),INT)) \ (F3(),0) ) & ( F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) in (Funcs (F2(),INT)) \ (F3(),0) implies S3[F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))] ) & H1(F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))) < H1(s) ) then reconsider j = (s . F7()) - (s . F8()) as Element of NAT by INT_1:5; A26: s999 . F7() = s99 . F7() by A5, Th35; A27: s99 = F6() . (s,(F4() \; (F7() += (- 1)))) by AOFA_000:def_29; then P1[s99] by A3, A25; hence ( S3[F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))] iff F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7()))) in (Funcs (F2(),INT)) \ (F3(),0) ) by A3, A5, A21, A27, A26, A24, A23, Th2, Th35; ::_thesis: H1(F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))) < H1(s) A28: s99 . F7() = (s9 . F7()) - 1 by Th28; A29: s9 . F8() = s . F8() by A4, A25; A30: s9 . F7() = s . F7() by A4, A25; s999 . F8() = s99 . F8() by A5, Th35; then H1(s999) = j by A26, A30, A29, A28, A22, FUNCT_7:def_1; then H1(s999) + 1 = H1(s) by FUNCT_7:def_1; hence H1(F6() . (s,((F4() \; (F7() += (- 1))) \; (F8() leq F7())))) < H1(s) by A21, A27, NAT_1:13; ::_thesis: verum end; A31: for s being Element of Funcs (F2(),INT) st S1[s] holds ( S1[F6() . (s,(F8() leq F7()))] & ( F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F8() leq F7()))] ) & ( S2[F6() . (s,(F8() leq F7()))] implies F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) proof let s be Element of Funcs (F2(),INT); ::_thesis: ( S1[s] implies ( S1[F6() . (s,(F8() leq F7()))] & ( F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F8() leq F7()))] ) & ( S2[F6() . (s,(F8() leq F7()))] implies F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) ) A32: ( s . F7() < s . F8() implies (F6() . (s,(F8() leq F7()))) . F3() = 0 ) by Th35; assume A33: S1[s] ; ::_thesis: ( S1[F6() . (s,(F8() leq F7()))] & ( F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F8() leq F7()))] ) & ( S2[F6() . (s,(F8() leq F7()))] implies F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) hence P1[F6() . (s,(F8() leq F7()))] by A3; ::_thesis: ( ( F10() . F9() >= F9() . F8() implies ((F6() . (s,(F8() leq F7()))) . F7()) + 1 >= F9() . F8() ) & (F6() . (s,(F8() leq F7()))) . F8() = F9() . F8() & ( F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F8() leq F7()))] ) & ( S2[F6() . (s,(F8() leq F7()))] implies F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) A34: ( s . F7() >= s . F8() implies (F6() . (s,(F8() leq F7()))) . F3() = 1 ) by Th35; (F6() . (s,(F8() leq F7()))) . F7() = s . F7() by A5, Th35; hence ( ( F10() . F9() >= F9() . F8() implies ((F6() . (s,(F8() leq F7()))) . F7()) + 1 >= F9() . F8() ) & (F6() . (s,(F8() leq F7()))) . F8() = F9() . F8() & ( F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) implies S2[F6() . (s,(F8() leq F7()))] ) & ( S2[F6() . (s,(F8() leq F7()))] implies F6() . (s,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) ) ) by A5, A33, A32, A34, Th2, Th35; ::_thesis: verum end; s2 . F3() = 1 by A7, A12, A14, Th35; then A35: ( F6() . (s1,(F8() leq F7())) in (Funcs (F2(),INT)) \ (F3(),0) iff S3[F6() . (s1,(F8() leq F7()))] ) by A2, A3, A5, A12, A9, A14, Th35; A36: F6() iteration_terminates_for (F4() \; (F7() += (- 1))) \; (F8() leq F7()),F6() . (s1,(F8() leq F7())) from AOFA_000:sch_3(A35, A20); A37: ( S1[F6() . (s1,(while ((F8() leq F7()),(F4() \; (F7() += (- 1))))))] & not S2[F6() . (s1,(while ((F8() leq F7()),(F4() \; (F7() += (- 1))))))] ) from AOFA_000:sch_5(A8, A36, A15, A31); then ((F6() . (F9(),F5())) . F7()) + 1 <= ((F9() . F8()) + 1) - 1 by A11, INT_1:7; then ((F6() . (F9(),F5())) . F7()) + 1 = F9() . F8() by A11, A14, A37, XXREAL_0:1; hence ( P1[F6() . (F9(),F5())] & ( F10() . F9() >= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) - 1 ) & ( F10() . F9() < F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) by A1, A14, A37, AOFA_000:def_29; ::_thesis: verum end; supposeA38: F10() . F9() < F9() . F8() ; ::_thesis: ( P1[F6() . (F9(),F5())] & ( F10() . F9() >= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) - 1 ) & ( F10() . F9() < F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) then s2 . F3() = 0 by A7, A12, Th35; then s2 nin (Funcs (F2(),INT)) \ (F3(),0) by Th2; hence ( P1[F6() . (F9(),F5())] & ( F10() . F9() >= F9() . F8() implies (F6() . (F9(),F5())) . F7() = (F9() . F8()) - 1 ) & ( F10() . F9() < F9() . F8() implies (F6() . (F9(),F5())) . F7() = F10() . F9() ) & (F6() . (F9(),F5())) . F8() = F9() . F8() ) by A10, A9, A13, A11, A6, A38, AOFA_000:def_31; ::_thesis: verum end; end; end; begin theorem Th52: :: AOFA_I00:52 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let I be Element of A; ::_thesis: for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let i, n be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) implies g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) ) given d being Function such that A1: d . b = 0 and A2: d . n = 1 and A3: d . i = 2 ; ::_thesis: ( ex s being Element of Funcs (X,INT) st ( (g . (s,I)) . n = s . n implies not (g . (s,I)) . i = s . i ) or g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) ) set J = i += 1; set C = i leq n; set S = Funcs (X,INT); set h = g; assume A4: for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ; ::_thesis: g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) deffunc H1( Element of Funcs (X,INT)) -> Element of NAT = In ((((\$1 . n) + 1) - (\$1 . i)),NAT); defpred S1[ Element of Funcs (X,INT)] means \$1 . i <= \$1 . n; set T = (Funcs (X,INT)) \ (b,0); A5: i <> n by A2, A3; A6: for s being Element of Funcs (X,INT) st S1[s] holds ( ( S1[g . (s,((I \; (i += 1)) \; (i leq n)))] implies g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((I \; (i += 1)) \; (i leq n)))] ) & H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[s] implies ( ( S1[g . (s,((I \; (i += 1)) \; (i leq n)))] implies g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((I \; (i += 1)) \; (i leq n)))] ) & H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) ) ) set s1 = g . (s,I); set q = g . (s,(I \; (i += 1))); set q1 = g . ((g . (s,(I \; (i += 1)))),(i leq n)); A7: g . (s,(I \; (i += 1))) = g . ((g . (s,I)),(i += 1)) by AOFA_000:def_29; (g . (s,I)) . i = s . i by A4; then (g . (s,(I \; (i += 1)))) . i = (s . i) + 1 by A7, Th28; then A8: (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . i = (s . i) + 1 by A1, A3, Th35; A9: ( (g . (s,(I \; (i += 1)))) . i > (g . (s,(I \; (i += 1)))) . n implies (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . b = 0 ) by Th35; assume S1[s] ; ::_thesis: ( ( S1[g . (s,((I \; (i += 1)) \; (i leq n)))] implies g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((I \; (i += 1)) \; (i leq n)))] ) & H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) ) then reconsider ni = (s . n) - (s . i) as Element of NAT by INT_1:3, XREAL_1:48; A10: g . ((g . (s,(I \; (i += 1)))),(i leq n)) = g . (s,((I \; (i += 1)) \; (i leq n))) by AOFA_000:def_29; A11: ( (g . (s,(I \; (i += 1)))) . i <= (g . (s,(I \; (i += 1)))) . n implies (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . b = 1 ) by Th35; (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . i = (g . (s,(I \; (i += 1)))) . i by A1, A3, Th35; hence ( S1[g . (s,((I \; (i += 1)) \; (i leq n)))] iff g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) by A1, A2, A9, A11, A10, Th2, Th35; ::_thesis: H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) A12: H1(s) = ni + 1 by FUNCT_7:def_1; (g . (s,I)) . n = s . n by A4; then (g . (s,(I \; (i += 1)))) . n = s . n by A5, A7, Th28; then (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . n = s . n by A1, A2, Th35; then H1(g . ((g . (s,(I \; (i += 1)))),(i leq n))) = ni by A8, FUNCT_7:def_1; hence H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) by A10, A12, NAT_1:13; ::_thesis: verum end; reconsider s1 = g . (s,(i leq n)) as Element of Funcs (X,INT) ; A13: ( s . i > s . n implies s1 . b = 0 ) by Th35; A14: ( s . i <= s . n implies s1 . b = 1 ) by Th35; s1 . i = s . i by A1, A3, Th35; then A15: ( s1 in (Funcs (X,INT)) \ (b,0) iff S1[s1] ) by A1, A2, A13, A14, Th2, Th35; g iteration_terminates_for (I \; (i += 1)) \; (i leq n),s1 from AOFA_000:sch_3(A15, A6); hence g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) ; ::_thesis: verum end; theorem Th53: :: AOFA_I00:53 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let X be non empty countable set ; ::_thesis: for s being Element of Funcs (X,INT) for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let s be Element of Funcs (X,INT); ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for P being set for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let P be set ; ::_thesis: for I being Element of A for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let I be Element of A; ::_thesis: for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P holds g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) let i, n be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) & s in P implies g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) ) given d being Function such that A1: d . b = 0 and A2: d . n = 1 and A3: d . i = 2 ; ::_thesis: ( ex s being Element of Funcs (X,INT) st ( s in P & not ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) ) or not s in P or g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) ) set J = i += 1; set C = i leq n; set S = Funcs (X,INT); set h = g; assume that A4: for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in P & g . (s,(i leq n)) in P & g . (s,(i += 1)) in P ) and A5: s in P ; ::_thesis: g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) defpred S1[ Element of Funcs (X,INT)] means \$1 in P; reconsider s1 = g . (s,(i leq n)) as Element of Funcs (X,INT) ; A6: S1[s1] by A4, A5; deffunc H1( Element of Funcs (X,INT)) -> Element of NAT = In ((((\$1 . n) + 1) - (\$1 . i)),NAT); defpred S2[ Element of Funcs (X,INT)] means \$1 . i <= \$1 . n; set T = (Funcs (X,INT)) \ (b,0); A7: i <> n by A2, A3; A8: for s being Element of Funcs (X,INT) st S1[s] & s in (Funcs (X,INT)) \ (b,0) & S2[s] holds ( S1[g . (s,((I \; (i += 1)) \; (i leq n)))] & ( S2[g . (s,((I \; (i += 1)) \; (i leq n)))] implies g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) implies S2[g . (s,((I \; (i += 1)) \; (i leq n)))] ) & H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[s] & s in (Funcs (X,INT)) \ (b,0) & S2[s] implies ( S1[g . (s,((I \; (i += 1)) \; (i leq n)))] & ( S2[g . (s,((I \; (i += 1)) \; (i leq n)))] implies g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) implies S2[g . (s,((I \; (i += 1)) \; (i leq n)))] ) & H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) ) ) assume that A9: S1[s] and s in (Funcs (X,INT)) \ (b,0) and A10: S2[s] ; ::_thesis: ( S1[g . (s,((I \; (i += 1)) \; (i leq n)))] & ( S2[g . (s,((I \; (i += 1)) \; (i leq n)))] implies g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) implies S2[g . (s,((I \; (i += 1)) \; (i leq n)))] ) & H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) ) set q = g . (s,(I \; (i += 1))); set s1 = g . (s,I); set q1 = g . ((g . (s,(I \; (i += 1)))),(i leq n)); A11: g . (s,(I \; (i += 1))) = g . ((g . (s,I)),(i += 1)) by AOFA_000:def_29; (g . (s,I)) . i = s . i by A4, A9; then (g . (s,(I \; (i += 1)))) . i = (s . i) + 1 by A11, Th28; then A12: (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . i = (s . i) + 1 by A1, A3, Th35; reconsider ni = (s . n) - (s . i) as Element of NAT by A10, INT_1:3, XREAL_1:48; A13: H1(s) = ni + 1 by FUNCT_7:def_1; A14: ( (g . (s,(I \; (i += 1)))) . i <= (g . (s,(I \; (i += 1)))) . n implies (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . b = 1 ) by Th35; A15: g . ((g . (s,(I \; (i += 1)))),(i leq n)) = g . (s,((I \; (i += 1)) \; (i leq n))) by AOFA_000:def_29; S1[g . (s,I)] by A4, A9; then S1[g . (s,(I \; (i += 1)))] by A4, A11; hence S1[g . (s,((I \; (i += 1)) \; (i leq n)))] by A4, A15; ::_thesis: ( ( S2[g . (s,((I \; (i += 1)) \; (i leq n)))] implies g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) implies S2[g . (s,((I \; (i += 1)) \; (i leq n)))] ) & H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) ) A16: ( (g . (s,(I \; (i += 1)))) . i > (g . (s,(I \; (i += 1)))) . n implies (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . b = 0 ) by Th35; (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . i = (g . (s,(I \; (i += 1)))) . i by A1, A3, Th35; hence ( S2[g . (s,((I \; (i += 1)) \; (i leq n)))] iff g . (s,((I \; (i += 1)) \; (i leq n))) in (Funcs (X,INT)) \ (b,0) ) by A1, A2, A16, A14, A15, Th2, Th35; ::_thesis: H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) (g . (s,I)) . n = s . n by A4, A9; then (g . (s,(I \; (i += 1)))) . n = s . n by A7, A11, Th28; then (g . ((g . (s,(I \; (i += 1)))),(i leq n))) . n = s . n by A1, A2, Th35; then H1(g . ((g . (s,(I \; (i += 1)))),(i leq n))) = ni by A12, FUNCT_7:def_1; hence H1(g . (s,((I \; (i += 1)) \; (i leq n)))) < H1(s) by A15, A13, NAT_1:13; ::_thesis: verum end; A17: ( s . i > s . n implies s1 . b = 0 ) by Th35; A18: ( s . i <= s . n implies s1 . b = 1 ) by Th35; s1 . i = s . i by A1, A3, Th35; then A19: ( s1 in (Funcs (X,INT)) \ (b,0) iff S2[s1] ) by A1, A2, A17, A18, Th2, Th35; g iteration_terminates_for (I \; (i += 1)) \; (i leq n),s1 from AOFA_000:sch_4(A6, A19, A8); hence g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . (s,(i leq n)) ; ::_thesis: verum end; theorem Th54: :: AOFA_I00:54 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let X be non empty countable set ; ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let t be INT-Expression of A,f; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for I being Element of A st I is_terminating_wrt g holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let I be Element of A; ::_thesis: ( I is_terminating_wrt g implies for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g ) assume A1: I is_terminating_wrt g ; ::_thesis: for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let i, n be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) implies for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g ) i += 1 is_terminating_wrt g by AOFA_000:104; then A2: I \; (i += 1) is_terminating_wrt g by A1, AOFA_000:110; set Q = while ((i leq n),(I \; (i += 1))); given d being Function such that A3: d . b = 0 and A4: d . n = 1 and A5: d . i = 2 ; ::_thesis: ( ex s being Element of Funcs (X,INT) st ( (g . (s,I)) . n = s . n implies not (g . (s,I)) . i = s . i ) or for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g ) assume A6: for s being Element of Funcs (X,INT) holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ; ::_thesis: for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g let s be Element of Funcs (X,INT); :: according to AOFA_000:def_37 ::_thesis: [s,(for-do ((i := t),(i leq n),(i += 1),I))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) A7: [s,(i := t)] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_36; A8: i leq n is_terminating_wrt g by AOFA_000:104; g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . ((g . (s,(i := t))),(i leq n)) by A3, A4, A5, A6, Th52; then [(g . (s,(i := t))),(while ((i leq n),(I \; (i += 1))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by A8, A2, AOFA_000:114; hence [s,(for-do ((i := t),(i leq n),(i += 1),I))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by A7, AOFA_000:def_35; ::_thesis: verum end; theorem :: AOFA_I00:55 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P let X be non empty countable set ; ::_thesis: for T being Subset of (Funcs (X,INT)) for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P let T be Subset of (Funcs (X,INT)); ::_thesis: for f being Euclidean ExecutionFunction of A, Funcs (X,INT),T for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; ::_thesis: for t being INT-Expression of A,f for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P let t be INT-Expression of A,f; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for P being set for I being Element of A st I is_terminating_wrt g,P holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in P holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & P is_invariant_wrt i := t,g & P is_invariant_wrt I,g & P is_invariant_wrt i leq n,g & P is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,P set Z = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let S be set ; ::_thesis: for I being Element of A st I is_terminating_wrt g,S holds for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in S holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & S is_invariant_wrt i := t,g & S is_invariant_wrt I,g & S is_invariant_wrt i leq n,g & S is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,S let I be Element of A; ::_thesis: ( I is_terminating_wrt g,S implies for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in S holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & S is_invariant_wrt i := t,g & S is_invariant_wrt I,g & S is_invariant_wrt i leq n,g & S is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,S ) assume A1: I is_terminating_wrt g,S ; ::_thesis: for i, n being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in S holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & S is_invariant_wrt i := t,g & S is_invariant_wrt I,g & S is_invariant_wrt i leq n,g & S is_invariant_wrt i += 1,g holds for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,S let i, n be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . n = 1 & d . i = 2 ) & ( for s being Element of Funcs (X,INT) st s in S holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) & S is_invariant_wrt i := t,g & S is_invariant_wrt I,g & S is_invariant_wrt i leq n,g & S is_invariant_wrt i += 1,g implies for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,S ) given d being Function such that A2: d . b = 0 and A3: d . n = 1 and A4: d . i = 2 ; ::_thesis: ( ex s being Element of Funcs (X,INT) st ( s in S & not ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) ) or not S is_invariant_wrt i := t,g or not S is_invariant_wrt I,g or not S is_invariant_wrt i leq n,g or not S is_invariant_wrt i += 1,g or for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,S ) set C = i leq n; set J = I \; (i += 1); assume that A5: for s being Element of Funcs (X,INT) st s in S holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i ) and A6: S is_invariant_wrt i := t,g and A7: S is_invariant_wrt I,g and A8: S is_invariant_wrt i leq n,g and A9: S is_invariant_wrt i += 1,g ; ::_thesis: for-do ((i := t),(i leq n),(i += 1),I) is_terminating_wrt g,S let s be Element of Funcs (X,INT); :: according to AOFA_000:def_38 ::_thesis: ( not s in S or [s,(for-do ((i := t),(i leq n),(i += 1),I))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) ) assume s in S ; ::_thesis: [s,(for-do ((i := t),(i leq n),(i += 1),I))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) then A10: g . (s,(i := t)) in S by A6, AOFA_000:def_39; for s being Element of Funcs (X,INT) st s in S holds ( (g . (s,I)) . n = s . n & (g . (s,I)) . i = s . i & g . (s,I) in S & g . (s,(i leq n)) in S & g . (s,(i += 1)) in S ) by A5, A7, A8, A9, AOFA_000:def_39; then A11: g iteration_terminates_for (I \; (i += 1)) \; (i leq n),g . ((g . (s,(i := t))),(i leq n)) by A2, A3, A4, A10, Th53; set Q = while ((i leq n),(I \; (i += 1))); A12: i leq n is_terminating_wrt g by AOFA_000:104; A13: [s,(i := t)] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_36; S is_invariant_wrt I \; (i += 1),g by A7, A9, AOFA_000:109; then A14: for s being Element of Funcs (X,INT) st s in S & g . ((g . (s,(I \; (i += 1)))),(i leq n)) in (Funcs (X,INT)) \ (b,0) holds g . (s,(I \; (i += 1))) in S by AOFA_000:def_39; i += 1 is_terminating_wrt g,S by AOFA_000:107; then [(g . (s,(i := t))),(while ((i leq n),(I \; (i += 1))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by A1, A7, A8, A10, A11, A12, A14, AOFA_000:111, AOFA_000:116; hence [s,(for-do ((i := t),(i leq n),(i += 1),I))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by A13, AOFA_000:def_35; ::_thesis: verum end; begin definition let X be non empty countable set ; let A be Euclidean preIfWhileAlgebra; let T be Subset of (Funcs (X,INT)); let f be Euclidean ExecutionFunction of A, Funcs (X,INT),T; let s be Element of Funcs (X,INT); let I be Element of A; :: original: . redefine funcf . (s,I) -> Element of Funcs (X,INT); coherence f . (s,I) is Element of Funcs (X,INT) proof f . (s,I) is Element of Funcs (X,INT) ; hence f . (s,I) is Element of Funcs (X,INT) ; ::_thesis: verum end; end; theorem :: AOFA_I00:56 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))) is_terminating_wrt g proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))) is_terminating_wrt g let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))) is_terminating_wrt g let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))) is_terminating_wrt g let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))) is_terminating_wrt g set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let n, s, i be Variable of g; ::_thesis: ( ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) implies (s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))) is_terminating_wrt g ) given d being Function such that A1: d . n = 1 and A2: d . s = 2 and A3: d . i = 3 and A4: d . b = 4 ; ::_thesis: (s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))) is_terminating_wrt g A5: s <> n by A1, A2; s <> i by A2, A3; then A6: for q being Element of Funcs (X,INT) holds ( (g . (q,(s *= i))) . n = q . n & (g . (q,(s *= i))) . i = q . i ) by A5, Th33; A7: n <> b by A1, A4; A8: b <> i by A3, A4; let q be Element of Funcs (X,INT); :: according to AOFA_000:def_37 ::_thesis: [q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) set t = . (2,A,g); i <> n by A1, A3; then ex d9 being Function st ( d9 . b = 0 & d9 . n = 1 & d9 . i = 2 ) by A8, A7, Th1; then for-do ((i := (. (2,A,g))),(i leq n),(i += 1),(s *= i)) is_terminating_wrt g by A6, Th54, AOFA_000:104; then A9: [(g . (q,(s := 1))),(for-do ((i := (. (2,A,g))),(i leq n),(i += 1),(s *= i)))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_37; [q,(s := 1)] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_36; hence [q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by A9, AOFA_000:def_35; ::_thesis: verum end; theorem :: AOFA_I00:57 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! set f = g; let n, s, i be Variable of g; ::_thesis: ( ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) implies for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! ) given d being Function such that A1: d . n = 1 and A2: d . s = 2 and A3: d . i = 3 and A4: d . b = 4 ; ::_thesis: for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! A5: ( n <> i & n <> b & i <> b ) by A1, A3, A4; set S = Funcs (X,INT); let q be Element of Funcs (X,INT); ::_thesis: for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! reconsider q1 = g . (q,(s := 1)) as Element of Funcs (X,INT) ; defpred S1[ Element of Funcs (X,INT)] means ex K being Nat st ( K = (\$1 . i) - 1 & \$1 . s = K ! ); reconsider a = . (2,A,g) as INT-Expression of A,g ; reconsider q2 = g . (q1,(i := 2)) as Element of Funcs (X,INT) ; A6: q2 . i = 2 by Th25; A7: s <> i by A2, A3; then q2 . s = q1 . s by Th25; then A8: S1[g . (q1,(i := a))] by A6, Th25, NEWTON:13; set I = s *= i; A9: a . q1 = 2 by FUNCOP_1:7; A10: s <> b by A2, A4; A11: for q being Element of Funcs (X,INT) st S1[q] holds ( S1[g . (q,((s *= i) \; (i += 1)))] & S1[g . (q,(i leq n))] ) proof let q be Element of Funcs (X,INT); ::_thesis: ( S1[q] implies ( S1[g . (q,((s *= i) \; (i += 1)))] & S1[g . (q,(i leq n))] ) ) given Ki being Nat such that A12: Ki = (q . i) - 1 and A13: q . s = Ki ! ; ::_thesis: ( S1[g . (q,((s *= i) \; (i += 1)))] & S1[g . (q,(i leq n))] ) reconsider q3 = g . (q,(s *= i)) as Element of Funcs (X,INT) ; reconsider q4 = g . (q3,(i += 1)) as Element of Funcs (X,INT) ; A14: q3 . s = (q . s) * (q . i) by Th33; q4 . s = q3 . s by A7, Th28; then A15: q4 . s = (Ki + 1) ! by A12, A13, A14, NEWTON:15; A16: q4 = g . (q,((s *= i) \; (i += 1))) by AOFA_000:def_29; q4 . i = (q3 . i) + 1 by Th28; then Ki + 1 = (q4 . i) - 1 by A7, A12, Th33; hence S1[g . (q,((s *= i) \; (i += 1)))] by A16, A15; ::_thesis: S1[g . (q,(i leq n))] reconsider q9 = g . (q,(i leq n)) as Element of Funcs (X,INT) ; A17: q9 . i = q . i by A5, Th35; q9 . s = q . s by A10, Th35; hence S1[g . (q,(i leq n))] by A12, A13, A17; ::_thesis: verum end; reconsider F = for-do ((i := a),(i leq n),(i += 1),(s *= i)) as Element of A ; let N be Nat; ::_thesis: ( N = q . n implies (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! ) assume A18: N = q . n ; ::_thesis: (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = N ! A19: F = for-do ((i := a),(i leq n),(i += 1),(s *= i)) ; A20: s <> n by A1, A2; then A21: q1 . n = q . n by Th25; A22: for q being Element of Funcs (X,INT) st S1[q] holds ( (g . (q,(s *= i))) . i = q . i & (g . (q,(s *= i))) . n = q . n ) by A20, A7, Th32; A23: ( S1[g . (q1,F)] & ( a . q1 <= q1 . n implies (g . (q1,F)) . i = (q1 . n) + 1 ) & ( a . q1 > q1 . n implies (g . (q1,F)) . i = a . q1 ) & (g . (q1,F)) . n = q1 . n ) from AOFA_I00:sch_1(A19, A8, A11, A22, A5); thus (g . (q,((s := 1) \; (for-do ((i := 2),(i leq n),(i += 1),(s *= i)))))) . s = (g . (q1,F)) . s by AOFA_000:def_29 .= N ! by A18, A21, A23, A9, NAT_1:26, NEWTON:12, NEWTON:13 ; ::_thesis: verum end; theorem :: AOFA_I00:58 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))) is_terminating_wrt g proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))) is_terminating_wrt g let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))) is_terminating_wrt g let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))) is_terminating_wrt g let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, n, s, i being Variable of g st ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds (s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))) is_terminating_wrt g set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let x, n, s, i be Variable of g; ::_thesis: ( ex d being Function st ( d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) implies (s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))) is_terminating_wrt g ) given d being Function such that A1: d . n = 1 and A2: d . s = 2 and A3: d . i = 3 and A4: d . b = 4 ; ::_thesis: (s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))) is_terminating_wrt g A5: s <> n by A1, A2; s <> i by A2, A3; then A6: for q being Element of Funcs (X,INT) holds ( (g . (q,(s *= x))) . n = q . n & (g . (q,(s *= x))) . i = q . i ) by A5, Th33; A7: n <> b by A1, A4; A8: b <> i by A3, A4; let q be Element of Funcs (X,INT); :: according to AOFA_000:def_37 ::_thesis: [q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) set t = . (1,A,g); i <> n by A1, A3; then ex d9 being Function st ( d9 . b = 0 & d9 . n = 1 & d9 . i = 2 ) by A8, A7, Th1; then for-do ((i := (. (1,A,g))),(i leq n),(i += 1),(s *= x)) is_terminating_wrt g by A6, Th54, AOFA_000:104; then A9: [(g . (q,(s := 1))),(for-do ((i := (. (1,A,g))),(i leq n),(i += 1),(s *= x)))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_37; [q,(s := 1)] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_36; hence [q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by A9, AOFA_000:def_35; ::_thesis: verum end; theorem :: AOFA_I00:59 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . x = 0 & d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . x = 0 & d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . x = 0 & d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, n, s, i being Variable of g st ex d being Function st ( d . x = 0 & d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, n, s, i being Variable of g st ex d being Function st ( d . x = 0 & d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) holds for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N set f = g; let x, n, s, i be Variable of g; ::_thesis: ( ex d being Function st ( d . x = 0 & d . n = 1 & d . s = 2 & d . i = 3 & d . b = 4 ) implies for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N ) given d being Function such that A1: d . x = 0 and A2: d . n = 1 and A3: d . s = 2 and A4: d . i = 3 and A5: d . b = 4 ; ::_thesis: for q being Element of Funcs (X,INT) for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N A6: ( n <> i & n <> b & i <> b ) by A2, A4, A5; set S = Funcs (X,INT); let q be Element of Funcs (X,INT); ::_thesis: for N being Nat st N = q . n holds (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N reconsider q1 = g . (q,(s := 1)) as Element of Funcs (X,INT) ; reconsider q2 = g . (q1,(i := 1)) as Element of Funcs (X,INT) ; A7: s <> i by A3, A4; then A8: q2 . s = q1 . s by Th25; defpred S1[ Element of Funcs (X,INT)] means ex K being Nat st ( K = (\$1 . i) - 1 & \$1 . s = (q . x) |^ K & \$1 . x = q . x ); set I = s *= x; set q0 = q; A9: (q . x) |^ 0 = 1 by NEWTON:4; A10: s <> n by A2, A3; then A11: for q being Element of Funcs (X,INT) st S1[q] holds ( (g . (q,(s *= x))) . i = q . i & (g . (q,(s *= x))) . n = q . n ) by A7, Th32; A12: s <> b by A3, A5; A13: for q being Element of Funcs (X,INT) st S1[q] holds ( S1[g . (q,((s *= x) \; (i += 1)))] & S1[g . (q,(i leq n))] ) proof let q be Element of Funcs (X,INT); ::_thesis: ( S1[q] implies ( S1[g . (q,((s *= x) \; (i += 1)))] & S1[g . (q,(i leq n))] ) ) given Ki being Nat such that A14: Ki = (q . i) - 1 and A15: q . s = (q . x) |^ Ki and A16: q . x = q . x ; ::_thesis: ( S1[g . (q,((s *= x) \; (i += 1)))] & S1[g . (q,(i leq n))] ) reconsider q3 = g . (q,(s *= x)) as Element of Funcs (X,INT) ; reconsider q4 = g . (q3,(i += 1)) as Element of Funcs (X,INT) ; A17: q3 . s = (q . s) * (q . x) by Th33; q4 . s = q3 . s by A7, Th28; then A18: q4 . s = (q . x) |^ (Ki + 1) by A15, A16, A17, NEWTON:6; A19: q4 = g . (q,((s *= x) \; (i += 1))) by AOFA_000:def_29; A20: q3 . x = q . x by A1, A3, Th33; q4 . i = (q3 . i) + 1 by Th28; then Ki + 1 = (q4 . i) - 1 by A7, A14, Th33; hence S1[g . (q,((s *= x) \; (i += 1)))] by A1, A4, A16, A19, A20, A18, Th28; ::_thesis: S1[g . (q,(i leq n))] reconsider q9 = g . (q,(i leq n)) as Element of Funcs (X,INT) ; A21: q9 . s = q . s by A12, Th35; A22: q9 . i = q . i by A6, Th35; q9 . x = q . x by A1, A5, Th35; hence S1[g . (q,(i leq n))] by A14, A15, A16, A21, A22; ::_thesis: verum end; reconsider a = . (1,A,g) as INT-Expression of A,g ; reconsider F = for-do ((i := a),(i leq n),(i += 1),(s *= x)) as Element of A ; A23: F = for-do ((i := a),(i leq n),(i += 1),(s *= x)) ; A24: q2 . i = 1 by Th25; A25: q2 . x = q1 . x by A1, A4, Th25; A26: q1 . s = 1 by Th25; q1 . x = q . x by A1, A3, Th25; then A27: S1[g . (q1,(i := a))] by A26, A8, A24, A25, A9; A28: ( S1[g . (q1,F)] & ( a . q1 <= q1 . n implies (g . (q1,F)) . i = (q1 . n) + 1 ) & ( a . q1 > q1 . n implies (g . (q1,F)) . i = a . q1 ) & (g . (q1,F)) . n = q1 . n ) from AOFA_I00:sch_1(A23, A27, A13, A11, A6); A29: ((q . n) + 1) - 1 = q . n ; A30: q1 . n = q . n by A10, Th25; let N be Nat; ::_thesis: ( N = q . n implies (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N ) assume A31: N = q . n ; ::_thesis: (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (q . x) |^ N A32: ( N = 0 or N >= 1 ) by NAT_1:25; thus (g . (q,((s := 1) \; (for-do ((i := 1),(i leq n),(i += 1),(s *= x)))))) . s = (g . (q1,F)) . s by AOFA_000:def_29 .= (q . x) |^ N by A31, A30, A29, A28, A32, FUNCOP_1:7 ; ::_thesis: verum end; theorem :: AOFA_I00:60 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds ((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))) is_terminating_wrt g proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds ((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))) is_terminating_wrt g let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds ((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))) is_terminating_wrt g let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds ((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))) is_terminating_wrt g let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds ((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))) is_terminating_wrt g set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let n, x, y, z, i be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) implies ((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))) is_terminating_wrt g ) given d being Function such that A1: d . b = 0 and A2: d . n = 1 and A3: d . x = 2 and A4: d . y = 3 and A5: d . z = 4 and A6: d . i = 5 ; ::_thesis: ((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))) is_terminating_wrt g A7: i <> y by A4, A6; A8: n <> z by A2, A5; A9: n <> y by A2, A4; A10: n <> x by A2, A3; A11: i <> z by A5, A6; set I = ((z := x) \; (x := y)) \; (y += z); set I1 = z := x; set I2 = x := y; set I3 = y += z; A12: i <> x by A3, A6; A13: for q being Element of Funcs (X,INT) holds ( (g . (q,(((z := x) \; (x := y)) \; (y += z)))) . n = q . n & (g . (q,(((z := x) \; (x := y)) \; (y += z)))) . i = q . i ) proof let q be Element of Funcs (X,INT); ::_thesis: ( (g . (q,(((z := x) \; (x := y)) \; (y += z)))) . n = q . n & (g . (q,(((z := x) \; (x := y)) \; (y += z)))) . i = q . i ) thus (g . (q,(((z := x) \; (x := y)) \; (y += z)))) . n = (g . ((g . (q,((z := x) \; (x := y)))),(y += z))) . n by AOFA_000:def_29 .= (g . (q,((z := x) \; (x := y)))) . n by A9, Th30 .= (g . ((g . (q,(z := x))),(x := y))) . n by AOFA_000:def_29 .= (g . (q,(z := x))) . n by A10, Th27 .= q . n by A8, Th27 ; ::_thesis: (g . (q,(((z := x) \; (x := y)) \; (y += z)))) . i = q . i thus (g . (q,(((z := x) \; (x := y)) \; (y += z)))) . i = (g . ((g . (q,((z := x) \; (x := y)))),(y += z))) . i by AOFA_000:def_29 .= (g . (q,((z := x) \; (x := y)))) . i by A7, Th30 .= (g . ((g . (q,(z := x))),(x := y))) . i by AOFA_000:def_29 .= (g . (q,(z := x))) . i by A12, Th27 .= q . i by A11, Th27 ; ::_thesis: verum end; let s be Element of Funcs (X,INT); :: according to AOFA_000:def_37 ::_thesis: [s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) set s2 = g . (s,((x := 0) \; (y := 1))); i <> n by A2, A6; then ex d9 being Function st ( d9 . b = 0 & d9 . n = 1 & d9 . i = 2 ) by A1, A2, A6, Th1; then for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))) is_terminating_wrt g by A13, Th54, AOFA_000:104; then A14: [(g . (s,((x := 0) \; (y := 1)))),(for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_37; [s,((x := 0) \; (y := 1))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by AOFA_000:def_36; hence [s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z)))))] in TerminatingPrograms (A,(Funcs (X,INT)),((Funcs (X,INT)) \ (b,0)),g) by A14, AOFA_000:def_35; ::_thesis: verum end; theorem :: AOFA_I00:61 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds for s being Element of Funcs (X,INT) for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds for s being Element of Funcs (X,INT) for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds for s being Element of Funcs (X,INT) for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds for s being Element of Funcs (X,INT) for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for n, x, y, z, i being Variable of g st ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) holds for s being Element of Funcs (X,INT) for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N A1: 0 + 1 = 1 ; set S = Funcs (X,INT); let n, x, y, z, i be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . n = 1 & d . x = 2 & d . y = 3 & d . z = 4 & d . i = 5 ) implies for s being Element of Funcs (X,INT) for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N ) given d being Function such that A2: d . b = 0 and A3: d . n = 1 and A4: d . x = 2 and A5: d . y = 3 and A6: d . z = 4 and A7: d . i = 5 ; ::_thesis: for s being Element of Funcs (X,INT) for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N A8: n <> x by A3, A4; A9: y <> z by A5, A6; A10: x <> z by A4, A6; A11: i <> z by A6, A7; A12: n <> y by A3, A5; let s be Element of Funcs (X,INT); ::_thesis: for N being Element of NAT st N = s . n holds (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N reconsider s1 = g . (s,(x := 0)) as Element of Funcs (X,INT) ; reconsider s2 = g . (s1,(y := 1)) as Element of Funcs (X,INT) ; reconsider s4 = g . (s2,(i := 1)) as Element of Funcs (X,INT) ; A13: s4 . i = 1 by Th25; A14: i <> y by A5, A7; then A15: s4 . y = s2 . y by Th25; set I = ((z := x) \; (x := y)) \; (y += z); A16: s2 . y = 1 by Th25; A17: i <> x by A4, A7; then A18: s4 . x = s2 . x by Th25; defpred S1[ Element of Funcs (X,INT)] means ex N being Element of NAT st ( N = (\$1 . i) - 1 & \$1 . x = Fib N & \$1 . y = Fib (N + 1) ); reconsider a = . (1,A,g) as INT-Expression of A,g ; A19: s1 . x = 0 by Th25; A20: x <> y by A4, A5; then s2 . x = s1 . x by Th25; then A21: S1[g . (s2,(i := a))] by A19, A16, A15, A18, A13, A1, PRE_FF:1; A22: n <> z by A3, A6; A23: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_ (_(g_._(s,(((z_:=_x)_\;_(x_:=_y))_\;_(y_+=_z))))_._i_=_s_._i_&_(g_._(s,(((z_:=_x)_\;_(x_:=_y))_\;_(y_+=_z))))_._n_=_s_._n_&_(g_._(s,(((z_:=_x)_\;_(x_:=_y))_\;_(y_+=_z))))_._x_=_s_._y_&_(g_._(s,(((z_:=_x)_\;_(x_:=_y))_\;_(y_+=_z))))_._y_=_(s_._x)_+_(s_._y)_) let s be Element of Funcs (X,INT); ::_thesis: ( (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . i = s . i & (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . n = s . n & (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . x = s . y & (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . y = (s . x) + (s . y) ) reconsider s1 = g . (s,(z := x)) as Element of Funcs (X,INT) ; reconsider s2 = g . (s1,(x := y)) as Element of Funcs (X,INT) ; reconsider s3 = g . (s2,(y += z)) as Element of Funcs (X,INT) ; A24: g . (s,(((z := x) \; (x := y)) \; (y += z))) = g . ((g . (s,((z := x) \; (x := y)))),(y += z)) by AOFA_000:def_29 .= s3 by AOFA_000:def_29 ; A25: s1 . z = s . x by Th27; A26: s2 . n = s1 . n by A8, Th27; A27: s1 . i = s . i by A11, Th27; A28: s2 . z = s1 . z by A10, Th27; A29: s2 . y = s1 . y by A20, Th27; A30: s2 . i = s1 . i by A17, Th27; A31: s1 . y = s . y by A9, Th27; A32: s2 . x = s1 . y by Th27; s1 . n = s . n by A22, Th27; hence ( (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . i = s . i & (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . n = s . n & (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . x = s . y & (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . y = (s . x) + (s . y) ) by A12, A14, A20, A31, A25, A27, A26, A32, A29, A28, A30, A24, Th30; ::_thesis: verum end; A33: for s being Element of Funcs (X,INT) st S1[s] holds ( S1[g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))] & S1[g . (s,(i leq n))] ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[s] implies ( S1[g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))] & S1[g . (s,(i leq n))] ) ) given N being Element of NAT such that A34: N = (s . i) - 1 and A35: s . x = Fib N and A36: s . y = Fib (N + 1) ; ::_thesis: ( S1[g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))] & S1[g . (s,(i leq n))] ) reconsider s1 = g . (s,(((z := x) \; (x := y)) \; (y += z))) as Element of Funcs (X,INT) ; reconsider s2 = g . (s1,(i += 1)) as Element of Funcs (X,INT) ; A37: s1 . x = s . y by A23; A38: s2 . i = (s1 . i) + 1 by Th28; A39: s1 . y = (s . x) + (s . y) by A23; A40: s2 . y = s1 . y by A14, Th28; thus S1[g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))] ::_thesis: S1[g . (s,(i leq n))] proof take N + 1 ; ::_thesis: ( N + 1 = ((g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))) . i) - 1 & (g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))) . x = Fib (N + 1) & (g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))) . y = Fib ((N + 1) + 1) ) g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1))) = s2 by AOFA_000:def_29; hence ( N + 1 = ((g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))) . i) - 1 & (g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))) . x = Fib (N + 1) & (g . (s,((((z := x) \; (x := y)) \; (y += z)) \; (i += 1)))) . y = Fib ((N + 1) + 1) ) by A17, A23, A34, A35, A36, A37, A39, A40, A38, Th28, PRE_FF:1; ::_thesis: verum end; take N ; ::_thesis: ( N = ((g . (s,(i leq n))) . i) - 1 & (g . (s,(i leq n))) . x = Fib N & (g . (s,(i leq n))) . y = Fib (N + 1) ) thus ( N = ((g . (s,(i leq n))) . i) - 1 & (g . (s,(i leq n))) . x = Fib N & (g . (s,(i leq n))) . y = Fib (N + 1) ) by A2, A4, A5, A7, A34, A35, A36, Th35; ::_thesis: verum end; reconsider F = for-do ((i := a),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))) as Element of A ; reconsider s3 = g . (s2,(for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))) as Element of Funcs (X,INT) ; let N be Element of NAT ; ::_thesis: ( N = s . n implies (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N ) assume A41: N = s . n ; ::_thesis: (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N A42: F = for-do ((i := a),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))) ; g . (s,((x := 0) \; (y := 1))) = s2 by AOFA_000:def_29; then A43: g . (s,(((x := 0) \; (y := 1)) \; F)) = s3 by AOFA_000:def_29; A44: ( ( 0 <= N & N <= 0 ) or N >= 0 + 1 ) by NAT_1:13; A45: ( n <> i & n <> b & i <> b ) by A2, A3, A7; A46: a . s2 = 1 by FUNCOP_1:7; A47: for s being Element of Funcs (X,INT) st S1[s] holds ( (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . i = s . i & (g . (s,(((z := x) \; (x := y)) \; (y += z)))) . n = s . n ) by A23; A48: ( S1[g . (s2,F)] & ( a . s2 <= s2 . n implies (g . (s2,F)) . i = (s2 . n) + 1 ) & ( a . s2 > s2 . n implies (g . (s2,F)) . i = a . s2 ) & (g . (s2,F)) . n = s2 . n ) from AOFA_I00:sch_1(A42, A21, A33, A47, A45); s2 . n = s1 . n by A12, Th25; hence (g . (s,(((x := 0) \; (y := 1)) \; (for-do ((i := 1),(i leq n),(i += 1),(((z := x) \; (x := y)) \; (y += z))))))) . x = Fib N by A41, A43, A8, A48, A44, A46, Th25; ::_thesis: verum end; Lm1: for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) set h = g; set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let x, y, z be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) implies for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) ) given d being Function such that A1: d . b = 0 and A2: d . x = 1 and A3: d . y = 2 and A4: d . z = 3 ; ::_thesis: for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) A5: z <> x by A2, A4; let s be Element of Funcs (X,INT); ::_thesis: ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) & ( for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) set I = (((z := x) \; (z %= y)) \; (x := y)) \; (y := z); A6: y <> z by A3, A4; A7: x <> y by A2, A3; A8: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_ (_(g_._(s,((((z_:=_x)_\;_(z_%=_y))_\;_(x_:=_y))_\;_(y_:=_z))))_._x_=_s_._y_&_(g_._(s,((((z_:=_x)_\;_(z_%=_y))_\;_(x_:=_y))_\;_(y_:=_z))))_._y_=_(s_._x)_mod_(s_._y)_) let s be Element of Funcs (X,INT); ::_thesis: ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) ) reconsider s1 = g . (s,(z := x)) as Element of Funcs (X,INT) ; reconsider s2 = g . (s1,(z %= y)) as Element of Funcs (X,INT) ; reconsider s3 = g . (s2,(x := y)) as Element of Funcs (X,INT) ; reconsider s4 = g . (s3,(y := z)) as Element of Funcs (X,INT) ; A9: g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) = g . ((g . (s,(((z := x) \; (z %= y)) \; (x := y)))),(y := z)) by AOFA_000:def_29 .= g . ((g . ((g . (s,((z := x) \; (z %= y)))),(x := y))),(y := z)) by AOFA_000:def_29 .= s4 by AOFA_000:def_29 ; A10: s1 . z = s . x by Th27; A11: s2 . y = s1 . y by A6, Th44; A12: s2 . z = (s1 . z) mod (s1 . y) by Th44; A13: s3 . z = s2 . z by A5, Th27; A14: s3 . x = s2 . y by Th27; s1 . y = s . y by A6, Th27; hence ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) ) by A7, A9, A10, A11, A12, A14, A13, Th27; ::_thesis: verum end; hence ( (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) ) ; ::_thesis: for n, m being Element of NAT holds not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) deffunc H1( Element of Funcs (X,INT)) -> Element of NAT = In ((\$1 . y),NAT); defpred S1[ Element of Funcs (X,INT)] means \$1 . y > 0 ; set C = y gt 0; A15: for s being Element of Funcs (X,INT) st S1[s] holds ( ( S1[g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))] implies g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))] ) & H1(g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[s] implies ( ( S1[g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))] implies g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))] ) & H1(g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) ) ) assume A16: s . y > 0 ; ::_thesis: ( ( S1[g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))] implies g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))] ) & H1(g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) ) reconsider s9 = g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) as Element of Funcs (X,INT) ; A17: s9 . y = (s . x) mod (s . y) by A8; then A18: 0 <= s9 . y by A16, NEWTON:64; reconsider s99 = g . (s9,(y gt 0)) as Element of Funcs (X,INT) ; A19: g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) = s99 by AOFA_000:def_29; A20: ( s9 . y <= 0 implies s99 . b = 0 ) by Th38; ( s9 . y > 0 implies s99 . b = 1 ) by Th38; hence ( S1[g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))] iff g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) by A19, A20, Th2, Th38; ::_thesis: H1(g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) s99 . y = s9 . y by A1, A3, Th38; then A21: H1(s99) = s9 . y by A18, FUNCT_7:def_1, INT_1:3; A22: s9 . y < s . y by A16, A17, NEWTON:65; then H1(s) = s . y by A18, FUNCT_7:def_1, INT_1:3; hence H1(g . (s,(((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) by A22, A21, AOFA_000:def_29; ::_thesis: verum end; let n, m be Element of NAT ; ::_thesis: not ( m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) & not g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) assume A23: m = s . y ; ::_thesis: ( ( s in (Funcs (X,INT)) \ (b,0) & not m > 0 ) or ( m > 0 & not s in (Funcs (X,INT)) \ (b,0) ) or g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ) assume ( s in (Funcs (X,INT)) \ (b,0) iff m > 0 ) ; ::_thesis: g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s then A24: ( s in (Funcs (X,INT)) \ (b,0) iff S1[s] ) by A23; g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s from AOFA_000:sch_3(A24, A15); hence g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),s ; ::_thesis: verum end; theorem :: AOFA_I00:62 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let x, y, z be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) implies while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ) set P = { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ; given d being Function such that A1: d . b = 0 and A2: d . x = 1 and A3: d . y = 2 and A4: d . z = 3 ; ::_thesis: while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } set C = y gt 0; set I = (((z := x) \; (z %= y)) \; (x := y)) \; (y := z); A5: { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } is_invariant_wrt y gt 0,g proof let s be Element of Funcs (X,INT); :: according to AOFA_000:def_39 ::_thesis: ( not s in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } or g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ) set s1 = g . (s,(y gt 0)); assume s in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ; ::_thesis: g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } then A6: ex s9 being Element of Funcs (X,INT) st ( s9 = s & s9 . x > s9 . y & s9 . y >= 0 ) ; A7: (g . (s,(y gt 0))) . y = s . y by A1, A3, Th38; (g . (s,(y gt 0))) . x = s . x by A1, A2, Th38; hence g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } by A6, A7; ::_thesis: verum end; A8: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_st_s_in__{__s_where_s_is_Element_of_Funcs_(X,INT)_:_(_s_._x_>_s_._y_&_s_._y_>=_0_)__}__&_g_._((g_._(s,((((z_:=_x)_\;_(z_%=_y))_\;_(x_:=_y))_\;_(y_:=_z)))),(y_gt_0))_in_(Funcs_(X,INT))_\_(b,0)_holds_ g_._(s,((((z_:=_x)_\;_(z_%=_y))_\;_(x_:=_y))_\;_(y_:=_z)))_in__{__s_where_s_is_Element_of_Funcs_(X,INT)_:_(_s_._x_>_s_._y_&_s_._y_>=_0_)__}_ let s be Element of Funcs (X,INT); ::_thesis: ( s in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } & g . ((g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))),(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ) assume s in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ; ::_thesis: ( g . ((g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))),(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ) then ex s9 being Element of Funcs (X,INT) st ( s9 = s & s9 . x > s9 . y & s9 . y >= 0 ) ; then reconsider m = s . y as Element of NAT by INT_1:3; assume g . ((g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))),(y gt 0)) in (Funcs (X,INT)) \ (b,0) ; ::_thesis: g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } then (g . ((g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))),(y gt 0))) . b <> 0 by Th2; then A9: (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y > 0 by Th38; A10: (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x = s . y by A1, A2, A3, A4, Lm1; A11: (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y = (s . x) mod (s . y) by A1, A2, A3, A4, Lm1; then m <> 0 by A9, INT_1:def_10; then (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . x > (g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))) . y by A11, A10, NEWTON:65; hence g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } by A9; ::_thesis: verum end; A12: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_st_g_._(s,(y_gt_0))_in__{__s_where_s_is_Element_of_Funcs_(X,INT)_:_(_s_._x_>_s_._y_&_s_._y_>=_0_)__}__holds_ g_iteration_terminates_for_((((z_:=_x)_\;_(z_%=_y))_\;_(x_:=_y))_\;_(y_:=_z))_\;_(y_gt_0),g_._(s,(y_gt_0)) let s be Element of Funcs (X,INT); ::_thesis: ( g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } implies g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) ) set s1 = g . (s,(y gt 0)); A13: ( s . y <= 0 implies (g . (s,(y gt 0))) . b = 0 ) by Th38; assume g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } ; ::_thesis: g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) then ex s9 being Element of Funcs (X,INT) st ( s9 = g . (s,(y gt 0)) & s9 . x > s9 . y & s9 . y >= 0 ) ; then reconsider m = (g . (s,(y gt 0))) . y as Element of NAT by INT_1:3; ( s . y > 0 implies (g . (s,(y gt 0))) . b = 1 ) by Th38; then ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) iff m > 0 ) by A13, Th2, Th38; hence g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) by A1, A2, A3, A4, Lm1; ::_thesis: verum end; y gt 0 is_terminating_wrt g by AOFA_000:104; hence while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x > s . y & s . y >= 0 ) } by A5, A8, A12, AOFA_000:107, AOFA_000:118; ::_thesis: verum end; theorem :: AOFA_I00:63 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m set h = g; set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let x, y, z be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) implies for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m ) given d being Function such that A1: d . b = 0 and A2: d . x = 1 and A3: d . y = 2 and A4: d . z = 3 ; ::_thesis: for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m set C = y gt 0; set I = (((z := x) \; (z %= y)) \; (x := y)) \; (y := z); let s be Element of Funcs (X,INT); ::_thesis: for n, m being Element of NAT st n = s . x & m = s . y & n > m holds (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m reconsider fin = g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))))) as Element of Funcs (X,INT) ; defpred S1[ Element of Funcs (X,INT)] means ( fin . x divides \$1 . x & fin . x divides \$1 . y ); A5: for s being Element of Funcs (X,INT) st S1[g . (s,(y gt 0))] holds S1[s] by A1, A2, A3, Th38; A6: for s being Element of Funcs (X,INT) st S1[g . ((g . (s,(y gt 0))),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] & g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) holds S1[g . (s,(y gt 0))] proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[g . ((g . (s,(y gt 0))),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] & g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(y gt 0))] ) assume A7: S1[g . ((g . (s,(y gt 0))),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] ; ::_thesis: ( not g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) or S1[g . (s,(y gt 0))] ) reconsider s1 = g . (s,(y gt 0)) as Element of Funcs (X,INT) ; reconsider s2 = g . (s1,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) as Element of Funcs (X,INT) ; A8: ( s . y <= 0 implies s1 . b = 0 ) by Th38; A9: s1 . x = s . x by A1, A2, Th38; A10: s2 . y = (s1 . x) mod (s1 . y) by A1, A2, A3, A4, Lm1; A11: s2 . x = s1 . y by A1, A2, A3, A4, Lm1; A12: s1 . y = s . y by A1, A3, Th38; assume g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) ; ::_thesis: S1[g . (s,(y gt 0))] then s . x = (((s . x) div (s . y)) * (s2 . x)) + ((s2 . y) * 1) by A9, A12, A8, A11, A10, Th2, NEWTON:66; hence S1[g . (s,(y gt 0))] by A1, A2, A3, A4, A7, A9, Lm1, WSIERP_1:5; ::_thesis: verum end; reconsider s1 = g . (s,(y gt 0)) as Element of Funcs (X,INT) ; A13: s1 . y = s . y by A1, A3, Th38; A14: ( s . y <= 0 implies s1 . b = 0 ) by Th38; let n, m be Element of NAT ; ::_thesis: ( n = s . x & m = s . y & n > m implies (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m ) defpred S2[ Element of Funcs (X,INT)] means ( n gcd m divides \$1 . x & n gcd m divides \$1 . y & \$1 . x > \$1 . y & \$1 . y >= 0 ); defpred S3[ Element of Funcs (X,INT)] means \$1 . y > 0 ; assume that A15: n = s . x and A16: m = s . y and A17: n > m ; ::_thesis: (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m ( s . y > 0 implies s1 . b = 1 ) by Th38; then ( s1 in (Funcs (X,INT)) \ (b,0) iff m > 0 ) by A16, A14, Th2; then A18: g iteration_terminates_for ((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) by A1, A2, A3, A4, A16, A13, Lm1; A19: for s being Element of Funcs (X,INT) st S2[s] & s in (Funcs (X,INT)) \ (b,0) & S3[s] holds S2[g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] proof let s be Element of Funcs (X,INT); ::_thesis: ( S2[s] & s in (Funcs (X,INT)) \ (b,0) & S3[s] implies S2[g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] ) reconsider s99 = g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z))) as Element of Funcs (X,INT) ; assume A20: S2[s] ; ::_thesis: ( not s in (Funcs (X,INT)) \ (b,0) or not S3[s] or S2[g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] ) then reconsider n9 = s . x, m9 = s . y as Element of NAT by INT_1:3; assume that s in (Funcs (X,INT)) \ (b,0) and A21: S3[s] ; ::_thesis: S2[g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] A22: s99 . x = s . y by A1, A2, A3, A4, Lm1; A23: s99 . y = (s . x) mod (s . y) by A1, A2, A3, A4, Lm1; n gcd m divides n9 mod m9 by A20, NAT_D:11; hence S2[g . (s,((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))] by A20, A21, A22, A23, NEWTON:65; ::_thesis: verum end; A24: for s being Element of Funcs (X,INT) st S2[s] holds ( S2[g . (s,(y gt 0))] & ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies S3[g . (s,(y gt 0))] ) & ( S3[g . (s,(y gt 0))] implies g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S2[s] implies ( S2[g . (s,(y gt 0))] & ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies S3[g . (s,(y gt 0))] ) & ( S3[g . (s,(y gt 0))] implies g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) ) assume A25: S2[s] ; ::_thesis: ( S2[g . (s,(y gt 0))] & ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies S3[g . (s,(y gt 0))] ) & ( S3[g . (s,(y gt 0))] implies g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) reconsider s9 = g . (s,(y gt 0)) as Element of Funcs (X,INT) ; s9 . y = s . y by A1, A3, Th38; hence S2[g . (s,(y gt 0))] by A1, A2, A25, Th38; ::_thesis: ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) iff S3[g . (s,(y gt 0))] ) A26: ( s . y <= 0 implies s9 . b = 0 ) by Th38; ( s . y > 0 implies s9 . b = 1 ) by Th38; hence ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) iff S3[g . (s,(y gt 0))] ) by A26, Th2, Th38; ::_thesis: verum end; A27: S2[s] by A15, A16, A17, NAT_D:def_5; A28: ( S2[g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))] & not S3[g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))] ) from AOFA_000:sch_5(A27, A18, A19, A24); then fin . y = 0 ; then A29: S1[g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))] by INT_2:12; S1[s] from AOFA_000:sch_6(A29, A18, A6, A5); then fin . x divides n gcd m by A15, A16, INT_2:22; then ( fin . x = n gcd m or fin . x = - (n gcd m) ) by A28, INT_2:11; hence (g . (s,(while ((y gt 0),((((z := x) \; (z %= y)) \; (x := y)) \; (y := z)))))) . x = n gcd m by A28; ::_thesis: verum end; Lm2: for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let x, y, z be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) implies for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) ) given d being Function such that A1: d . b = 0 and A2: d . x = 1 and A3: d . y = 2 and A4: d . z = 3 ; ::_thesis: for s being Element of Funcs (X,INT) holds ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) A5: y <> z by A3, A4; let s be Element of Funcs (X,INT); ::_thesis: ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) & ( for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) ) set J = if-then ((z lt 0),(z *= (- 1))); A6: g complies_with_if_wrt (Funcs (X,INT)) \ (b,0) by AOFA_000:def_32; A7: z <> x by A2, A4; set I = (((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z); A8: x <> y by A2, A3; A9: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_ (_(g_._(s,((((z_:=_((._x)_-_(._y)))_\;_(if-then_((z_lt_0),(z_*=_(-_1)))))_\;_(x_:=_y))_\;_(y_:=_z))))_._x_=_s_._y_&_(g_._(s,((((z_:=_((._x)_-_(._y)))_\;_(if-then_((z_lt_0),(z_*=_(-_1)))))_\;_(x_:=_y))_\;_(y_:=_z))))_._y_=_abs_((s_._x)_-_(s_._y))_) let s be Element of Funcs (X,INT); ::_thesis: ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) ) set s1 = g . (s,(z := ((. x) - (. y)))); set s2 = g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)); set q = g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1))))); set qz = g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1))); A10: ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z) * (- 1) = - ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z) ; set s3 = g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y)); set s4 = g . ((g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))),(y := z)); A11: g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) = g . ((g . (s,(((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)))),(y := z)) by AOFA_000:def_29 .= g . ((g . ((g . (s,((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))))),(x := y))),(y := z)) by AOFA_000:def_29 .= g . ((g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))),(y := z)) by AOFA_000:def_29 ; ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 1 implies g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)) in (Funcs (X,INT)) \ (b,0) ) ; then A12: ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 1 implies g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1))))) = g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1))) ) by A6, AOFA_000:def_30; A13: (. x) . s = s . x by Th22; A14: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1)))) . y = (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . y by A5, Th31; A15: (. y) . s = s . y by Th22; ((. x) - (. y)) . s = ((. x) . s) - ((. y) . s) by Def11; then A16: (g . (s,(z := ((. x) - (. y))))) . z = (s . x) - (s . y) by A13, A15, Th26; A17: ( (g . (s,(z := ((. x) - (. y))))) . z < 0 implies (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 1 ) by Th38; A18: (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z = (g . (s,(z := ((. x) - (. y))))) . z by A1, A4, Th38; A19: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1)))) . z = ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z) * (- 1) by Th31; A20: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))) . z = (g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))) . z by A7, Th27; A21: (g . ((g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))),(y := z))) . y = (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))) . z by Th27; ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 0 implies g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)) nin (Funcs (X,INT)) \ (b,0) ) by Th2; then A22: ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 0 implies g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1))))) = g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)) ) by A6, AOFA_000:80; A23: ( (g . (s,(z := ((. x) - (. y))))) . z >= 0 implies (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 0 ) by Th38; A24: (g . (s,(z := ((. x) - (. y))))) . y = s . y by A5, Th26; A25: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))) . x = (g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))) . y by Th27; (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . y = (g . (s,(z := ((. x) - (. y))))) . y by A1, A3, Th38; hence ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) ) by A8, A22, A12, A18, A17, A23, A14, A19, A10, A11, A24, A16, A25, A20, A21, Th27, ABSVALUE:def_1; ::_thesis: verum end; hence ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) ) ; ::_thesis: for n, m being Element of NAT st n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) holds g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s deffunc H1( Element of Funcs (X,INT)) -> Element of NAT = IFEQ ((\$1 . y),0,0,(IFEQ ((\$1 . x),0,2,(IFEQ ((\$1 . x),(\$1 . y),1,(In ((max ((2 * (\$1 . x)),((2 * (\$1 . y)) + 1))),NAT))))))); defpred S1[ Element of Funcs (X,INT)] means ( \$1 . x >= 0 & \$1 . y > 0 ); set C = y gt 0; A26: for s being Element of Funcs (X,INT) st S1[s] holds ( ( S1[g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))] implies g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))] ) & H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[s] implies ( ( S1[g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))] implies g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))] ) & H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) ) ) assume that A27: s . x >= 0 and A28: s . y > 0 ; ::_thesis: ( ( S1[g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))] implies g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))] ) & H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) ) reconsider s9 = g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) as Element of Funcs (X,INT) ; reconsider s99 = g . (s9,(y gt 0)) as Element of Funcs (X,INT) ; A29: s9 . y = abs ((s . x) - (s . y)) by A9; then reconsider nx = s . x, ny = s . y, nn = s99 . y as Element of NAT by A1, A3, A27, A28, Th38, INT_1:3; A30: g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) = s99 by AOFA_000:def_29; A31: s99 . x = s9 . x by A1, A2, Th38; A32: ( s9 . y <= 0 implies s99 . b = 0 ) by Th38; A33: ( s9 . y > 0 implies s99 . b = 1 ) by Th38; hence ( S1[g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))] iff g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0))) in (Funcs (X,INT)) \ (b,0) ) by A9, A28, A30, A31, A32, Th2, Th38; ::_thesis: H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) A34: s9 . x = s . y by A9; A35: H1(s99) = IFEQ (nn,0,0,(IFEQ (ny,0,2,(IFEQ (ny,nn,1,(max ((2 * ny),((2 * nn) + 1)))))))) by A31, A34, FUNCT_7:def_1; (2 * ny) + 1 > 2 * ny by NAT_1:13; then A36: max ((2 * nx),((2 * ny) + 1)) > 2 * ny by XXREAL_0:30; A37: s99 . y = s9 . y by A1, A3, Th38; A38: H1(s) = IFEQ (ny,0,0,(IFEQ (nx,0,2,(IFEQ (nx,ny,1,(max ((2 * nx),((2 * ny) + 1)))))))) by FUNCT_7:def_1 .= IFEQ (nx,0,2,(IFEQ (nx,ny,1,(max ((2 * nx),((2 * ny) + 1)))))) by A28, FUNCOP_1:def_8 ; percases ( nx = ny or nx > ny or ( nx < ny & nx > 0 ) or nx = 0 ) by XXREAL_0:1; supposeA39: nx = ny ; ::_thesis: H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) then A40: IFEQ (nx,ny,1,(max ((2 * nx),((2 * ny) + 1)))) = 1 by FUNCOP_1:def_8; A41: nn = 0 by A37, A29, A39, ABSVALUE:2; H1(s) = IFEQ (nx,ny,1,(max ((2 * nx),((2 * ny) + 1)))) by A28, A38, A39, FUNCOP_1:def_8; hence H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) by A30, A40, A41, FUNCOP_1:def_8; ::_thesis: verum end; supposeA42: nx > ny ; ::_thesis: H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) then IFEQ (nx,ny,1,(max ((2 * nx),((2 * ny) + 1)))) = max ((2 * nx),((2 * ny) + 1)) by FUNCOP_1:def_8; then A43: H1(s) = max ((2 * nx),((2 * ny) + 1)) by A38, A42, FUNCOP_1:def_8; A44: nx - ny > 0 by A42, XREAL_1:50; then A45: H1(s99) = IFEQ (ny,0,2,(IFEQ (ny,nn,1,(max ((2 * ny),((2 * nn) + 1)))))) by A37, A33, A32, A29, A35, ABSVALUE:def_1, FUNCOP_1:def_8 .= IFEQ (ny,nn,1,(max ((2 * ny),((2 * nn) + 1)))) by A28, FUNCOP_1:def_8 ; then A46: ( ny = nn implies H1(s99) = 1 ) by FUNCOP_1:def_8; nn = nx - ny by A37, A29, A44, ABSVALUE:def_1; then nn < nx by A28, XREAL_1:44; then nn + 1 <= nx by NAT_1:13; then A47: 2 * (nn + 1) <= 2 * nx by XREAL_1:64; A48: 1 <= (2 * nn) + 1 by NAT_1:11; A49: ( ny <> nn implies H1(s99) = max ((2 * ny),((2 * nn) + 1)) ) by A45, FUNCOP_1:def_8; (2 * nn) + 2 = ((2 * nn) + 1) + 1 ; then (2 * nn) + 1 < 2 * nx by A47, NAT_1:13; then (2 * nn) + 1 < H1(s) by A43, XXREAL_0:30; hence H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) by A30, A36, A43, A46, A49, A48, XXREAL_0:2, XXREAL_0:29; ::_thesis: verum end; supposeA50: ( nx < ny & nx > 0 ) ; ::_thesis: H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) A51: - (nx - ny) = ny - nx ; A52: nx - ny < 0 by A50, XREAL_1:49; then A53: nn = - (nx - ny) by A37, A29, ABSVALUE:def_1; then A54: nn < ny by A50, A51, XREAL_1:44; 2 * nn < 2 * ny by A50, A53, A51, XREAL_1:44, XREAL_1:68; then (2 * nn) + 1 < (2 * ny) + 1 by XREAL_1:6; then A55: (2 * nn) + 1 < max ((2 * nx),((2 * ny) + 1)) by XXREAL_0:30; nn > 0 by A37, A29, A52, A51, ABSVALUE:def_1; then A56: H1(s99) = IFEQ (ny,0,2,(IFEQ (ny,nn,1,(max ((2 * ny),((2 * nn) + 1)))))) by A35, FUNCOP_1:def_8 .= IFEQ (ny,nn,1,(max ((2 * ny),((2 * nn) + 1)))) by A28, FUNCOP_1:def_8 .= max ((2 * ny),((2 * nn) + 1)) by A54, FUNCOP_1:def_8 ; H1(s) = IFEQ (nx,ny,1,(max ((2 * nx),((2 * ny) + 1)))) by A38, A50, FUNCOP_1:def_8 .= max ((2 * nx),((2 * ny) + 1)) by A50, FUNCOP_1:def_8 ; hence H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) by A30, A36, A55, A56, XXREAL_0:29; ::_thesis: verum end; supposeA57: nx = 0 ; ::_thesis: H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) then A58: H1(s) = 2 by A38, FUNCOP_1:def_8; A59: nn = - (nx - ny) by A28, A37, A29, A57, ABSVALUE:def_1 .= ny by A57 ; then H1(s99) = IFEQ (ny,0,2,(IFEQ (ny,nn,1,(max ((2 * ny),((2 * nn) + 1)))))) by A28, A35, FUNCOP_1:def_8 .= IFEQ (ny,nn,1,(max ((2 * ny),((2 * nn) + 1)))) by A28, FUNCOP_1:def_8 .= 1 by A59, FUNCOP_1:def_8 ; hence H1(g . (s,(((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0)))) < H1(s) by A30, A58; ::_thesis: verum end; end; end; let n, m be Element of NAT ; ::_thesis: ( n = s . x & m = s . y & ( s in (Funcs (X,INT)) \ (b,0) implies m > 0 ) & ( m > 0 implies s in (Funcs (X,INT)) \ (b,0) ) implies g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) assume that A60: n = s . x and A61: m = s . y ; ::_thesis: ( ( s in (Funcs (X,INT)) \ (b,0) & not m > 0 ) or ( m > 0 & not s in (Funcs (X,INT)) \ (b,0) ) or g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ) assume ( s in (Funcs (X,INT)) \ (b,0) iff m > 0 ) ; ::_thesis: g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s then A62: ( s in (Funcs (X,INT)) \ (b,0) iff S1[s] ) by A60, A61; g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s from AOFA_000:sch_3(A62, A26); hence g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),s ; ::_thesis: verum end; theorem :: AOFA_I00:64 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let x, y, z be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) implies while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ) set P = { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ; given d being Function such that A1: d . b = 0 and A2: d . x = 1 and A3: d . y = 2 and A4: d . z = 3 ; ::_thesis: while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } set C = y gt 0; set I = (((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z); A5: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_st_s_in__{__s_where_s_is_Element_of_Funcs_(X,INT)_:_(_s_._x_>=_0_&_s_._y_>=_0_)__}__&_g_._((g_._(s,((((z_:=_((._x)_-_(._y)))_\;_(if-then_((z_lt_0),(z_*=_(-_1)))))_\;_(x_:=_y))_\;_(y_:=_z)))),(y_gt_0))_in_(Funcs_(X,INT))_\_(b,0)_holds_ g_._(s,((((z_:=_((._x)_-_(._y)))_\;_(if-then_((z_lt_0),(z_*=_(-_1)))))_\;_(x_:=_y))_\;_(y_:=_z)))_in__{__s_where_s_is_Element_of_Funcs_(X,INT)_:_(_s_._x_>=_0_&_s_._y_>=_0_)__}_ let s be Element of Funcs (X,INT); ::_thesis: ( s in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } & g . ((g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))),(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ) assume s in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ; ::_thesis: ( g . ((g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))),(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ) then ex s9 being Element of Funcs (X,INT) st ( s9 = s & s9 . x >= 0 & s9 . y >= 0 ) ; then reconsider m = s . y as Element of NAT by INT_1:3; assume g . ((g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))),(y gt 0)) in (Funcs (X,INT)) \ (b,0) ; ::_thesis: g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } A6: (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = m by A1, A2, A3, A4, Lm2; (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) by A1, A2, A3, A4, Lm2; hence g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } by A6; ::_thesis: verum end; A7: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_st_g_._(s,(y_gt_0))_in__{__s_where_s_is_Element_of_Funcs_(X,INT)_:_(_s_._x_>=_0_&_s_._y_>=_0_)__}__holds_ g_iteration_terminates_for_((((z_:=_((._x)_-_(._y)))_\;_(if-then_((z_lt_0),(z_*=_(-_1)))))_\;_(x_:=_y))_\;_(y_:=_z))_\;_(y_gt_0),g_._(s,(y_gt_0)) let s be Element of Funcs (X,INT); ::_thesis: ( g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } implies g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) ) set s1 = g . (s,(y gt 0)); A8: ( s . y <= 0 implies (g . (s,(y gt 0))) . b = 0 ) by Th38; assume g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ; ::_thesis: g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) then ex s9 being Element of Funcs (X,INT) st ( s9 = g . (s,(y gt 0)) & s9 . x >= 0 & s9 . y >= 0 ) ; then reconsider n = (g . (s,(y gt 0))) . x, m = (g . (s,(y gt 0))) . y as Element of NAT by INT_1:3; A9: n = n ; ( s . y > 0 implies (g . (s,(y gt 0))) . b = 1 ) by Th38; then ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) iff m > 0 ) by A8, Th2, Th38; hence g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) by A1, A2, A3, A4, A9, Lm2; ::_thesis: verum end; A10: { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } is_invariant_wrt y gt 0,g proof let s be Element of Funcs (X,INT); :: according to AOFA_000:def_39 ::_thesis: ( not s in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } or g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ) set s1 = g . (s,(y gt 0)); assume s in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } ; ::_thesis: g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } then A11: ex s9 being Element of Funcs (X,INT) st ( s9 = s & s9 . x >= 0 & s9 . y >= 0 ) ; A12: (g . (s,(y gt 0))) . y = s . y by A1, A3, Th38; (g . (s,(y gt 0))) . x = s . x by A1, A2, Th38; hence g . (s,(y gt 0)) in { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } by A11, A12; ::_thesis: verum end; y gt 0 is_terminating_wrt g by AOFA_000:104; hence while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : ( s . x >= 0 & s . y >= 0 ) } by A10, A5, A7, AOFA_000:107, AOFA_000:118; ::_thesis: verum end; theorem :: AOFA_I00:65 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, z being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) holds for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m set h = g; set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); A1: g complies_with_if_wrt (Funcs (X,INT)) \ (b,0) by AOFA_000:def_32; let x, y, z be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . z = 3 ) implies for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m ) given d being Function such that A2: d . b = 0 and A3: d . x = 1 and A4: d . y = 2 and A5: d . z = 3 ; ::_thesis: for s being Element of Funcs (X,INT) for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m set C = y gt 0; let s be Element of Funcs (X,INT); ::_thesis: for n, m being Element of NAT st n = s . x & m = s . y & n > 0 holds (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m A6: y <> z by A4, A5; reconsider s1 = g . (s,(y gt 0)) as Element of Funcs (X,INT) ; A7: s1 . x = s . x by A2, A3, Th38; A8: s1 . y = s . y by A2, A4, Th38; A9: ( s . y <= 0 implies s1 . b = 0 ) by Th38; defpred S1[ Element of Funcs (X,INT)] means ( \$1 . x > 0 & \$1 . y > 0 ); let n, m be Element of NAT ; ::_thesis: ( n = s . x & m = s . y & n > 0 implies (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m ) defpred S2[ Element of Funcs (X,INT)] means ( n gcd m divides \$1 . x & n gcd m divides \$1 . y & \$1 . x > 0 & \$1 . y >= 0 & ( for c being Nat st c divides \$1 . x & c divides \$1 . y holds c divides n gcd m ) ); set J = if-then ((z lt 0),(z *= (- 1))); set I = (((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z); assume that A10: n = s . x and A11: m = s . y and A12: n > 0 ; ::_thesis: (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m ( s . y > 0 implies s1 . b = 1 ) by Th38; then ( s1 in (Funcs (X,INT)) \ (b,0) iff S1[s1] ) by A10, A12, A9, Th2, Th38; then A13: g iteration_terminates_for ((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)) \; (y gt 0),g . (s,(y gt 0)) by A2, A3, A4, A5, A10, A11, A12, A7, A8, Lm2; A14: z <> x by A3, A5; A15: x <> y by A3, A4; A16: now__::_thesis:_for_s_being_Element_of_Funcs_(X,INT)_holds_ (_(g_._(s,((((z_:=_((._x)_-_(._y)))_\;_(if-then_((z_lt_0),(z_*=_(-_1)))))_\;_(x_:=_y))_\;_(y_:=_z))))_._x_=_s_._y_&_(g_._(s,((((z_:=_((._x)_-_(._y)))_\;_(if-then_((z_lt_0),(z_*=_(-_1)))))_\;_(x_:=_y))_\;_(y_:=_z))))_._y_=_abs_((s_._x)_-_(s_._y))_) let s be Element of Funcs (X,INT); ::_thesis: ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) ) set s1 = g . (s,(z := ((. x) - (. y)))); set s2 = g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)); set q = g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1))))); set qz = g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1))); A17: ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z) * (- 1) = - ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z) ; set s3 = g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y)); set s4 = g . ((g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))),(y := z)); A18: g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) = g . ((g . (s,(((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)))),(y := z)) by AOFA_000:def_29 .= g . ((g . ((g . (s,((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))))),(x := y))),(y := z)) by AOFA_000:def_29 .= g . ((g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))),(y := z)) by AOFA_000:def_29 ; ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 1 implies g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)) in (Funcs (X,INT)) \ (b,0) ) ; then A19: ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 1 implies g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1))))) = g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1))) ) by A1, AOFA_000:def_30; A20: (. x) . s = s . x by Th22; A21: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1)))) . y = (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . y by A6, Th31; A22: (. y) . s = s . y by Th22; ((. x) - (. y)) . s = ((. x) . s) - ((. y) . s) by Def11; then A23: (g . (s,(z := ((. x) - (. y))))) . z = (s . x) - (s . y) by A20, A22, Th26; A24: ( (g . (s,(z := ((. x) - (. y))))) . z < 0 implies (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 1 ) by Th38; A25: (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z = (g . (s,(z := ((. x) - (. y))))) . z by A2, A5, Th38; A26: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))),(z *= (- 1)))) . z = ((g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . z) * (- 1) by Th31; A27: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))) . z = (g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))) . z by A14, Th27; A28: (g . ((g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))),(y := z))) . y = (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))) . z by Th27; ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 0 implies g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)) nin (Funcs (X,INT)) \ (b,0) ) by Th2; then A29: ( (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 0 implies g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1))))) = g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0)) ) by A1, AOFA_000:80; A30: ( (g . (s,(z := ((. x) - (. y))))) . z >= 0 implies (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . b = 0 ) by Th38; A31: (g . (s,(z := ((. x) - (. y))))) . y = s . y by A6, Th26; A32: (g . ((g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))),(x := y))) . x = (g . ((g . (s,(z := ((. x) - (. y))))),(if-then ((z lt 0),(z *= (- 1)))))) . y by Th27; (g . ((g . (s,(z := ((. x) - (. y))))),(z lt 0))) . y = (g . (s,(z := ((. x) - (. y))))) . y by A2, A4, Th38; hence ( (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x = s . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y = abs ((s . x) - (s . y)) ) by A15, A29, A19, A25, A24, A30, A21, A26, A17, A18, A31, A23, A32, A27, A28, Th27, ABSVALUE:def_1; ::_thesis: verum end; A33: for s being Element of Funcs (X,INT) st S2[s] & s in (Funcs (X,INT)) \ (b,0) & S1[s] holds S2[g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))] proof let s be Element of Funcs (X,INT); ::_thesis: ( S2[s] & s in (Funcs (X,INT)) \ (b,0) & S1[s] implies S2[g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))] ) reconsider s99 = g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))) as Element of Funcs (X,INT) ; A34: abs (n gcd m) = n gcd m by ABSVALUE:def_1; A35: s99 . y = abs ((s . x) - (s . y)) by A16; assume A36: S2[s] ; ::_thesis: ( not s in (Funcs (X,INT)) \ (b,0) or not S1[s] or S2[g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))] ) then reconsider n9 = s . x, m9 = s . y as Element of NAT by INT_1:3; assume that s in (Funcs (X,INT)) \ (b,0) and A37: S1[s] ; ::_thesis: S2[g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))] n gcd m divides n9 - m9 by A36, PREPOWER:94; hence ( n gcd m divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x & n gcd m divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x > 0 & (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y >= 0 ) by A16, A36, A37, A35, A34, INT_2:16; ::_thesis: for c being Nat st c divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x & c divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y holds c divides n gcd m let c be Nat; ::_thesis: ( c divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x & c divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y implies c divides n gcd m ) reconsider c9 = c as Element of NAT by ORDINAL1:def_12; assume that A38: c divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . x and A39: c divides (g . (s,((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))) . y ; ::_thesis: c divides n gcd m A40: abs c = c by ABSVALUE:def_1; A41: s99 . x = s . y by A16; c9 divides abs (n9 - m9) by A16, A39; then A42: c divides n9 - m9 by A40, INT_2:16; c divides m9 by A16, A38; then c divides (n9 - m9) + m9 by A42, WSIERP_1:4; hence c divides n gcd m by A36, A41, A38; ::_thesis: verum end; A43: for s being Element of Funcs (X,INT) st S2[s] holds ( S2[g . (s,(y gt 0))] & ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(y gt 0))] ) & ( S1[g . (s,(y gt 0))] implies g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S2[s] implies ( S2[g . (s,(y gt 0))] & ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(y gt 0))] ) & ( S1[g . (s,(y gt 0))] implies g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) ) assume A44: S2[s] ; ::_thesis: ( S2[g . (s,(y gt 0))] & ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(y gt 0))] ) & ( S1[g . (s,(y gt 0))] implies g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) reconsider s9 = g . (s,(y gt 0)) as Element of Funcs (X,INT) ; A45: s9 . y = s . y by A2, A4, Th38; s9 . x = s . x by A2, A3, Th38; hence S2[g . (s,(y gt 0))] by A44, A45; ::_thesis: ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) iff S1[g . (s,(y gt 0))] ) A46: ( s . y <= 0 implies s9 . b = 0 ) by Th38; ( s . y > 0 implies s9 . b = 1 ) by Th38; hence ( g . (s,(y gt 0)) in (Funcs (X,INT)) \ (b,0) iff S1[g . (s,(y gt 0))] ) by A44, A46, Th2, Th38; ::_thesis: verum end; reconsider fin = g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z))))) as Element of Funcs (X,INT) ; A47: S2[s] by A10, A11, A12, NAT_D:def_5; A48: ( S2[g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))] & not S1[g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))] ) from AOFA_000:sch_5(A47, A13, A33, A43); then reconsider fn = fin . x as Element of NAT by INT_1:3; A49: fn divides 0 by NAT_D:6; fin . y = 0 by A48; then fn divides n gcd m by A48, A49; hence (g . (s,(while ((y gt 0),((((z := ((. x) - (. y))) \; (if-then ((z lt 0),(z *= (- 1))))) \; (x := y)) \; (y := z)))))) . x = n gcd m by A48, NAT_D:5; ::_thesis: verum end; theorem :: AOFA_I00:66 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); let x, y, m be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) implies (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } ) set P = { s where s is Element of Funcs (X,INT) : s . m >= 0 } ; given d being Function such that A1: d . b = 0 and A2: d . x = 1 and A3: d . y = 2 and A4: d . m = 3 ; ::_thesis: (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } set C = m gt 0; A5: y := 1 is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } by AOFA_000:107; deffunc H1( Element of Funcs (X,INT)) -> Element of NAT = In ((\$1 . m),NAT); defpred S1[ Element of Funcs (X,INT)] means \$1 . m > 0 ; set I = if-then ((m is_odd),(y *= x)); set J = ((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x); A6: g complies_with_if_wrt (Funcs (X,INT)) \ (b,0) by AOFA_000:def_32; A7: { s where s is Element of Funcs (X,INT) : s . m >= 0 } is_invariant_wrt m gt 0,g proof let s be Element of Funcs (X,INT); :: according to AOFA_000:def_39 ::_thesis: ( not s in { s where s is Element of Funcs (X,INT) : s . m >= 0 } or g . (s,(m gt 0)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ) assume s in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ; ::_thesis: g . (s,(m gt 0)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } then A8: ex s9 being Element of Funcs (X,INT) st ( s = s9 & s9 . m >= 0 ) ; (g . (s,(m gt 0))) . m = s . m by A1, A4, Th38; hence g . (s,(m gt 0)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } by A8; ::_thesis: verum end; A9: for s being Element of Funcs (X,INT) st s in { s where s is Element of Funcs (X,INT) : s . m >= 0 } & g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)) in (Funcs (X,INT)) \ (b,0) holds g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } proof let s be Element of Funcs (X,INT); ::_thesis: ( s in { s where s is Element of Funcs (X,INT) : s . m >= 0 } & g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)) in (Funcs (X,INT)) \ (b,0) implies g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ) assume s in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ; ::_thesis: ( not g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)) in (Funcs (X,INT)) \ (b,0) or g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ) assume g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)) in (Funcs (X,INT)) \ (b,0) ; ::_thesis: g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } then (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m > 0 by Th40; hence g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ; ::_thesis: verum end; A10: m <> y by A3, A4; A11: { s where s is Element of Funcs (X,INT) : s . m >= 0 } is_invariant_wrt y := 1,g proof let s be Element of Funcs (X,INT); :: according to AOFA_000:def_39 ::_thesis: ( not s in { s where s is Element of Funcs (X,INT) : s . m >= 0 } or g . (s,(y := 1)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ) assume s in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ; ::_thesis: g . (s,(y := 1)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } then A12: ex s9 being Element of Funcs (X,INT) st ( s = s9 & s9 . m >= 0 ) ; (g . (s,(y := 1))) . m = s . m by A10, Th25; hence g . (s,(y := 1)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } by A12; ::_thesis: verum end; A13: m <> x by A2, A4; A14: for s being Element of Funcs (X,INT) st g . (s,(m gt 0)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } holds g iteration_terminates_for (((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0),g . (s,(m gt 0)) proof A15: for s being Element of Funcs (X,INT) st S1[s] holds ( ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] implies g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] ) & H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[s] implies ( ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] implies g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] ) & H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) ) ) assume A16: s . m > 0 ; ::_thesis: ( ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] implies g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] ) & H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) ) A17: H1(s) = s . m by A16, FUNCT_7:def_1, INT_1:3; set q1 = g . (s,(if-then ((m is_odd),(y *= x)))); set q0 = g . (s,(m is_odd)); set sJ = g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))); set sC = g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)); A18: g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) = g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)) by AOFA_000:def_29; A19: ( (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m <= 0 implies (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . b = 0 ) by Th38; ( (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m > 0 implies (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . b = 1 ) by Th38; hence ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] iff g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) by A19, A18, Th2, Th38; ::_thesis: H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) set q2 = g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2)); set q3 = g . ((g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))),(x *= x)); A20: ( g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(y *= x)) or g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(EmptyIns A)) ) by A6, AOFA_000:def_30; g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2)) = g . (s,((if-then ((m is_odd),(y *= x))) \; (m /= 2))) by AOFA_000:def_29; then g . ((g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))),(x *= x)) = g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) by AOFA_000:def_29; then A21: (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m = (g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))) . m by A13, Th33 .= ((g . (s,(if-then ((m is_odd),(y *= x))))) . m) div 2 by Th45 .= ((g . (s,(m is_odd))) . m) div 2 by A10, A20, Th33, AOFA_000:def_28 .= (s . m) div 2 by A1, A4, Th49 ; A22: (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . m = (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m by A1, A4, Th38; then (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . m in NAT by A16, A21, INT_1:3, INT_1:61; then H1(g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) = (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . m by FUNCT_7:def_1; hence H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) by A16, A22, A18, A21, A17, INT_1:56; ::_thesis: verum end; let s0 be Element of Funcs (X,INT); ::_thesis: ( g . (s0,(m gt 0)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } implies g iteration_terminates_for (((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0),g . (s0,(m gt 0)) ) assume g . (s0,(m gt 0)) in { s where s is Element of Funcs (X,INT) : s . m >= 0 } ; ::_thesis: g iteration_terminates_for (((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0),g . (s0,(m gt 0)) set s1 = g . (s0,(m gt 0)); A23: ( s0 . m <= 0 implies (g . (s0,(m gt 0))) . b = 0 ) by Th38; ( s0 . m > 0 implies (g . (s0,(m gt 0))) . b = 1 ) by Th38; then A24: ( g . (s0,(m gt 0)) in (Funcs (X,INT)) \ (b,0) iff S1[g . (s0,(m gt 0))] ) by A23, Th2, Th38; thus g iteration_terminates_for (((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0),g . (s0,(m gt 0)) from AOFA_000:sch_3(A24, A15); ::_thesis: verum end; ((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } by AOFA_000:107; then while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } by A7, A9, A14, AOFA_000:104, AOFA_000:118; hence (y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) is_terminating_wrt g, { s where s is Element of Funcs (X,INT) : s . m >= 0 } by A5, A11, AOFA_000:111; ::_thesis: verum end; theorem :: AOFA_I00:67 for A being Euclidean preIfWhileAlgebra for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds for s being Element of Funcs (X,INT) for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n proof let A be Euclidean preIfWhileAlgebra; ::_thesis: for X being non empty countable set for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds for s being Element of Funcs (X,INT) for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n let X be non empty countable set ; ::_thesis: for b being Element of X for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds for s being Element of Funcs (X,INT) for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n let b be Element of X; ::_thesis: for g being Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0) for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds for s being Element of Funcs (X,INT) for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n let g be Euclidean ExecutionFunction of A, Funcs (X,INT),(Funcs (X,INT)) \ (b,0); ::_thesis: for x, y, m being Variable of g st ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) holds for s being Element of Funcs (X,INT) for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n set S = Funcs (X,INT); set T = (Funcs (X,INT)) \ (b,0); A1: g complies_with_if_wrt (Funcs (X,INT)) \ (b,0) by AOFA_000:def_32; let x, y, m be Variable of g; ::_thesis: ( ex d being Function st ( d . b = 0 & d . x = 1 & d . y = 2 & d . m = 3 ) implies for s being Element of Funcs (X,INT) for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n ) given d being Function such that A2: d . b = 0 and A3: d . x = 1 and A4: d . y = 2 and A5: d . m = 3 ; ::_thesis: for s being Element of Funcs (X,INT) for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n defpred S1[ Element of Funcs (X,INT)] means \$1 . m > 0 ; set C = m gt 0; let s be Element of Funcs (X,INT); ::_thesis: for n being Nat st n = s . m holds (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n let n be Nat; ::_thesis: ( n = s . m implies (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n ) defpred S2[ Element of Funcs (X,INT)] means ( (s . x) |^ n = (\$1 . y) * ((\$1 . x) to_power (\$1 . m)) & \$1 . m >= 0 ); deffunc H1( Element of Funcs (X,INT)) -> Element of NAT = In ((\$1 . m),NAT); set I = if-then ((m is_odd),(y *= x)); set J = ((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x); set s0 = g . (s,(y := 1)); A6: m <> y by A4, A5; then A7: (g . (s,(y := 1))) . m = s . m by Th25; A8: for s being Element of Funcs (X,INT) st S2[s] holds ( S2[g . (s,(m gt 0))] & ( g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(m gt 0))] ) & ( S1[g . (s,(m gt 0))] implies g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S2[s] implies ( S2[g . (s,(m gt 0))] & ( g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(m gt 0))] ) & ( S1[g . (s,(m gt 0))] implies g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) ) assume A9: S2[s] ; ::_thesis: ( S2[g . (s,(m gt 0))] & ( g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,(m gt 0))] ) & ( S1[g . (s,(m gt 0))] implies g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) ) ) set s1 = g . (s,(m gt 0)); A10: (g . (s,(m gt 0))) . x = s . x by A2, A3, Th38; (g . (s,(m gt 0))) . m = s . m by A2, A5, Th38; hence S2[g . (s,(m gt 0))] by A2, A4, A9, A10, Th38; ::_thesis: ( g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) iff S1[g . (s,(m gt 0))] ) A11: ( s . m <= 0 implies (g . (s,(m gt 0))) . b = 0 ) by Th38; ( s . m > 0 implies (g . (s,(m gt 0))) . b = 1 ) by Th38; hence ( g . (s,(m gt 0)) in (Funcs (X,INT)) \ (b,0) iff S1[g . (s,(m gt 0))] ) by A11, Th2, Th38; ::_thesis: verum end; A12: (g . (s,(y := 1))) . y = 1 by Th25; set fs = g . ((g . (s,(y := 1))),(while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))); set s1 = g . ((g . (s,(y := 1))),(m gt 0)); assume A13: n = s . m ; ::_thesis: (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n A14: ((g . ((g . (s,(y := 1))),(while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))))) . x) to_power 0 = 1 by POWER:24; A15: m <> x by A3, A5; A16: for s being Element of Funcs (X,INT) st S1[s] holds ( ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] implies g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] ) & H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) ) proof let s be Element of Funcs (X,INT); ::_thesis: ( S1[s] implies ( ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] implies g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] ) & H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) ) ) assume A17: s . m > 0 ; ::_thesis: ( ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] implies g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) & ( g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) implies S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] ) & H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) ) A18: H1(s) = s . m by A17, FUNCT_7:def_1, INT_1:3; set q1 = g . (s,(if-then ((m is_odd),(y *= x)))); set q0 = g . (s,(m is_odd)); set sJ = g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))); set sC = g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)); A19: g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) = g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0)) by AOFA_000:def_29; A20: ( (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m <= 0 implies (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . b = 0 ) by Th38; ( (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m > 0 implies (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . b = 1 ) by Th38; hence ( S1[g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))] iff g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0))) in (Funcs (X,INT)) \ (b,0) ) by A20, A19, Th2, Th38; ::_thesis: H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) set q2 = g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2)); set q3 = g . ((g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))),(x *= x)); A21: ( g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(y *= x)) or g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(EmptyIns A)) ) by A1, AOFA_000:def_30; g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2)) = g . (s,((if-then ((m is_odd),(y *= x))) \; (m /= 2))) by AOFA_000:def_29; then g . ((g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))),(x *= x)) = g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) by AOFA_000:def_29; then A22: (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m = (g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))) . m by A15, Th33 .= ((g . (s,(if-then ((m is_odd),(y *= x))))) . m) div 2 by Th45 .= ((g . (s,(m is_odd))) . m) div 2 by A6, A21, Th33, AOFA_000:def_28 .= (s . m) div 2 by A2, A5, Th49 ; A23: (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . m = (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m by A2, A5, Th38; then (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . m in NAT by A17, A22, INT_1:3, INT_1:61; then H1(g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) = (g . ((g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))),(m gt 0))) . m by FUNCT_7:def_1; hence H1(g . (s,((((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0)))) < H1(s) by A17, A23, A19, A22, A18, INT_1:56; ::_thesis: verum end; set q = s; A24: x <> y by A3, A4; A25: for s being Element of Funcs (X,INT) st S2[s] & s in (Funcs (X,INT)) \ (b,0) & S1[s] holds S2[g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))] proof let s be Element of Funcs (X,INT); ::_thesis: ( S2[s] & s in (Funcs (X,INT)) \ (b,0) & S1[s] implies S2[g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))] ) assume that A26: S2[s] and s in (Funcs (X,INT)) \ (b,0) and S1[s] ; ::_thesis: S2[g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))] reconsider sm = s . m as Element of NAT by A26, INT_1:3; s . m = (((s . m) div 2) * 2) + ((s . m) mod 2) by NEWTON:66; then A27: (s . x) |^ n = (s . y) * (((s . x) to_power ((sm div 2) * 2)) * ((s . x) to_power (sm mod 2))) by A26, FIB_NUM2:5 .= ((s . y) * ((s . x) to_power (sm mod 2))) * ((s . x) to_power ((sm div 2) * 2)) .= ((s . y) * ((s . x) to_power (sm mod 2))) * (((s . x) to_power 2) to_power (sm div 2)) by NEWTON:9 .= ((s . y) * ((s . x) to_power (sm mod 2))) * (((s . x) * (s . x)) to_power (sm div 2)) by NEWTON:81 ; set q1 = g . (s,(if-then ((m is_odd),(y *= x)))); set q0 = g . (s,(m is_odd)); set sJ = g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))); set q2 = g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2)); set q3 = g . ((g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))),(x *= x)); A28: ( g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(y *= x)) or g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(EmptyIns A)) ) by A1, AOFA_000:def_30; A29: (g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))) . x = (g . (s,(if-then ((m is_odd),(y *= x))))) . x by A15, Th45 .= (g . (s,(m is_odd))) . x by A24, A28, Th33, AOFA_000:def_28 ; A30: (g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))) . y = (g . (s,(if-then ((m is_odd),(y *= x))))) . y by A6, Th45; A31: (g . (s,(m is_odd))) . y = s . y by A2, A4, Th49; A32: (g . (s,(m is_odd))) . x = s . x by A2, A3, Th49; g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2)) = g . (s,((if-then ((m is_odd),(y *= x))) \; (m /= 2))) by AOFA_000:def_29; then A33: g . ((g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))),(x *= x)) = g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))) by AOFA_000:def_29; then A34: (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . y = (g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))) . y by A24, Th33; A35: sm div 2 = (s . m) div 2 ; A36: now__::_thesis:_(s_._y)_*_((s_._x)_to_power_(sm_mod_2))_=_(g_._(s,(((if-then_((m_is_odd),(y_*=_x)))_\;_(m_/=_2))_\;_(x_*=_x))))_._y A37: (g . (s,(m is_odd))) . b = (s . m) mod 2 by Th49; percases ( (g . (s,(m is_odd))) . b = 0 or (g . (s,(m is_odd))) . b = 1 ) by A35, A37, NAT_D:12; supposeA38: (g . (s,(m is_odd))) . b = 0 ; ::_thesis: (s . y) * ((s . x) to_power (sm mod 2)) = (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . y then g . (s,(m is_odd)) nin (Funcs (X,INT)) \ (b,0) by Th2; then g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(EmptyIns A)) by A1, AOFA_000:def_30; then A39: (g . (s,(if-then ((m is_odd),(y *= x))))) . y = (g . (s,(m is_odd))) . y by AOFA_000:def_28; A40: (s . y) * 1 = s . y ; (s . x) to_power 0 = 1 by POWER:24; hence (s . y) * ((s . x) to_power (sm mod 2)) = (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . y by A34, A30, A31, A38, A39, A40, Th49; ::_thesis: verum end; supposeA41: (g . (s,(m is_odd))) . b = 1 ; ::_thesis: (s . y) * ((s . x) to_power (sm mod 2)) = (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . y then g . (s,(m is_odd)) in (Funcs (X,INT)) \ (b,0) ; then g . (s,(if-then ((m is_odd),(y *= x)))) = g . ((g . (s,(m is_odd))),(y *= x)) by A1, AOFA_000:def_30; then A42: (g . (s,(if-then ((m is_odd),(y *= x))))) . y = ((g . (s,(m is_odd))) . y) * ((g . (s,(m is_odd))) . x) by Th33; (s . x) to_power 1 = s . x by POWER:25; hence (s . y) * ((s . x) to_power (sm mod 2)) = (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . y by A32, A34, A30, A31, A41, A42, Th49; ::_thesis: verum end; end; end; (g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))) . m = (g . ((g . (s,(if-then ((m is_odd),(y *= x))))),(m /= 2))) . m by A15, A33, Th33 .= ((g . (s,(if-then ((m is_odd),(y *= x))))) . m) div 2 by Th45 .= ((g . (s,(m is_odd))) . m) div 2 by A6, A28, Th33, AOFA_000:def_28 .= (s . m) div 2 by A2, A5, Th49 ; hence S2[g . (s,(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))] by A33, A29, A32, A36, A27, Th33; ::_thesis: verum end; A43: ( (g . (s,(y := 1))) . m <= 0 implies (g . ((g . (s,(y := 1))),(m gt 0))) . b = 0 ) by Th38; ( (g . (s,(y := 1))) . m > 0 implies (g . ((g . (s,(y := 1))),(m gt 0))) . b = 1 ) by Th38; then A44: ( g . ((g . (s,(y := 1))),(m gt 0)) in (Funcs (X,INT)) \ (b,0) iff S1[g . ((g . (s,(y := 1))),(m gt 0))] ) by A43, Th2, Th38; A45: g iteration_terminates_for (((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)) \; (m gt 0),g . ((g . (s,(y := 1))),(m gt 0)) from AOFA_000:sch_3(A44, A16); (g . (s,(y := 1))) . x = s . x by A24, Th25; then A46: S2[g . (s,(y := 1))] by A13, A7, A12, POWER:41; A47: ( S2[g . ((g . (s,(y := 1))),(while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))))] & not S1[g . ((g . (s,(y := 1))),(while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))))] ) from AOFA_000:sch_5(A46, A45, A25, A8); then (g . ((g . (s,(y := 1))),(while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x)))))) . m = 0 ; hence (g . (s,((y := 1) \; (while ((m gt 0),(((if-then ((m is_odd),(y *= x))) \; (m /= 2)) \; (x *= x))))))) . y = (s . x) |^ n by A47, A14, AOFA_000:def_29; ::_thesis: verum end;