:: AOFA_000 semantic presentation
begin
notation
let x, y be set ;
antonym x nin y for x in y;
end;
theorem Th1: :: AOFA_000:1
for f, g, h being Function
for A being set st A c= dom f & A c= dom g & rng h c= A & ( for x being set st x in A holds
f . x = g . x ) holds
f * h = g * h
proof
let f, g, h be Function; ::_thesis: for A being set st A c= dom f & A c= dom g & rng h c= A & ( for x being set st x in A holds
f . x = g . x ) holds
f * h = g * h
let A be set ; ::_thesis: ( A c= dom f & A c= dom g & rng h c= A & ( for x being set st x in A holds
f . x = g . x ) implies f * h = g * h )
assume that
A1: A c= dom f and
A2: A c= dom g and
A3: rng h c= A and
A4: for x being set st x in A holds
f . x = g . x ; ::_thesis: f * h = g * h
A5: dom (f * h) = dom h by A1, A3, RELAT_1:27, XBOOLE_1:1;
A6: dom (g * h) = dom h by A2, A3, RELAT_1:27, XBOOLE_1:1;
now__::_thesis:_for_x_being_set_st_x_in_dom_h_holds_
(f_*_h)_._x_=_(g_*_h)_._x
let x be set ; ::_thesis: ( x in dom h implies (f * h) . x = (g * h) . x )
assume A7: x in dom h ; ::_thesis: (f * h) . x = (g * h) . x
then A8: (f * h) . x = f . (h . x) by FUNCT_1:13;
A9: (g * h) . x = g . (h . x) by A7, FUNCT_1:13;
h . x in rng h by A7, FUNCT_1:3;
hence (f * h) . x = (g * h) . x by A3, A4, A8, A9; ::_thesis: verum
end;
hence f * h = g * h by A5, A6, FUNCT_1:2; ::_thesis: verum
end;
registration
let x, y be non empty set ;
cluster<*x,y*> -> non-empty ;
coherence
<*x,y*> is non-empty
proof
assume {} in rng <*x,y*> ; :: according to RELAT_1:def_9 ::_thesis: contradiction
then {} in {x,y} by FINSEQ_2:127;
hence contradiction by TARSKI:def_2; ::_thesis: verum
end;
end;
registration
let p, q be non-empty FinSequence;
clusterp ^ q -> non-empty ;
coherence
p ^ q is non-empty
proof
assume {} in rng (p ^ q) ; :: according to RELAT_1:def_9 ::_thesis: contradiction
then {} in (rng p) \/ (rng q) by FINSEQ_1:31;
then ( {} in rng p or {} in rng q ) by XBOOLE_0:def_3;
hence contradiction by RELAT_1:def_9; ::_thesis: verum
end;
end;
definition
let f be homogeneous Function;
let x be set ;
predx is_a_unity_wrt f means :Def1: :: AOFA_000:def 1
for y, z being set st ( <*y,z*> in dom f or <*z,y*> in dom f ) holds
( <*x,y*> in dom f & f . <*x,y*> = y & <*y,x*> in dom f & f . <*y,x*> = y );
end;
:: deftheorem Def1 defines is_a_unity_wrt AOFA_000:def_1_:_
for f being homogeneous Function
for x being set holds
( x is_a_unity_wrt f iff for y, z being set st ( <*y,z*> in dom f or <*z,y*> in dom f ) holds
( <*x,y*> in dom f & f . <*x,y*> = y & <*y,x*> in dom f & f . <*y,x*> = y ) );
definition
let f be homogeneous Function;
attrf is associative means :Def2: :: AOFA_000:def 2
for x, y, z being set st <*x,y*> in dom f & <*y,z*> in dom f & <*(f . <*x,y*>),z*> in dom f & <*x,(f . <*y,z*>)*> in dom f holds
f . <*(f . <*x,y*>),z*> = f . <*x,(f . <*y,z*>)*>;
attrf is unital means :Def3: :: AOFA_000:def 3
ex x being set st x is_a_unity_wrt f;
end;
:: deftheorem Def2 defines associative AOFA_000:def_2_:_
for f being homogeneous Function holds
( f is associative iff for x, y, z being set st <*x,y*> in dom f & <*y,z*> in dom f & <*(f . <*x,y*>),z*> in dom f & <*x,(f . <*y,z*>)*> in dom f holds
f . <*(f . <*x,y*>),z*> = f . <*x,(f . <*y,z*>)*> );
:: deftheorem Def3 defines unital AOFA_000:def_3_:_
for f being homogeneous Function holds
( f is unital iff ex x being set st x is_a_unity_wrt f );
definition
let X be set ;
let Y be non empty set ;
let Z be FinSequenceSet of X;
let y be Element of Y;
:: original: -->
redefine funcZ --> y -> PartFunc of (X *),Y;
coherence
Z --> y is PartFunc of (X *),Y
proof
A1: dom (Z --> y) = Z by FUNCOP_1:13;
rng (Z --> y) c= {y} by FUNCOP_1:13;
hence Z --> y is PartFunc of (X *),Y by A1, COMPUT_1:10, RELSET_1:4; ::_thesis: verum
end;
end;
registration
let X be non empty set ;
let x be Element of X;
let n be Nat;
cluster(n -tuples_on X) --> x -> non empty homogeneous quasi_total for PartFunc of (X *),X;
coherence
for b1 being PartFunc of (X *),X st b1 = (n -tuples_on X) --> x holds
( not b1 is empty & b1 is quasi_total & b1 is homogeneous )
proof
reconsider m = n as Element of NAT by ORDINAL1:def_12;
set f = (n -tuples_on X) --> x;
A1: dom ((n -tuples_on X) --> x) = m -tuples_on X by FUNCOP_1:13;
then reconsider f = (n -tuples_on X) --> x as non empty homogeneous PartFunc of (X *),X by COMPUT_1:16;
arity f = m by A1, COMPUT_1:24;
hence for b1 being PartFunc of (X *),X st b1 = (n -tuples_on X) --> x holds
( not b1 is empty & b1 is quasi_total & b1 is homogeneous ) by A1, COMPUT_1:22; ::_thesis: verum
end;
end;
theorem Th2: :: AOFA_000:2
for X being non empty set
for x being Element of X
for n being Nat holds arity ((n -tuples_on X) --> x) = n
proof
let X be non empty set ; ::_thesis: for x being Element of X
for n being Nat holds arity ((n -tuples_on X) --> x) = n
let x be Element of X; ::_thesis: for n being Nat holds arity ((n -tuples_on X) --> x) = n
let n be Nat; ::_thesis: arity ((n -tuples_on X) --> x) = n
reconsider m = n as Element of NAT by ORDINAL1:def_12;
set f = (n -tuples_on X) --> x;
dom ((n -tuples_on X) --> x) = m -tuples_on X by FUNCOP_1:13;
hence arity ((n -tuples_on X) --> x) = n by COMPUT_1:24; ::_thesis: verum
end;
Lm1: now__::_thesis:_for_X_being_non_empty_set_
for_x_being_Element_of_X
for_n_being_Nat_holds_(n_-tuples_on_X)_-->_x_is_n_-ary
let X be non empty set ; ::_thesis: for x being Element of X
for n being Nat holds (n -tuples_on X) --> x is n -ary
let x be Element of X; ::_thesis: for n being Nat holds (n -tuples_on X) --> x is n -ary
let n be Nat; ::_thesis: (n -tuples_on X) --> x is n -ary
arity ((n -tuples_on X) --> x) = n by Th2;
hence (n -tuples_on X) --> x is n -ary by COMPUT_1:def_21; ::_thesis: verum
end;
registration
let X be non empty set ;
let x be Element of X;
let n be Nat;
cluster(n -tuples_on X) --> x -> homogeneous n -ary for homogeneous PartFunc of (X *),X;
coherence
for b1 being homogeneous PartFunc of (X *),X st b1 = (n -tuples_on X) --> x holds
b1 is n -ary by Lm1;
end;
registration
let X be non empty set ;
cluster non empty Relation-like X * -defined X -valued Function-like homogeneous quasi_total 2 -ary associative unital for Element of bool [:(X *),X:];
existence
ex b1 being non empty homogeneous quasi_total PartFunc of (X *),X st
( b1 is 2 -ary & b1 is associative & b1 is unital )
proof
set x = the Element of X;
deffunc H1( Element of X, Element of X) -> Element of X = IFEQ (X, the Element of X,c2,X);
( ex f being Function of (2 -tuples_on X),X st
for x, y being Element of X holds f . <*x,y*> = H1(x,y) & ( for f1, f2 being Function of (2 -tuples_on X),X st ( for x, y being Element of X holds f1 . <*x,y*> = H1(x,y) ) & ( for x, y being Element of X holds f2 . <*x,y*> = H1(x,y) ) holds
f1 = f2 ) ) from CIRCCMB3:sch_7();
then consider f being Function of (2 -tuples_on X),X such that
A1: for a, b being Element of X holds f . <*a,b*> = IFEQ (a, the Element of X,b,a) ;
A2: rng f c= X ;
A3: dom f = 2 -tuples_on X by FUNCT_2:def_1;
then reconsider f = f as non empty homogeneous PartFunc of (X *),X by A2, COMPUT_1:16, FINSEQ_2:134, RELSET_1:4;
arity f = 2 by A3, COMPUT_1:24;
then reconsider f = f as non empty homogeneous quasi_total PartFunc of (X *),X by A3, COMPUT_1:22;
take f ; ::_thesis: ( f is 2 -ary & f is associative & f is unital )
thus arity f = 2 by A3, COMPUT_1:24; :: according to COMPUT_1:def_21 ::_thesis: ( f is associative & f is unital )
hereby :: according to AOFA_000:def_2 ::_thesis: f is unital
let u, y, z be set ; ::_thesis: ( <*u,y*> in dom f & <*y,z*> in dom f & <*(f . <*u,y*>),z*> in dom f & <*u,(f . <*y,z*>)*> in dom f implies f . <*(f . <*u,y*>),z*> = f . <*u,(f . <*y,z*>)*> )
assume that
A4: <*u,y*> in dom f and
A5: <*y,z*> in dom f ; ::_thesis: ( <*(f . <*u,y*>),z*> in dom f & <*u,(f . <*y,z*>)*> in dom f implies f . <*(f . <*u,y*>),z*> = f . <*u,(f . <*y,z*>)*> )
reconsider u9 = u, y9 = y, z9 = z as Element of X by A3, A4, A5, FINSEQ_2:138;
assume that
<*(f . <*u,y*>),z*> in dom f and
<*u,(f . <*y,z*>)*> in dom f ; ::_thesis: f . <*(f . <*u,y*>),z*> = f . <*u,(f . <*y,z*>)*>
A6: ( u = the Element of X implies IFEQ (u, the Element of X,y,u) = y ) by FUNCOP_1:def_8;
A7: ( u <> the Element of X implies IFEQ (u, the Element of X,y,u) = u ) by FUNCOP_1:def_8;
A8: ( u = the Element of X implies IFEQ (u, the Element of X,(IFEQ (y, the Element of X,z,y)),u) = IFEQ (y, the Element of X,z,y) ) by FUNCOP_1:def_8;
A9: ( u <> the Element of X implies IFEQ (u, the Element of X,(IFEQ (y, the Element of X,z,y)),u) = u ) by FUNCOP_1:def_8;
A10: ( u <> the Element of X implies IFEQ (u, the Element of X,z,u) = u ) by FUNCOP_1:def_8;
thus f . <*(f . <*u,y*>),z*> = f . <*(IFEQ (u9, the Element of X,y9,u9)),z9*> by A1
.= IFEQ ((IFEQ (u, the Element of X,y,u)), the Element of X,z,(IFEQ (u, the Element of X,y,u))) by A1
.= f . <*u9,(IFEQ (y9, the Element of X,z9,y9))*> by A1, A6, A7, A8, A9, A10
.= f . <*u,(f . <*y,z*>)*> by A1 ; ::_thesis: verum
end;
take the Element of X ; :: according to AOFA_000:def_3 ::_thesis: the Element of X is_a_unity_wrt f
let y, z be set ; :: according to AOFA_000:def_1 ::_thesis: ( ( <*y,z*> in dom f or <*z,y*> in dom f ) implies ( <* the Element of X,y*> in dom f & f . <* the Element of X,y*> = y & <*y, the Element of X*> in dom f & f . <*y, the Element of X*> = y ) )
assume ( <*y,z*> in dom f or <*z,y*> in dom f ) ; ::_thesis: ( <* the Element of X,y*> in dom f & f . <* the Element of X,y*> = y & <*y, the Element of X*> in dom f & f . <*y, the Element of X*> = y )
then reconsider y9 = y as Element of X by A3, FINSEQ_2:138;
<* the Element of X,y9*> in 2 -tuples_on X by FINSEQ_2:137;
hence <* the Element of X,y*> in dom f by FUNCT_2:def_1; ::_thesis: ( f . <* the Element of X,y*> = y & <*y, the Element of X*> in dom f & f . <*y, the Element of X*> = y )
thus f . <* the Element of X,y*> = IFEQ ( the Element of X, the Element of X,y9, the Element of X) by A1
.= y by FUNCOP_1:def_8 ; ::_thesis: ( <*y, the Element of X*> in dom f & f . <*y, the Element of X*> = y )
<*y9, the Element of X*> in 2 -tuples_on X by FINSEQ_2:137;
hence <*y, the Element of X*> in dom f by FUNCT_2:def_1; ::_thesis: f . <*y, the Element of X*> = y
A11: ( the Element of X = y or the Element of X <> y ) ;
thus f . <*y, the Element of X*> = IFEQ (y9, the Element of X, the Element of X,y9) by A1
.= y by A11, FUNCOP_1:def_8 ; ::_thesis: verum
end;
cluster non empty Relation-like X * -defined X -valued Function-like homogeneous quasi_total 0 -ary for Element of bool [:(X *),X:];
existence
ex b1 being non empty homogeneous quasi_total PartFunc of (X *),X st b1 is 0 -ary
proof
set x = the Element of X;
set f = (0 -tuples_on X) --> the Element of X;
take (0 -tuples_on X) --> the Element of X ; ::_thesis: (0 -tuples_on X) --> the Element of X is 0 -ary
thus arity ((0 -tuples_on X) --> the Element of X) = 0 by Th2; :: according to COMPUT_1:def_21 ::_thesis: verum
end;
cluster non empty Relation-like X * -defined X -valued Function-like homogeneous quasi_total 3 -ary for Element of bool [:(X *),X:];
existence
ex b1 being non empty homogeneous quasi_total PartFunc of (X *),X st b1 is 3 -ary
proof
set x = the Element of X;
set f = (3 -tuples_on X) --> the Element of X;
take (3 -tuples_on X) --> the Element of X ; ::_thesis: (3 -tuples_on X) --> the Element of X is 3 -ary
thus arity ((3 -tuples_on X) --> the Element of X) = 3 by Th2; :: according to COMPUT_1:def_21 ::_thesis: verum
end;
end;
theorem Th3: :: AOFA_000:3
for X being non empty set
for p being FinSequence of FinTrees X
for x, t being set st t in rng p holds
t <> x -tree p
proof
let X be non empty set ; ::_thesis: for p being FinSequence of FinTrees X
for x, t being set st t in rng p holds
t <> x -tree p
let p be FinSequence of FinTrees X; ::_thesis: for x, t being set st t in rng p holds
t <> x -tree p
let x, t be set ; ::_thesis: ( t in rng p implies t <> x -tree p )
assume A1: t in rng p ; ::_thesis: t <> x -tree p
then reconsider T = t as Element of FinTrees X ;
reconsider A = dom T as finite Tree ;
defpred S1[ set ] means verum;
deffunc H1( Element of A) -> Element of NAT = len $1;
{ H1(e) where e is Element of A : S1[e] } is finite from PRE_CIRC:sch_1();
then reconsider B = { H1(e) where e is Element of A : S1[e] } as finite set ;
set e = the Element of A;
A2: H1( the Element of A) in B ;
B is real-membered
proof
let a be set ; :: according to MEMBERED:def_3 ::_thesis: ( a nin B or not a is V80() )
assume a in B ; ::_thesis: a is V80()
then ex e being Element of A st a = H1(e) ;
hence a is V80() ; ::_thesis: verum
end;
then reconsider B = B as non empty finite real-membered set by A2;
max B in B by XXREAL_2:def_8;
then consider e being Element of A such that
A3: max B = len e ;
consider i being set such that
A4: i in dom p and
A5: t = p . i by A1, FUNCT_1:def_3;
reconsider i = i as Nat by A4;
i >= 1 by A4, FINSEQ_3:25;
then consider j being Nat such that
A6: i = 1 + j by NAT_1:10;
i <= len p by A4, FINSEQ_3:25;
then A7: j < len p by A6, NAT_1:13;
j in NAT by ORDINAL1:def_12;
then A8: <*j*> ^ e in dom (x -tree p) by A5, A6, A7, TREES_4:11;
len (<*j*> ^ e) = 1 + (len e) by FINSEQ_5:8;
then len (<*j*> ^ e) > max B by A3, NAT_1:13;
then len (<*j*> ^ e) nin B by XXREAL_2:def_8;
hence t <> x -tree p by A8; ::_thesis: verum
end;
definition
let f, g be Function;
let X be set ;
func(f,X) +* g -> Function equals :: AOFA_000:def 4
g +* (f | X);
coherence
g +* (f | X) is Function ;
end;
:: deftheorem defines +* AOFA_000:def_4_:_
for f, g being Function
for X being set holds (f,X) +* g = g +* (f | X);
theorem Th4: :: AOFA_000:4
for f, g being Function
for x, X being set st x in X & X c= dom f holds
((f,X) +* g) . x = f . x
proof
let f, g be Function; ::_thesis: for x, X being set st x in X & X c= dom f holds
((f,X) +* g) . x = f . x
let x, X be set ; ::_thesis: ( x in X & X c= dom f implies ((f,X) +* g) . x = f . x )
assume A1: x in X ; ::_thesis: ( not X c= dom f or ((f,X) +* g) . x = f . x )
assume A2: X c= dom f ; ::_thesis: ((f,X) +* g) . x = f . x
dom (f | X) = (dom f) /\ X by RELAT_1:61;
then A3: x in dom (f | X) by A1, A2, XBOOLE_0:def_4;
then (f | X) . x = f . x by FUNCT_1:47;
hence ((f,X) +* g) . x = f . x by A3, FUNCT_4:13; ::_thesis: verum
end;
theorem Th5: :: AOFA_000:5
for f, g being Function
for x, X being set st x nin X & x in dom g holds
((f,X) +* g) . x = g . x
proof
let f, g be Function; ::_thesis: for x, X being set st x nin X & x in dom g holds
((f,X) +* g) . x = g . x
let x, X be set ; ::_thesis: ( x nin X & x in dom g implies ((f,X) +* g) . x = g . x )
assume x nin X ; ::_thesis: ( not x in dom g or ((f,X) +* g) . x = g . x )
then x nin (dom f) /\ X by XBOOLE_0:def_4;
then x nin dom (f | X) by RELAT_1:61;
hence ( not x in dom g or ((f,X) +* g) . x = g . x ) by FUNCT_4:11; ::_thesis: verum
end;
definition
let X, Y be non empty set ;
let f, g be Element of Funcs (X,Y);
let A be set ;
:: original: +*
redefine func(f,A) +* g -> Element of Funcs (X,Y);
coherence
(f,A) +* g is Element of Funcs (X,Y)
proof
dom g = X by FUNCT_2:92;
then (dom g) \/ (dom (f | A)) = X by XBOOLE_1:12;
then A1: dom ((f,A) +* g) = X by FUNCT_4:def_1;
rng ((f,A) +* g) c= (rng g) \/ (rng (f | A)) by FUNCT_4:17;
then rng ((f,A) +* g) c= Y by XBOOLE_1:1;
hence (f,A) +* g is Element of Funcs (X,Y) by A1, FUNCT_2:def_2; ::_thesis: verum
end;
end;
definition
let X, Y, Z be non empty set ;
let f be Element of Funcs (X,Y);
let g be Element of Funcs (Y,Z);
:: original: *
redefine funcg * f -> Element of Funcs (X,Z);
coherence
f * g is Element of Funcs (X,Z)
proof
g * f is Function of X,Z ;
hence f * g is Element of Funcs (X,Z) by FUNCT_2:8; ::_thesis: verum
end;
end;
definition
let f be Function;
let x be set ;
funcf orbit x -> set equals :: AOFA_000:def 5
{ ((iter (f,n)) . x) where n is Element of NAT : x in dom (iter (f,n)) } ;
coherence
{ ((iter (f,n)) . x) where n is Element of NAT : x in dom (iter (f,n)) } is set ;
end;
:: deftheorem defines orbit AOFA_000:def_5_:_
for f being Function
for x being set holds f orbit x = { ((iter (f,n)) . x) where n is Element of NAT : x in dom (iter (f,n)) } ;
theorem Th6: :: AOFA_000:6
for f being Function
for x being set st x in dom f holds
x in f orbit x
proof
let f be Function; ::_thesis: for x being set st x in dom f holds
x in f orbit x
let x be set ; ::_thesis: ( x in dom f implies x in f orbit x )
assume x in dom f ; ::_thesis: x in f orbit x
then A1: x in (dom f) \/ (rng f) by XBOOLE_0:def_3;
A2: iter (f,0) = id (field f) by FUNCT_7:68;
then A3: (iter (f,0)) . x = x by A1, FUNCT_1:17;
dom (iter (f,0)) = (dom f) \/ (rng f) by A2, FUNCT_1:17;
hence x in f orbit x by A1, A3; ::_thesis: verum
end;
theorem :: AOFA_000:7
for f being Function
for x, y being set st rng f c= dom f & y in f orbit x holds
f . y in f orbit x
proof
let f be Function; ::_thesis: for x, y being set st rng f c= dom f & y in f orbit x holds
f . y in f orbit x
let x, y be set ; ::_thesis: ( rng f c= dom f & y in f orbit x implies f . y in f orbit x )
assume A1: rng f c= dom f ; ::_thesis: ( not y in f orbit x or f . y in f orbit x )
assume y in f orbit x ; ::_thesis: f . y in f orbit x
then consider n being Element of NAT such that
A2: y = (iter (f,n)) . x and
A3: x in dom (iter (f,n)) ;
A4: iter (f,(n + 1)) = f * (iter (f,n)) by FUNCT_7:71;
then A5: f . y = (iter (f,(n + 1))) . x by A2, A3, FUNCT_1:13;
A6: y in rng (iter (f,n)) by A2, A3, FUNCT_1:def_3;
A7: rng (iter (f,n)) c= field f by FUNCT_7:72;
field f = dom f by A1, XBOOLE_1:12;
then x in dom (iter (f,(n + 1))) by A2, A3, A4, A6, A7, FUNCT_1:11;
hence f . y in f orbit x by A5; ::_thesis: verum
end;
theorem :: AOFA_000:8
for f being Function
for x being set st x in dom f holds
f . x in f orbit x
proof
let f be Function; ::_thesis: for x being set st x in dom f holds
f . x in f orbit x
let x be set ; ::_thesis: ( x in dom f implies f . x in f orbit x )
assume A1: x in dom f ; ::_thesis: f . x in f orbit x
iter (f,1) = f by FUNCT_7:70;
hence f . x in f orbit x by A1; ::_thesis: verum
end;
theorem Th9: :: AOFA_000:9
for f being Function
for x being set st x in dom f holds
f orbit (f . x) c= f orbit x
proof
let f be Function; ::_thesis: for x being set st x in dom f holds
f orbit (f . x) c= f orbit x
let x be set ; ::_thesis: ( x in dom f implies f orbit (f . x) c= f orbit x )
assume A1: x in dom f ; ::_thesis: f orbit (f . x) c= f orbit x
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin f orbit (f . x) or not a nin f orbit x )
assume a in f orbit (f . x) ; ::_thesis: not a nin f orbit x
then consider n being Element of NAT such that
A2: a = (iter (f,n)) . (f . x) and
A3: f . x in dom (iter (f,n)) ;
A4: iter (f,(n + 1)) = (iter (f,n)) * f by FUNCT_7:69;
then A5: a = (iter (f,(n + 1))) . x by A1, A2, FUNCT_1:13;
x in dom (iter (f,(n + 1))) by A1, A3, A4, FUNCT_1:11;
hence not a nin f orbit x by A5; ::_thesis: verum
end;
definition
let f be Function;
assume B1: rng f c= dom f ;
let A, x be set ;
defpred S1[ Nat] means for a being set st a in dom f holds
a in dom (iter (f,$1));
A1: field f = dom f by B1, XBOOLE_1:12;
then iter (f,0) = id (dom f) by FUNCT_7:68;
then A2: S1[ 0 ] by FUNCT_1:17;
A3: now__::_thesis:_for_i_being_Element_of_NAT_st_S1[i]_holds_
S1[i_+_1]
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A4: S1[i] ; ::_thesis: S1[i + 1]
thus S1[i + 1] ::_thesis: verum
proof
let a be set ; ::_thesis: ( a in dom f implies a in dom (iter (f,(i + 1))) )
assume a in dom f ; ::_thesis: a in dom (iter (f,(i + 1)))
then A5: a in dom (iter (f,i)) by A4;
then A6: (iter (f,i)) . a in rng (iter (f,i)) by FUNCT_1:def_3;
A7: rng (iter (f,i)) c= dom f by A1, FUNCT_7:72;
iter (f,(i + 1)) = f * (iter (f,i)) by FUNCT_7:71;
hence a in dom (iter (f,(i + 1))) by A5, A6, A7, FUNCT_1:11; ::_thesis: verum
end;
end;
A8: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A2, A3);
func(A,x) iter f -> Function means :: AOFA_000:def 6
( dom it = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies it . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
it . a = (iter (f,n)) . a ) ) ) );
existence
ex b1 being Function st
( dom b1 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b1 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b1 . a = (iter (f,n)) . a ) ) ) )
proof
defpred S2[ set ] means f orbit $1 c= A;
consider Z being set such that
A9: for a being set holds
( a in Z iff ( a in dom f & S2[a] ) ) from XBOOLE_0:sch_1();
A10: Z c= dom f
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin Z or not a nin dom f )
thus ( a nin Z or not a nin dom f ) by A9; ::_thesis: verum
end;
defpred S3[ set , set ] means ex n being Nat st
( $2 = (iter (f,n)) . $1 & $2 nin A & ( for i being Nat st i < n holds
(iter (f,i)) . $1 in A ) );
A11: for a being set st a in (dom f) \ Z holds
ex b being set st S3[a,b]
proof
let a be set ; ::_thesis: ( a in (dom f) \ Z implies ex b being set st S3[a,b] )
assume A12: a in (dom f) \ Z ; ::_thesis: ex b being set st S3[a,b]
then a nin Z by XBOOLE_0:def_5;
then not f orbit a c= A by A9, A12;
then consider y being set such that
A13: y in f orbit a and
A14: y nin A by TARSKI:def_3;
A15: ex n1 being Element of NAT st
( y = (iter (f,n1)) . a & a in dom (iter (f,n1)) ) by A13;
defpred S4[ Nat] means (iter (f,$1)) . a nin A;
A16: ex n being Nat st S4[n] by A14, A15;
consider n being Nat such that
A17: S4[n] and
A18: for m being Nat st S4[m] holds
n <= m from NAT_1:sch_5(A16);
take b = (iter (f,n)) . a; ::_thesis: S3[a,b]
take n ; ::_thesis: ( b = (iter (f,n)) . a & b nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) )
thus ( b = (iter (f,n)) . a & b nin A ) by A17; ::_thesis: for i being Nat st i < n holds
(iter (f,i)) . a in A
let i be Nat; ::_thesis: ( i < n implies (iter (f,i)) . a in A )
thus ( i < n implies (iter (f,i)) . a in A ) by A18; ::_thesis: verum
end;
consider h being Function such that
A19: dom h = (dom f) \ Z and
A20: for a being set st a in (dom f) \ Z holds
S3[a,h . a] from CLASSES1:sch_1(A11);
take g = (Z --> x) +* h; ::_thesis: ( dom g = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies g . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
g . a = (iter (f,n)) . a ) ) ) )
dom (Z --> x) = Z by FUNCOP_1:13;
hence dom g = Z \/ ((dom f) \ Z) by A19, FUNCT_4:def_1
.= dom f by A10, XBOOLE_1:45 ;
::_thesis: for a being set st a in dom f holds
( ( f orbit a c= A implies g . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
g . a = (iter (f,n)) . a ) )
let a be set ; ::_thesis: ( a in dom f implies ( ( f orbit a c= A implies g . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
g . a = (iter (f,n)) . a ) ) )
assume A21: a in dom f ; ::_thesis: ( ( f orbit a c= A implies g . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
g . a = (iter (f,n)) . a ) )
hereby ::_thesis: for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
g . a = (iter (f,n)) . a
assume f orbit a c= A ; ::_thesis: g . a = x
then A22: a in Z by A9, A21;
then A23: a nin (dom f) \ Z by XBOOLE_0:def_5;
(Z --> x) . a = x by A22, FUNCOP_1:7;
hence g . a = x by A19, A23, FUNCT_4:11; ::_thesis: verum
end;
let n be Nat; ::_thesis: ( (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) implies g . a = (iter (f,n)) . a )
assume that
A24: (iter (f,n)) . a nin A and
A25: for i being Nat st i < n holds
(iter (f,i)) . a in A ; ::_thesis: g . a = (iter (f,n)) . a
A26: n in NAT by ORDINAL1:def_12;
then a in dom (iter (f,n)) by A8, A21;
then (iter (f,n)) . a in f orbit a by A26;
then not f orbit a c= A by A24;
then a nin Z by A9;
then A27: a in (dom f) \ Z by A21, XBOOLE_0:def_5;
then consider n2 being Nat such that
A28: h . a = (iter (f,n2)) . a and
A29: h . a nin A and
A30: for i being Nat st i < n2 holds
(iter (f,i)) . a in A by A20;
A31: n <= n2 by A25, A28, A29;
n2 <= n by A24, A30;
then n = n2 by A31, XXREAL_0:1;
hence g . a = (iter (f,n)) . a by A19, A27, A28, FUNCT_4:13; ::_thesis: verum
end;
uniqueness
for b1, b2 being Function st dom b1 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b1 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b1 . a = (iter (f,n)) . a ) ) ) & dom b2 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b2 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b2 . a = (iter (f,n)) . a ) ) ) holds
b1 = b2
proof
let f1, f2 be Function; ::_thesis: ( dom f1 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies f1 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f1 . a = (iter (f,n)) . a ) ) ) & dom f2 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies f2 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f2 . a = (iter (f,n)) . a ) ) ) implies f1 = f2 )
assume that
A32: dom f1 = dom f and
A33: for a being set st a in dom f holds
( ( f orbit a c= A implies f1 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f1 . a = (iter (f,n)) . a ) ) and
A34: dom f2 = dom f and
A35: for a being set st a in dom f holds
( ( f orbit a c= A implies f2 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f2 . a = (iter (f,n)) . a ) ) ; ::_thesis: f1 = f2
now__::_thesis:_for_a_being_set_st_a_in_dom_f_holds_
f1_._a_=_f2_._a
let a be set ; ::_thesis: ( a in dom f implies f1 . b1 = f2 . b1 )
assume A36: a in dom f ; ::_thesis: f1 . b1 = f2 . b1
percases ( f orbit a c= A or not f orbit a c= A ) ;
supposeA37: f orbit a c= A ; ::_thesis: f1 . b1 = f2 . b1
hence f1 . a = x by A33, A36
.= f2 . a by A35, A36, A37 ;
::_thesis: verum
end;
suppose not f orbit a c= A ; ::_thesis: f1 . b1 = f2 . b1
then consider y being set such that
A38: y in f orbit a and
A39: y nin A by TARSKI:def_3;
A40: ex n1 being Element of NAT st
( y = (iter (f,n1)) . a & a in dom (iter (f,n1)) ) by A38;
defpred S2[ Nat] means (iter (f,$1)) . a nin A;
A41: ex n being Nat st S2[n] by A39, A40;
consider n being Nat such that
A42: S2[n] and
A43: for m being Nat st S2[m] holds
n <= m from NAT_1:sch_5(A41);
A44: for i being Nat st i < n holds
(iter (f,i)) . a in A by A43;
hence f1 . a = (iter (f,n)) . a by A33, A36, A42
.= f2 . a by A35, A36, A42, A44 ;
::_thesis: verum
end;
end;
end;
hence f1 = f2 by A32, A34, FUNCT_1:2; ::_thesis: verum
end;
end;
:: deftheorem defines iter AOFA_000:def_6_:_
for f being Function st rng f c= dom f holds
for A, x being set
for b4 being Function holds
( b4 = (A,x) iter f iff ( dom b4 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b4 . a = x ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b4 . a = (iter (f,n)) . a ) ) ) ) );
definition
let f be Function;
assume B1: rng f c= dom f ;
let A be set ;
let g be Function;
defpred S1[ Nat] means for a being set st a in dom f holds
a in dom (iter (f,$1));
A1: field f = dom f by B1, XBOOLE_1:12;
then iter (f,0) = id (dom f) by FUNCT_7:68;
then A2: S1[ 0 ] by FUNCT_1:17;
A3: now__::_thesis:_for_i_being_Element_of_NAT_st_S1[i]_holds_
S1[i_+_1]
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A4: S1[i] ; ::_thesis: S1[i + 1]
thus S1[i + 1] ::_thesis: verum
proof
let a be set ; ::_thesis: ( a in dom f implies a in dom (iter (f,(i + 1))) )
assume a in dom f ; ::_thesis: a in dom (iter (f,(i + 1)))
then A5: a in dom (iter (f,i)) by A4;
then A6: (iter (f,i)) . a in rng (iter (f,i)) by FUNCT_1:def_3;
A7: rng (iter (f,i)) c= dom f by A1, FUNCT_7:72;
iter (f,(i + 1)) = f * (iter (f,i)) by FUNCT_7:71;
hence a in dom (iter (f,(i + 1))) by A5, A6, A7, FUNCT_1:11; ::_thesis: verum
end;
end;
A8: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A2, A3);
func(A,g) iter f -> Function means :Def7: :: AOFA_000:def 7
( dom it = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies it . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
it . a = (iter (f,n)) . a ) ) ) );
existence
ex b1 being Function st
( dom b1 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b1 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b1 . a = (iter (f,n)) . a ) ) ) )
proof
defpred S2[ set ] means f orbit $1 c= A;
consider Z being set such that
A9: for a being set holds
( a in Z iff ( a in dom f & S2[a] ) ) from XBOOLE_0:sch_1();
A10: Z c= dom f
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin Z or not a nin dom f )
thus ( a nin Z or not a nin dom f ) by A9; ::_thesis: verum
end;
defpred S3[ set , set ] means ex n being Nat st
( $2 = (iter (f,n)) . $1 & $2 nin A & ( for i being Nat st i < n holds
(iter (f,i)) . $1 in A ) );
A11: for a being set st a in (dom f) \ Z holds
ex b being set st S3[a,b]
proof
let a be set ; ::_thesis: ( a in (dom f) \ Z implies ex b being set st S3[a,b] )
assume A12: a in (dom f) \ Z ; ::_thesis: ex b being set st S3[a,b]
then a nin Z by XBOOLE_0:def_5;
then not f orbit a c= A by A9, A12;
then consider y being set such that
A13: y in f orbit a and
A14: y nin A by TARSKI:def_3;
A15: ex n1 being Element of NAT st
( y = (iter (f,n1)) . a & a in dom (iter (f,n1)) ) by A13;
defpred S4[ Nat] means (iter (f,$1)) . a nin A;
A16: ex n being Nat st S4[n] by A14, A15;
consider n being Nat such that
A17: S4[n] and
A18: for m being Nat st S4[m] holds
n <= m from NAT_1:sch_5(A16);
take b = (iter (f,n)) . a; ::_thesis: S3[a,b]
take n ; ::_thesis: ( b = (iter (f,n)) . a & b nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) )
thus ( b = (iter (f,n)) . a & b nin A ) by A17; ::_thesis: for i being Nat st i < n holds
(iter (f,i)) . a in A
let i be Nat; ::_thesis: ( i < n implies (iter (f,i)) . a in A )
thus ( i < n implies (iter (f,i)) . a in A ) by A18; ::_thesis: verum
end;
consider h being Function such that
A19: dom h = (dom f) \ Z and
A20: for a being set st a in (dom f) \ Z holds
S3[a,h . a] from CLASSES1:sch_1(A11);
take i = ((Z --> 0) +* (g | Z)) +* h; ::_thesis: ( dom i = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies i . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
i . a = (iter (f,n)) . a ) ) ) )
dom (Z --> 0) = Z by FUNCOP_1:13;
then dom ((Z --> 0) +* (g | Z)) = Z \/ (dom (g | Z)) by FUNCT_4:def_1
.= Z by RELAT_1:58, XBOOLE_1:12 ;
hence dom i = Z \/ ((dom f) \ Z) by A19, FUNCT_4:def_1
.= dom f by A10, XBOOLE_1:45 ;
::_thesis: for a being set st a in dom f holds
( ( f orbit a c= A implies i . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
i . a = (iter (f,n)) . a ) )
let a be set ; ::_thesis: ( a in dom f implies ( ( f orbit a c= A implies i . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
i . a = (iter (f,n)) . a ) ) )
assume A21: a in dom f ; ::_thesis: ( ( f orbit a c= A implies i . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
i . a = (iter (f,n)) . a ) )
hereby ::_thesis: for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
i . a = (iter (f,n)) . a
assume f orbit a c= A ; ::_thesis: i . a = g . a
then A22: a in Z by A9, A21;
then a nin (dom f) \ Z by XBOOLE_0:def_5;
then A23: i . a = ((Z --> 0) +* (g | Z)) . a by A19, FUNCT_4:11;
percases ( a in dom (g | Z) or a nin dom (g | Z) ) ;
suppose a in dom (g | Z) ; ::_thesis: i . a = g . a
then i . a = (g | Z) . a by A23, FUNCT_4:13;
hence i . a = g . a by A22, FUNCT_1:49; ::_thesis: verum
end;
supposeA24: a nin dom (g | Z) ; ::_thesis: i . a = g . a
then A25: i . a = (Z --> 0) . a by A23, FUNCT_4:11;
A26: (Z --> 0) . a = 0 by A22, FUNCOP_1:7;
a nin dom g by A22, A24, RELAT_1:57;
hence i . a = g . a by A25, A26, FUNCT_1:def_2; ::_thesis: verum
end;
end;
end;
let n be Nat; ::_thesis: ( (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) implies i . a = (iter (f,n)) . a )
reconsider n9 = n as Element of NAT by ORDINAL1:def_12;
assume that
A27: (iter (f,n)) . a nin A and
A28: for i being Nat st i < n holds
(iter (f,i)) . a in A ; ::_thesis: i . a = (iter (f,n)) . a
a in dom (iter (f,n9)) by A8, A21;
then (iter (f,n)) . a in f orbit a ;
then not f orbit a c= A by A27;
then a nin Z by A9;
then A29: a in (dom f) \ Z by A21, XBOOLE_0:def_5;
then consider n2 being Nat such that
A30: h . a = (iter (f,n2)) . a and
A31: h . a nin A and
A32: for i being Nat st i < n2 holds
(iter (f,i)) . a in A by A20;
A33: n <= n2 by A28, A30, A31;
n2 <= n by A27, A32;
then n = n2 by A33, XXREAL_0:1;
hence i . a = (iter (f,n)) . a by A19, A29, A30, FUNCT_4:13; ::_thesis: verum
end;
uniqueness
for b1, b2 being Function st dom b1 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b1 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b1 . a = (iter (f,n)) . a ) ) ) & dom b2 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b2 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b2 . a = (iter (f,n)) . a ) ) ) holds
b1 = b2
proof
let f1, f2 be Function; ::_thesis: ( dom f1 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies f1 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f1 . a = (iter (f,n)) . a ) ) ) & dom f2 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies f2 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f2 . a = (iter (f,n)) . a ) ) ) implies f1 = f2 )
assume that
A34: dom f1 = dom f and
A35: for a being set st a in dom f holds
( ( f orbit a c= A implies f1 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f1 . a = (iter (f,n)) . a ) ) and
A36: dom f2 = dom f and
A37: for a being set st a in dom f holds
( ( f orbit a c= A implies f2 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
f2 . a = (iter (f,n)) . a ) ) ; ::_thesis: f1 = f2
now__::_thesis:_for_a_being_set_st_a_in_dom_f_holds_
f1_._a_=_f2_._a
let a be set ; ::_thesis: ( a in dom f implies f1 . b1 = f2 . b1 )
assume A38: a in dom f ; ::_thesis: f1 . b1 = f2 . b1
percases ( f orbit a c= A or not f orbit a c= A ) ;
supposeA39: f orbit a c= A ; ::_thesis: f1 . b1 = f2 . b1
hence f1 . a = g . a by A35, A38
.= f2 . a by A37, A38, A39 ;
::_thesis: verum
end;
suppose not f orbit a c= A ; ::_thesis: f1 . b1 = f2 . b1
then consider y being set such that
A40: y in f orbit a and
A41: y nin A by TARSKI:def_3;
A42: ex n1 being Element of NAT st
( y = (iter (f,n1)) . a & a in dom (iter (f,n1)) ) by A40;
defpred S2[ Nat] means (iter (f,$1)) . a nin A;
A43: ex n being Nat st S2[n] by A41, A42;
consider n being Nat such that
A44: S2[n] and
A45: for m being Nat st S2[m] holds
n <= m from NAT_1:sch_5(A43);
A46: for i being Nat st i < n holds
(iter (f,i)) . a in A by A45;
hence f1 . a = (iter (f,n)) . a by A35, A38, A44
.= f2 . a by A37, A38, A44, A46 ;
::_thesis: verum
end;
end;
end;
hence f1 = f2 by A34, A36, FUNCT_1:2; ::_thesis: verum
end;
end;
:: deftheorem Def7 defines iter AOFA_000:def_7_:_
for f being Function st rng f c= dom f holds
for A being set
for g, b4 being Function holds
( b4 = (A,g) iter f iff ( dom b4 = dom f & ( for a being set st a in dom f holds
( ( f orbit a c= A implies b4 . a = g . a ) & ( for n being Nat st (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) holds
b4 . a = (iter (f,n)) . a ) ) ) ) );
theorem Th10: :: AOFA_000:10
for f, g being Function
for a, A being set st rng f c= dom f & a in dom f & not f orbit a c= A holds
ex n being Nat st
( ((A,g) iter f) . a = (iter (f,n)) . a & (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) )
proof
let f, g be Function; ::_thesis: for a, A being set st rng f c= dom f & a in dom f & not f orbit a c= A holds
ex n being Nat st
( ((A,g) iter f) . a = (iter (f,n)) . a & (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) )
let a, A be set ; ::_thesis: ( rng f c= dom f & a in dom f & not f orbit a c= A implies ex n being Nat st
( ((A,g) iter f) . a = (iter (f,n)) . a & (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) ) )
assume A1: rng f c= dom f ; ::_thesis: ( not a in dom f or f orbit a c= A or ex n being Nat st
( ((A,g) iter f) . a = (iter (f,n)) . a & (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) ) )
assume A2: a in dom f ; ::_thesis: ( f orbit a c= A or ex n being Nat st
( ((A,g) iter f) . a = (iter (f,n)) . a & (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) ) )
assume not f orbit a c= A ; ::_thesis: ex n being Nat st
( ((A,g) iter f) . a = (iter (f,n)) . a & (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) )
then consider y being set such that
A3: y in f orbit a and
A4: y nin A by TARSKI:def_3;
A5: ex n1 being Element of NAT st
( y = (iter (f,n1)) . a & a in dom (iter (f,n1)) ) by A3;
defpred S1[ Nat] means (iter (f,$1)) . a nin A;
A6: ex n being Nat st S1[n] by A4, A5;
consider n being Nat such that
A7: S1[n] and
A8: for m being Nat st S1[m] holds
n <= m from NAT_1:sch_5(A6);
take n ; ::_thesis: ( ((A,g) iter f) . a = (iter (f,n)) . a & (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) )
for i being Nat st i < n holds
(iter (f,i)) . a in A by A8;
hence ((A,g) iter f) . a = (iter (f,n)) . a by A1, A2, A7, Def7; ::_thesis: ( (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) )
thus ( (iter (f,n)) . a nin A & ( for i being Nat st i < n holds
(iter (f,i)) . a in A ) ) by A7, A8; ::_thesis: verum
end;
theorem Th11: :: AOFA_000:11
for f, g being Function
for a, A being set st rng f c= dom f & a in dom f & g * f = g & a in A holds
((A,g) iter f) . a = ((A,g) iter f) . (f . a)
proof
let f, g be Function; ::_thesis: for a, A being set st rng f c= dom f & a in dom f & g * f = g & a in A holds
((A,g) iter f) . a = ((A,g) iter f) . (f . a)
let a, A be set ; ::_thesis: ( rng f c= dom f & a in dom f & g * f = g & a in A implies ((A,g) iter f) . a = ((A,g) iter f) . (f . a) )
assume that
A1: rng f c= dom f and
A2: a in dom f and
A3: g * f = g and
A4: a in A ; ::_thesis: ((A,g) iter f) . a = ((A,g) iter f) . (f . a)
A5: f . a in rng f by A2, FUNCT_1:def_3;
A6: f orbit (f . a) c= f orbit a by A2, Th9;
percases ( f orbit a c= A or not f orbit a c= A ) ;
supposeA7: f orbit a c= A ; ::_thesis: ((A,g) iter f) . a = ((A,g) iter f) . (f . a)
then f orbit (f . a) c= A by A6, XBOOLE_1:1;
then ((A,g) iter f) . (f . a) = g . (f . a) by A1, A5, Def7
.= g . a by A2, A3, FUNCT_1:13 ;
hence ((A,g) iter f) . a = ((A,g) iter f) . (f . a) by A1, A2, A7, Def7; ::_thesis: verum
end;
suppose not f orbit a c= A ; ::_thesis: ((A,g) iter f) . a = ((A,g) iter f) . (f . a)
then consider n being Nat such that
A8: ((A,g) iter f) . a = (iter (f,n)) . a and
A9: (iter (f,n)) . a nin A and
A10: for i being Nat st i < n holds
(iter (f,i)) . a in A by A1, A2, Th10;
field f = dom f by A1, XBOOLE_1:12;
then iter (f,0) = id (dom f) by FUNCT_7:68;
then n <> 0 by A2, A4, A9, FUNCT_1:18;
then n >= 0 + 1 by NAT_1:13;
then consider i being Nat such that
A11: n = 1 + i by NAT_1:10;
iter (f,n) = (iter (f,i)) * f by A11, FUNCT_7:69;
then A12: (iter (f,n)) . a = (iter (f,i)) . (f . a) by A2, FUNCT_1:13;
now__::_thesis:_for_j_being_Nat_st_j_<_i_holds_
(iter_(f,j))_._(f_._a)_in_A
let j be Nat; ::_thesis: ( j < i implies (iter (f,j)) . (f . a) in A )
assume j < i ; ::_thesis: (iter (f,j)) . (f . a) in A
then A13: j + 1 < n by A11, XREAL_1:8;
A14: iter (f,(j + 1)) = (iter (f,j)) * f by FUNCT_7:69;
(iter (f,(j + 1))) . a in A by A10, A13;
hence (iter (f,j)) . (f . a) in A by A2, A14, FUNCT_1:13; ::_thesis: verum
end;
hence ((A,g) iter f) . a = ((A,g) iter f) . (f . a) by A1, A5, A8, A9, A12, Def7; ::_thesis: verum
end;
end;
end;
theorem Th12: :: AOFA_000:12
for f, g being Function
for a, A being set st rng f c= dom f & a in dom f & a nin A holds
((A,g) iter f) . a = a
proof
let f, g be Function; ::_thesis: for a, A being set st rng f c= dom f & a in dom f & a nin A holds
((A,g) iter f) . a = a
let a, A be set ; ::_thesis: ( rng f c= dom f & a in dom f & a nin A implies ((A,g) iter f) . a = a )
assume that
A1: rng f c= dom f and
A2: a in dom f and
A3: a nin A ; ::_thesis: ((A,g) iter f) . a = a
field f = dom f by A1, XBOOLE_1:12;
then iter (f,0) = id (dom f) by FUNCT_7:68;
then A4: a = (iter (f,0)) . a by A2, FUNCT_1:18;
for i being Nat st i < 0 holds
(iter (f,i)) . a in A ;
hence ((A,g) iter f) . a = a by A1, A2, A3, A4, Def7; ::_thesis: verum
end;
definition
let X be non empty set ;
let f be Element of Funcs (X,X);
let A be set ;
let g be Element of Funcs (X,X);
:: original: iter
redefine func(A,g) iter f -> Element of Funcs (X,X);
coherence
(A,g) iter f is Element of Funcs (X,X)
proof
A1: dom f = X by FUNCT_2:def_1;
A2: rng f c= X ;
then A3: dom ((A,g) iter f) = dom f by A1, Def7;
rng ((A,g) iter f) c= X
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin rng ((A,g) iter f) or not a nin X )
assume a in rng ((A,g) iter f) ; ::_thesis: not a nin X
then consider b being set such that
A4: b in dom ((A,g) iter f) and
A5: a = ((A,g) iter f) . b by FUNCT_1:def_3;
reconsider b = b as Element of X by A1, A2, A4, Def7;
percases ( f orbit b c= A or not f orbit b c= A ) ;
suppose f orbit b c= A ; ::_thesis: not a nin X
then a = g . b by A1, A2, A5, Def7;
hence not a nin X ; ::_thesis: verum
end;
suppose not f orbit b c= A ; ::_thesis: not a nin X
then consider n being Nat such that
A6: ((A,g) iter f) . b = (iter (f,n)) . b and
(iter (f,n)) . b nin A and
for i being Nat st i < n holds
(iter (f,i)) . b in A by A1, A2, Th10;
A7: dom (iter (f,n)) = dom f by A1, A2, FUNCT_7:74;
A8: rng (iter (f,n)) c= X by A1, A2, FUNCT_7:74;
a in rng (iter (f,n)) by A1, A5, A6, A7, FUNCT_1:3;
hence not a nin X by A8; ::_thesis: verum
end;
end;
end;
hence (A,g) iter f is Element of Funcs (X,X) by A1, A3, FUNCT_2:def_2; ::_thesis: verum
end;
end;
begin
theorem Th13: :: AOFA_000:13
for X being non empty set
for S being non empty FinSequence of NAT ex A being Universal_Algebra st
( the carrier of A = X & signature A = S )
proof
let X be non empty set ; ::_thesis: for S being non empty FinSequence of NAT ex A being Universal_Algebra st
( the carrier of A = X & signature A = S )
let S be non empty FinSequence of NAT ; ::_thesis: ex A being Universal_Algebra st
( the carrier of A = X & signature A = S )
A1: dom S = Seg (len S) by FINSEQ_1:def_3;
set x = the Element of X;
defpred S1[ set , set ] means ex i, j being Nat st
( $1 = i & j = S . i & $2 = (j -tuples_on X) --> the Element of X );
A2: for y being set st y in dom S holds
ex z being set st S1[y,z]
proof
let y be set ; ::_thesis: ( y in dom S implies ex z being set st S1[y,z] )
assume y in dom S ; ::_thesis: ex z being set st S1[y,z]
then reconsider i = y as Element of NAT ;
reconsider j = S . i as Element of NAT ;
take (j -tuples_on X) --> the Element of X ; ::_thesis: S1[y,(j -tuples_on X) --> the Element of X]
take i ; ::_thesis: ex j being Nat st
( y = i & j = S . i & (j -tuples_on X) --> the Element of X = (j -tuples_on X) --> the Element of X )
take j ; ::_thesis: ( y = i & j = S . i & (j -tuples_on X) --> the Element of X = (j -tuples_on X) --> the Element of X )
thus ( y = i & j = S . i & (j -tuples_on X) --> the Element of X = (j -tuples_on X) --> the Element of X ) ; ::_thesis: verum
end;
consider ch being Function such that
A3: ( dom ch = dom S & ( for y being set st y in dom S holds
S1[y,ch . y] ) ) from CLASSES1:sch_1(A2);
reconsider ch = ch as FinSequence by A1, A3, FINSEQ_1:def_2;
rng ch c= PFuncs ((X *),X)
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( y nin rng ch or not y nin PFuncs ((X *),X) )
assume y in rng ch ; ::_thesis: not y nin PFuncs ((X *),X)
then consider xi being set such that
A4: xi in dom ch and
A5: y = ch . xi by FUNCT_1:def_3;
consider i, j being Nat such that
xi = i and
j = S . i and
A6: y = (j -tuples_on X) --> the Element of X by A3, A4, A5;
A7: dom ((j -tuples_on X) --> the Element of X) = j -tuples_on X by FUNCOP_1:13;
rng ((j -tuples_on X) --> the Element of X) c= { the Element of X} by FUNCOP_1:13;
hence not y nin PFuncs ((X *),X) by A6, A7, PARTFUN1:def_3; ::_thesis: verum
end;
then reconsider ch = ch as PFuncFinSequence of X by FINSEQ_1:def_4;
set A = UAStr(# X,ch #);
A8: UAStr(# X,ch #) is quasi_total
proof
let n be Nat; :: according to UNIALG_1:def_2,MARGREL1:def_24 ::_thesis: for b1 being Element of bool [:( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #):] holds
( n nin dom the charact of UAStr(# X,ch #) or not b1 = the charact of UAStr(# X,ch #) . n or b1 is quasi_total )
let h be PartFunc of ( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #); ::_thesis: ( n nin dom the charact of UAStr(# X,ch #) or not h = the charact of UAStr(# X,ch #) . n or h is quasi_total )
assume that
A9: n in dom the charact of UAStr(# X,ch #) and
A10: h = the charact of UAStr(# X,ch #) . n ; ::_thesis: h is quasi_total
ex i, j being Nat st
( n = i & j = S . i & h = (j -tuples_on X) --> the Element of X ) by A3, A9, A10;
hence h is quasi_total ; ::_thesis: verum
end;
A11: UAStr(# X,ch #) is non-empty
proof
thus the charact of UAStr(# X,ch #) <> {} by A3; :: according to UNIALG_1:def_3 ::_thesis: the charact of UAStr(# X,ch #) is non-empty
assume {} in rng the charact of UAStr(# X,ch #) ; :: according to RELAT_1:def_9 ::_thesis: contradiction
then consider a being set such that
A12: a in dom ch and
A13: {} = ch . a by FUNCT_1:def_3;
ex i, j being Nat st
( a = i & j = S . i & {} = (j -tuples_on X) --> the Element of X ) by A3, A12, A13;
hence contradiction ; ::_thesis: verum
end;
UAStr(# X,ch #) is partial
proof
let n be Nat; :: according to UNIALG_1:def_1,MARGREL1:def_23 ::_thesis: for b1 being Element of bool [:( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #):] holds
( n nin dom the charact of UAStr(# X,ch #) or not b1 = the charact of UAStr(# X,ch #) . n or b1 is homogeneous )
let h be PartFunc of ( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #); ::_thesis: ( n nin dom the charact of UAStr(# X,ch #) or not h = the charact of UAStr(# X,ch #) . n or h is homogeneous )
assume that
A14: n in dom the charact of UAStr(# X,ch #) and
A15: h = the charact of UAStr(# X,ch #) . n ; ::_thesis: h is homogeneous
ex i, j being Nat st
( n = i & j = S . i & h = (j -tuples_on X) --> the Element of X ) by A3, A14, A15;
hence h is homogeneous ; ::_thesis: verum
end;
then reconsider A = UAStr(# X,ch #) as Universal_Algebra by A8, A11;
take A ; ::_thesis: ( the carrier of A = X & signature A = S )
thus the carrier of A = X ; ::_thesis: signature A = S
A16: len ch = len S by A3, FINSEQ_3:29;
now__::_thesis:_for_n_being_Nat_st_n_in_dom_S_holds_
for_h_being_non_empty_homogeneous_PartFunc_of_(_the_carrier_of_A_*),_the_carrier_of_A_st_h_=_the_charact_of_A_._n_holds_
S_._n_=_arity_h
let n be Nat; ::_thesis: ( n in dom S implies for h being non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A st h = the charact of A . n holds
S . n = arity h )
assume A17: n in dom S ; ::_thesis: for h being non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A st h = the charact of A . n holds
S . n = arity h
let h be non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A; ::_thesis: ( h = the charact of A . n implies S . n = arity h )
assume h = the charact of A . n ; ::_thesis: S . n = arity h
then consider i, j being Nat such that
A18: n = i and
A19: j = S . i and
A20: h = (j -tuples_on X) --> the Element of X by A3, A17;
set z = the Element of j -tuples_on X;
A21: dom h = j -tuples_on X by A20, FUNCOP_1:13;
len the Element of j -tuples_on X = j by CARD_1:def_7;
hence S . n = arity h by A18, A19, A21, MARGREL1:def_25; ::_thesis: verum
end;
hence signature A = S by A16, UNIALG_1:def_4; ::_thesis: verum
end;
theorem Th14: :: AOFA_000:14
for S being non empty FinSequence of NAT ex A being Universal_Algebra st
( the carrier of A = NAT & signature A = S & ( for i, j being Nat st i in dom S & j = S . i holds
the charact of A . i = (j -tuples_on NAT) --> i ) )
proof
set X = NAT ;
let S be non empty FinSequence of NAT ; ::_thesis: ex A being Universal_Algebra st
( the carrier of A = NAT & signature A = S & ( for i, j being Nat st i in dom S & j = S . i holds
the charact of A . i = (j -tuples_on NAT) --> i ) )
A1: dom S = Seg (len S) by FINSEQ_1:def_3;
defpred S1[ set , set ] means ex i, j being Element of NAT st
( $1 = i & j = S . i & $2 = (j -tuples_on NAT) --> i );
A2: for y being set st y in dom S holds
ex z being set st S1[y,z]
proof
let y be set ; ::_thesis: ( y in dom S implies ex z being set st S1[y,z] )
assume y in dom S ; ::_thesis: ex z being set st S1[y,z]
then reconsider i = y as Element of NAT ;
reconsider j = S . i as Element of NAT ;
take (j -tuples_on NAT) --> i ; ::_thesis: S1[y,(j -tuples_on NAT) --> i]
take i ; ::_thesis: ex j being Element of NAT st
( y = i & j = S . i & (j -tuples_on NAT) --> i = (j -tuples_on NAT) --> i )
take j ; ::_thesis: ( y = i & j = S . i & (j -tuples_on NAT) --> i = (j -tuples_on NAT) --> i )
thus ( y = i & j = S . i & (j -tuples_on NAT) --> i = (j -tuples_on NAT) --> i ) ; ::_thesis: verum
end;
consider ch being Function such that
A3: ( dom ch = dom S & ( for y being set st y in dom S holds
S1[y,ch . y] ) ) from CLASSES1:sch_1(A2);
reconsider ch = ch as FinSequence by A1, A3, FINSEQ_1:def_2;
rng ch c= PFuncs ((NAT *),NAT)
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( y nin rng ch or not y nin PFuncs ((NAT *),NAT) )
assume y in rng ch ; ::_thesis: not y nin PFuncs ((NAT *),NAT)
then consider xi being set such that
A4: xi in dom ch and
A5: y = ch . xi by FUNCT_1:def_3;
consider i, j being Element of NAT such that
xi = i and
j = S . i and
A6: y = (j -tuples_on NAT) --> i by A3, A4, A5;
A7: dom ((j -tuples_on NAT) --> i) = j -tuples_on NAT by FUNCOP_1:13;
A8: {i} c= NAT by ZFMISC_1:31;
rng ((j -tuples_on NAT) --> i) c= {i} by FUNCOP_1:13;
then rng ((j -tuples_on NAT) --> i) c= NAT by A8, XBOOLE_1:1;
hence not y nin PFuncs ((NAT *),NAT) by A6, A7, PARTFUN1:def_3; ::_thesis: verum
end;
then reconsider ch = ch as PFuncFinSequence of NAT by FINSEQ_1:def_4;
set A = UAStr(# NAT,ch #);
A9: UAStr(# NAT,ch #) is quasi_total
proof
let n be Nat; :: according to UNIALG_1:def_2,MARGREL1:def_24 ::_thesis: for b1 being Element of bool [:( the carrier of UAStr(# NAT,ch #) *), the carrier of UAStr(# NAT,ch #):] holds
( n nin dom the charact of UAStr(# NAT,ch #) or not b1 = the charact of UAStr(# NAT,ch #) . n or b1 is quasi_total )
let h be PartFunc of ( the carrier of UAStr(# NAT,ch #) *), the carrier of UAStr(# NAT,ch #); ::_thesis: ( n nin dom the charact of UAStr(# NAT,ch #) or not h = the charact of UAStr(# NAT,ch #) . n or h is quasi_total )
assume that
A10: n in dom the charact of UAStr(# NAT,ch #) and
A11: h = the charact of UAStr(# NAT,ch #) . n ; ::_thesis: h is quasi_total
ex i, j being Element of NAT st
( n = i & j = S . i & h = (j -tuples_on NAT) --> i ) by A3, A10, A11;
hence h is quasi_total ; ::_thesis: verum
end;
A12: UAStr(# NAT,ch #) is non-empty
proof
thus the charact of UAStr(# NAT,ch #) <> {} by A3; :: according to UNIALG_1:def_3 ::_thesis: the charact of UAStr(# NAT,ch #) is non-empty
assume {} in rng the charact of UAStr(# NAT,ch #) ; :: according to RELAT_1:def_9 ::_thesis: contradiction
then consider a being set such that
A13: a in dom ch and
A14: {} = ch . a by FUNCT_1:def_3;
ex i, j being Element of NAT st
( a = i & j = S . i & {} = (j -tuples_on NAT) --> i ) by A3, A13, A14;
hence contradiction ; ::_thesis: verum
end;
UAStr(# NAT,ch #) is partial
proof
let n be Nat; :: according to UNIALG_1:def_1,MARGREL1:def_23 ::_thesis: for b1 being Element of bool [:( the carrier of UAStr(# NAT,ch #) *), the carrier of UAStr(# NAT,ch #):] holds
( n nin dom the charact of UAStr(# NAT,ch #) or not b1 = the charact of UAStr(# NAT,ch #) . n or b1 is homogeneous )
let h be PartFunc of ( the carrier of UAStr(# NAT,ch #) *), the carrier of UAStr(# NAT,ch #); ::_thesis: ( n nin dom the charact of UAStr(# NAT,ch #) or not h = the charact of UAStr(# NAT,ch #) . n or h is homogeneous )
assume that
A15: n in dom the charact of UAStr(# NAT,ch #) and
A16: h = the charact of UAStr(# NAT,ch #) . n ; ::_thesis: h is homogeneous
ex i, j being Element of NAT st
( n = i & j = S . i & h = (j -tuples_on NAT) --> i ) by A3, A15, A16;
hence h is homogeneous ; ::_thesis: verum
end;
then reconsider A = UAStr(# NAT,ch #) as Universal_Algebra by A9, A12;
take A ; ::_thesis: ( the carrier of A = NAT & signature A = S & ( for i, j being Nat st i in dom S & j = S . i holds
the charact of A . i = (j -tuples_on NAT) --> i ) )
thus the carrier of A = NAT ; ::_thesis: ( signature A = S & ( for i, j being Nat st i in dom S & j = S . i holds
the charact of A . i = (j -tuples_on NAT) --> i ) )
A17: len ch = len S by A3, FINSEQ_3:29;
now__::_thesis:_for_n_being_Nat_st_n_in_dom_S_holds_
for_h_being_non_empty_homogeneous_PartFunc_of_(_the_carrier_of_A_*),_the_carrier_of_A_st_h_=_the_charact_of_A_._n_holds_
S_._n_=_arity_h
let n be Nat; ::_thesis: ( n in dom S implies for h being non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A st h = the charact of A . n holds
S . n = arity h )
assume A18: n in dom S ; ::_thesis: for h being non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A st h = the charact of A . n holds
S . n = arity h
let h be non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A; ::_thesis: ( h = the charact of A . n implies S . n = arity h )
assume h = the charact of A . n ; ::_thesis: S . n = arity h
then consider i, j being Element of NAT such that
A19: n = i and
A20: j = S . i and
A21: h = (j -tuples_on NAT) --> i by A3, A18;
set z = the Element of j -tuples_on NAT;
A22: dom h = j -tuples_on NAT by A21, FUNCOP_1:13;
len the Element of j -tuples_on NAT = j by CARD_1:def_7;
hence S . n = arity h by A19, A20, A22, MARGREL1:def_25; ::_thesis: verum
end;
hence signature A = S by A17, UNIALG_1:def_4; ::_thesis: for i, j being Nat st i in dom S & j = S . i holds
the charact of A . i = (j -tuples_on NAT) --> i
let i, j be Nat; ::_thesis: ( i in dom S & j = S . i implies the charact of A . i = (j -tuples_on NAT) --> i )
assume i in dom S ; ::_thesis: ( not j = S . i or the charact of A . i = (j -tuples_on NAT) --> i )
then ex i1, j being Element of NAT st
( i = i1 & j = S . i1 & ch . i = (j -tuples_on NAT) --> i1 ) by A3;
hence ( not j = S . i or the charact of A . i = (j -tuples_on NAT) --> i ) ; ::_thesis: verum
end;
theorem :: AOFA_000:15
for S being non empty FinSequence of NAT
for i, j being Nat st i in dom S & j = S . i holds
for X being non empty set
for f being Function of (j -tuples_on X),X ex A being Universal_Algebra st
( the carrier of A = X & signature A = S & the charact of A . i = f )
proof
let S be non empty FinSequence of NAT ; ::_thesis: for i, j being Nat st i in dom S & j = S . i holds
for X being non empty set
for f being Function of (j -tuples_on X),X ex A being Universal_Algebra st
( the carrier of A = X & signature A = S & the charact of A . i = f )
let i, j be Nat; ::_thesis: ( i in dom S & j = S . i implies for X being non empty set
for f being Function of (j -tuples_on X),X ex A being Universal_Algebra st
( the carrier of A = X & signature A = S & the charact of A . i = f ) )
reconsider j9 = j as Element of NAT by ORDINAL1:def_12;
assume that
A1: i in dom S and
A2: j = S . i ; ::_thesis: for X being non empty set
for f being Function of (j -tuples_on X),X ex A being Universal_Algebra st
( the carrier of A = X & signature A = S & the charact of A . i = f )
let X be non empty set ; ::_thesis: for f being Function of (j -tuples_on X),X ex A being Universal_Algebra st
( the carrier of A = X & signature A = S & the charact of A . i = f )
consider A0 being Universal_Algebra such that
A3: the carrier of A0 = X and
A4: signature A0 = S by Th13;
let f be Function of (j -tuples_on X),X; ::_thesis: ex A being Universal_Algebra st
( the carrier of A = X & signature A = S & the charact of A . i = f )
j9 -tuples_on X c= X * by FINSEQ_2:134;
then reconsider f0 = f as PartFunc of (X *),X by RELSET_1:7;
set z = the Element of j -tuples_on X;
A5: dom f0 = j -tuples_on X by FUNCT_2:def_1;
f0 is homogeneous
proof
thus dom f0 is with_common_domain by A5; :: according to MARGREL1:def_21 ::_thesis: verum
end;
then reconsider f0 = f0 as non empty homogeneous PartFunc of (X *),X ;
A6: len the Element of j -tuples_on X = j by CARD_1:def_7;
then A7: arity f0 = j by A5, MARGREL1:def_25;
set ch = the charact of A0 +* (i,f0);
f0 in PFuncs ((X *),X) by PARTFUN1:45;
then A8: {f0} c= PFuncs ((X *),X) by ZFMISC_1:31;
A9: rng ( the charact of A0 +* (i,f0)) c= (rng the charact of A0) \/ {f0} by FUNCT_7:100;
(rng the charact of A0) \/ {f0} c= PFuncs ((X *),X) by A3, A8, XBOOLE_1:8;
then rng ( the charact of A0 +* (i,f0)) c= PFuncs ((X *),X) by A9, XBOOLE_1:1;
then reconsider ch = the charact of A0 +* (i,f0) as FinSequence of PFuncs ((X *),X) by FINSEQ_1:def_4;
A10: dom ch = dom the charact of A0 by FUNCT_7:30;
set A = UAStr(# X,ch #);
A11: UAStr(# X,ch #) is quasi_total
proof
let n be Nat; :: according to UNIALG_1:def_2,MARGREL1:def_24 ::_thesis: for b1 being Element of bool [:( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #):] holds
( n nin dom the charact of UAStr(# X,ch #) or not b1 = the charact of UAStr(# X,ch #) . n or b1 is quasi_total )
let h be PartFunc of ( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #); ::_thesis: ( n nin dom the charact of UAStr(# X,ch #) or not h = the charact of UAStr(# X,ch #) . n or h is quasi_total )
assume that
A12: n in dom the charact of UAStr(# X,ch #) and
A13: h = the charact of UAStr(# X,ch #) . n ; ::_thesis: h is quasi_total
A14: ( n = i implies h = f0 ) by A10, A12, A13, FUNCT_7:31;
( n <> i implies h = the charact of A0 . n ) by A13, FUNCT_7:32;
hence h is quasi_total by A3, A5, A7, A10, A12, A14, COMPUT_1:22, MARGREL1:def_24; ::_thesis: verum
end;
A15: UAStr(# X,ch #) is non-empty
proof
thus the charact of UAStr(# X,ch #) <> {} by A10; :: according to UNIALG_1:def_3 ::_thesis: the charact of UAStr(# X,ch #) is non-empty
assume {} in rng the charact of UAStr(# X,ch #) ; :: according to RELAT_1:def_9 ::_thesis: contradiction
then consider a being set such that
A16: a in dom ch and
A17: {} = ch . a by FUNCT_1:def_3;
reconsider a = a as Element of NAT by A16;
( a <> i implies {} = the charact of A0 . a ) by A17, FUNCT_7:32;
hence contradiction by A10, A16, A17, FUNCT_7:31; ::_thesis: verum
end;
UAStr(# X,ch #) is partial
proof
let n be Nat; :: according to UNIALG_1:def_1,MARGREL1:def_23 ::_thesis: for b1 being Element of bool [:( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #):] holds
( n nin dom the charact of UAStr(# X,ch #) or not b1 = the charact of UAStr(# X,ch #) . n or b1 is homogeneous )
let h be PartFunc of ( the carrier of UAStr(# X,ch #) *), the carrier of UAStr(# X,ch #); ::_thesis: ( n nin dom the charact of UAStr(# X,ch #) or not h = the charact of UAStr(# X,ch #) . n or h is homogeneous )
assume that
A18: n in dom the charact of UAStr(# X,ch #) and
A19: h = the charact of UAStr(# X,ch #) . n ; ::_thesis: h is homogeneous
( n <> i implies h = the charact of A0 . n ) by A19, FUNCT_7:32;
hence h is homogeneous by A10, A18, A19, FUNCT_7:31; ::_thesis: verum
end;
then reconsider A = UAStr(# X,ch #) as Universal_Algebra by A11, A15;
take A ; ::_thesis: ( the carrier of A = X & signature A = S & the charact of A . i = f )
thus the carrier of A = X ; ::_thesis: ( signature A = S & the charact of A . i = f )
A20: len S = len the charact of A0 by A4, UNIALG_1:def_4;
then A21: dom S = dom the charact of A0 by FINSEQ_3:29;
A22: len S = len the charact of A by A10, A20, FINSEQ_3:29;
now__::_thesis:_for_n_being_Nat_st_n_in_dom_S_holds_
for_h_being_non_empty_homogeneous_PartFunc_of_(_the_carrier_of_A_*),_the_carrier_of_A_st_h_=_the_charact_of_A_._n_holds_
S_._n_=_arity_h
let n be Nat; ::_thesis: ( n in dom S implies for h being non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A st h = the charact of A . n holds
S . n = arity h )
assume A23: n in dom S ; ::_thesis: for h being non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A st h = the charact of A . n holds
S . n = arity h
let h be non empty homogeneous PartFunc of ( the carrier of A *), the carrier of A; ::_thesis: ( h = the charact of A . n implies S . n = arity h )
assume A24: h = the charact of A . n ; ::_thesis: S . n = arity h
then A25: ( n = i implies h = f0 ) by A21, A23, FUNCT_7:31;
( n <> i implies h = the charact of A0 . n ) by A24, FUNCT_7:32;
hence S . n = arity h by A2, A3, A4, A5, A6, A23, A25, MARGREL1:def_25, UNIALG_1:def_4; ::_thesis: verum
end;
hence signature A = S by A22, UNIALG_1:def_4; ::_thesis: the charact of A . i = f
thus the charact of A . i = f by A1, A21, FUNCT_7:31; ::_thesis: verum
end;
registration
let f be non empty FinSequence of NAT ;
let D be non empty disjoint_with_NAT set ;
cluster -> Relation-like Function-like for Element of the carrier of (FreeUnivAlgNSG (f,D));
coherence
for b1 being Element of (FreeUnivAlgNSG (f,D)) holds
( b1 is Relation-like & b1 is Function-like ) ;
end;
registration
let f be non empty FinSequence of NAT ;
let D be non empty disjoint_with_NAT set ;
cluster -> DecoratedTree-like for Element of the carrier of (FreeUnivAlgNSG (f,D));
coherence
for b1 being Element of (FreeUnivAlgNSG (f,D)) holds b1 is DecoratedTree-like ;
cluster -> DTree-yielding for FinSequence of the carrier of (FreeUnivAlgNSG (f,D));
coherence
for b1 being FinSequence of (FreeUnivAlgNSG (f,D)) holds b1 is DTree-yielding ;
end;
theorem Th16: :: AOFA_000:16
for G being non empty DTConstrStr
for t being set holds
( not t in TS G or ex d being Symbol of G st
( d in Terminals G & t = root-tree d ) or ex o being Symbol of G ex p being FinSequence of TS G st
( o ==> roots p & t = o -tree p ) )
proof
let G be non empty DTConstrStr ; ::_thesis: for t being set holds
( not t in TS G or ex d being Symbol of G st
( d in Terminals G & t = root-tree d ) or ex o being Symbol of G ex p being FinSequence of TS G st
( o ==> roots p & t = o -tree p ) )
let t be set ; ::_thesis: ( not t in TS G or ex d being Symbol of G st
( d in Terminals G & t = root-tree d ) or ex o being Symbol of G ex p being FinSequence of TS G st
( o ==> roots p & t = o -tree p ) )
assume that
A1: t in TS G and
A2: for d being Symbol of G holds
( not d in Terminals G or not t = root-tree d ) and
A3: for o being Symbol of G
for p being FinSequence of TS G holds
( not o ==> roots p or not t = o -tree p ) ; ::_thesis: contradiction
A4: (TS G) \ {t} c= TS G by XBOOLE_1:36;
reconsider Y = (TS G) \ {t} as Subset of (FinTrees the carrier of G) ;
A5: now__::_thesis:_for_d_being_Symbol_of_G_st_d_in_Terminals_G_holds_
root-tree_d_in_Y
let d be Symbol of G; ::_thesis: ( d in Terminals G implies root-tree d in Y )
assume A6: d in Terminals G ; ::_thesis: root-tree d in Y
then A7: root-tree d in TS G by DTCONSTR:def_1;
root-tree d <> t by A2, A6;
hence root-tree d in Y by A7, ZFMISC_1:56; ::_thesis: verum
end;
now__::_thesis:_for_o_being_Symbol_of_G
for_p_being_FinSequence_of_Y_st_o_==>_roots_p_holds_
o_-tree_p_in_Y
let o be Symbol of G; ::_thesis: for p being FinSequence of Y st o ==> roots p holds
o -tree p in Y
let p be FinSequence of Y; ::_thesis: ( o ==> roots p implies o -tree p in Y )
rng p c= Y by FINSEQ_1:def_4;
then rng p c= TS G by A4, XBOOLE_1:1;
then reconsider q = p as FinSequence of TS G by FINSEQ_1:def_4;
assume A8: o ==> roots p ; ::_thesis: o -tree p in Y
then A9: o -tree q in TS G by DTCONSTR:def_1;
t <> o -tree q by A3, A8;
hence o -tree p in Y by A9, ZFMISC_1:56; ::_thesis: verum
end;
then TS G c= Y by A5, DTCONSTR:def_1;
then t nin {t} by A1, XBOOLE_0:def_5;
hence contradiction by TARSKI:def_1; ::_thesis: verum
end;
theorem Th17: :: AOFA_000:17
for X being non empty disjoint_with_NAT set
for S being non empty FinSequence of NAT
for i being Nat st i in dom S holds
for p being FinSequence of (FreeUnivAlgNSG (S,X)) st len p = S . i holds
(Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = i -tree p
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for S being non empty FinSequence of NAT
for i being Nat st i in dom S holds
for p being FinSequence of (FreeUnivAlgNSG (S,X)) st len p = S . i holds
(Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = i -tree p
let S be non empty FinSequence of NAT ; ::_thesis: for i being Nat st i in dom S holds
for p being FinSequence of (FreeUnivAlgNSG (S,X)) st len p = S . i holds
(Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = i -tree p
reconsider S9 = S as non empty FinSequence of omega ;
set G = DTConUA (S,X);
set A = FreeUnivAlgNSG (S,X);
let i be Nat; ::_thesis: ( i in dom S implies for p being FinSequence of (FreeUnivAlgNSG (S,X)) st len p = S . i holds
(Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = i -tree p )
assume A1: i in dom S ; ::_thesis: for p being FinSequence of (FreeUnivAlgNSG (S,X)) st len p = S . i holds
(Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = i -tree p
then A2: S9 /. i = S . i by PARTFUN1:def_6;
let p be FinSequence of (FreeUnivAlgNSG (S,X)); ::_thesis: ( len p = S . i implies (Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = i -tree p )
assume len p = S . i ; ::_thesis: (Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = i -tree p
then p is Element of (S9 /. i) -tuples_on (TS (DTConUA (S,X))) by A2, FINSEQ_2:92;
then p in (S9 /. i) -tuples_on (TS (DTConUA (S,X))) ;
then A3: p in dom (FreeOpNSG (i,S,X)) by A1, FREEALG:def_10;
len the charact of (FreeUnivAlgNSG (S,X)) = len S by FREEALG:def_11;
then dom the charact of (FreeUnivAlgNSG (S,X)) = dom S by FINSEQ_3:29;
then In (i,(dom the charact of (FreeUnivAlgNSG (S,X)))) = i by A1, FUNCT_7:def_1;
hence (Den ((In (i,(dom the charact of (FreeUnivAlgNSG (S,X))))),(FreeUnivAlgNSG (S,X)))) . p = (FreeOpNSG (i,S,X)) . p by A1, FREEALG:def_11
.= (Sym (i,S,X)) -tree p by A1, A3, FREEALG:def_10
.= i -tree p by A1, FREEALG:def_9 ;
::_thesis: verum
end;
definition
let A be non-empty UAStr ;
let B be Subset of A;
let n be Nat;
funcB |^ n -> Subset of A means :Def8: :: AOFA_000:def 8
ex F being Function of NAT,(bool the carrier of A) st
( it = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) );
existence
ex b1 being Subset of A ex F being Function of NAT,(bool the carrier of A) st
( b1 = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) )
proof
defpred S1[ set , set , set ] means $3 = $2 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= $2 ) } ;
A1: for n being Element of NAT
for B1 being Subset of A ex B2 being Subset of A st S1[n,B1,B2]
proof
let n be Element of NAT ; ::_thesis: for B1 being Subset of A ex B2 being Subset of A st S1[n,B1,B2]
let B1 be Subset of A; ::_thesis: ex B2 being Subset of A st S1[n,B1,B2]
set B2 = B1 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B1 ) } ;
B1 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B1 ) } c= the carrier of A
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin B1 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B1 ) } or not x nin the carrier of A )
assume that
A2: x in B1 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B1 ) } and
A3: not x in the carrier of A ; ::_thesis: contradiction
( x in B1 implies x in the carrier of A ) ;
then x in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B1 ) } by A2, A3, XBOOLE_0:def_3;
then consider o being Element of dom the charact of A, p being Element of the carrier of A * such that
A4: x = (Den (o,A)) . p and
A5: p in dom (Den (o,A)) and
rng p c= B1 ;
x in rng (Den (o,A)) by A4, A5, FUNCT_1:def_3;
hence contradiction by A3; ::_thesis: verum
end;
then reconsider B2 = B1 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B1 ) } as Subset of A ;
take B2 ; ::_thesis: S1[n,B1,B2]
thus S1[n,B1,B2] ; ::_thesis: verum
end;
consider F being Function of NAT,(bool the carrier of A) such that
A6: ( F . 0 = B & ( for n being Element of NAT holds S1[n,F . n,F . (n + 1)] ) ) from RECDEF_1:sch_2(A1);
reconsider n9 = n as Element of NAT by ORDINAL1:def_12;
take a = F . n9; ::_thesis: ex F being Function of NAT,(bool the carrier of A) st
( a = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) )
take F ; ::_thesis: ( a = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) )
thus ( a = F . n & F . 0 = B ) by A6; ::_thesis: for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) }
let n be Nat; ::_thesis: F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) }
n in NAT by ORDINAL1:def_12;
hence F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } by A6; ::_thesis: verum
end;
uniqueness
for b1, b2 being Subset of A st ex F being Function of NAT,(bool the carrier of A) st
( b1 = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) ) & ex F being Function of NAT,(bool the carrier of A) st
( b2 = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) ) holds
b1 = b2
proof
let C1, C2 be Subset of A; ::_thesis: ( ex F being Function of NAT,(bool the carrier of A) st
( C1 = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) ) & ex F being Function of NAT,(bool the carrier of A) st
( C2 = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) ) implies C1 = C2 )
deffunc H1( set , set ) -> set = $2 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= $2 ) } ;
given F1 being Function of NAT,(bool the carrier of A) such that A7: C1 = F1 . n and
A8: F1 . 0 = B and
A9: for n being Nat holds F1 . (n + 1) = H1(n,F1 . n) ; ::_thesis: ( for F being Function of NAT,(bool the carrier of A) holds
( not C2 = F . n or not F . 0 = B or ex n being Nat st not F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) or C1 = C2 )
given F2 being Function of NAT,(bool the carrier of A) such that A10: C2 = F2 . n and
A11: F2 . 0 = B and
A12: for n being Nat holds F2 . (n + 1) = H1(n,F2 . n) ; ::_thesis: C1 = C2
A13: dom F1 = NAT by FUNCT_2:def_1;
A14: F1 . 0 = B by A8;
A15: for n being Nat holds F1 . (n + 1) = H1(n,F1 . n) by A9;
A16: dom F2 = NAT by FUNCT_2:def_1;
A17: F2 . 0 = B by A11;
A18: for n being Nat holds F2 . (n + 1) = H1(n,F2 . n) by A12;
F1 = F2 from NAT_1:sch_15(A13, A14, A15, A16, A17, A18);
hence C1 = C2 by A7, A10; ::_thesis: verum
end;
end;
:: deftheorem Def8 defines |^ AOFA_000:def_8_:_
for A being non-empty UAStr
for B being Subset of A
for n being Nat
for b4 being Subset of A holds
( b4 = B |^ n iff ex F being Function of NAT,(bool the carrier of A) st
( b4 = F . n & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) ) );
theorem Th18: :: AOFA_000:18
for A being Universal_Algebra
for B being Subset of A holds B |^ 0 = B
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A holds B |^ 0 = B
let B be Subset of A; ::_thesis: B |^ 0 = B
ex F being Function of NAT,(bool the carrier of A) st
( B |^ 0 = F . 0 & F . 0 = B & ( for n being Nat holds F . (n + 1) = (F . n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= F . n ) } ) ) by Def8;
hence B |^ 0 = B ; ::_thesis: verum
end;
theorem Th19: :: AOFA_000:19
for A being Universal_Algebra
for B being Subset of A
for n being Nat holds B |^ (n + 1) = (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) }
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A
for n being Nat holds B |^ (n + 1) = (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) }
let B be Subset of A; ::_thesis: for n being Nat holds B |^ (n + 1) = (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) }
let n be Nat; ::_thesis: B |^ (n + 1) = (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) }
deffunc H1( set , set ) -> set = $2 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= $2 ) } ;
consider F1 being Function of NAT,(bool the carrier of A) such that
A1: B |^ n = F1 . n and
A2: F1 . 0 = B and
A3: for n being Nat holds F1 . (n + 1) = H1(n,F1 . n) by Def8;
consider F2 being Function of NAT,(bool the carrier of A) such that
A4: B |^ (n + 1) = F2 . (n + 1) and
A5: F2 . 0 = B and
A6: for n being Nat holds F2 . (n + 1) = H1(n,F2 . n) by Def8;
A7: dom F1 = NAT by FUNCT_2:def_1;
A8: F1 . 0 = B by A2;
A9: for n being Nat holds F1 . (n + 1) = H1(n,F1 . n) by A3;
A10: dom F2 = NAT by FUNCT_2:def_1;
A11: F2 . 0 = B by A5;
A12: for n being Nat holds F2 . (n + 1) = H1(n,F2 . n) by A6;
F1 = F2 from NAT_1:sch_15(A7, A8, A9, A10, A11, A12);
hence B |^ (n + 1) = (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by A1, A3, A4; ::_thesis: verum
end;
theorem Th20: :: AOFA_000:20
for A being Universal_Algebra
for B being Subset of A
for n being Nat
for x being set holds
( x in B |^ (n + 1) iff ( x in B |^ n or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A
for n being Nat
for x being set holds
( x in B |^ (n + 1) iff ( x in B |^ n or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
let B be Subset of A; ::_thesis: for n being Nat
for x being set holds
( x in B |^ (n + 1) iff ( x in B |^ n or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
let n be Nat; ::_thesis: for x being set holds
( x in B |^ (n + 1) iff ( x in B |^ n or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
set Z = { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } ;
let x be set ; ::_thesis: ( x in B |^ (n + 1) iff ( x in B |^ n or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
B |^ (n + 1) = (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by Th19;
then ( x in B |^ (n + 1) iff ( x in B |^ n or x in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } ) ) by XBOOLE_0:def_3;
hence ( x in B |^ (n + 1) iff ( x in B |^ n or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) ) ; ::_thesis: verum
end;
theorem Th21: :: AOFA_000:21
for A being Universal_Algebra
for B being Subset of A
for n, m being Nat st n <= m holds
B |^ n c= B |^ m
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A
for n, m being Nat st n <= m holds
B |^ n c= B |^ m
let B be Subset of A; ::_thesis: for n, m being Nat st n <= m holds
B |^ n c= B |^ m
let n, m be Nat; ::_thesis: ( n <= m implies B |^ n c= B |^ m )
assume n <= m ; ::_thesis: B |^ n c= B |^ m
then A1: ex i being Nat st m = n + i by NAT_1:10;
defpred S1[ Nat] means B |^ n c= B |^ (n + $1);
A2: S1[ 0 ] ;
A3: now__::_thesis:_for_i_being_Nat_st_S1[i]_holds_
S1[i_+_1]
let i be Nat; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A4: S1[i] ; ::_thesis: S1[i + 1]
deffunc H1( set , set ) -> set = $2 \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= $2 ) } ;
B |^ ((n + i) + 1) = H1(n,B |^ (n + i)) by Th19;
then B |^ (n + i) c= B |^ (n + (i + 1)) by XBOOLE_1:7;
hence S1[i + 1] by A4, XBOOLE_1:1; ::_thesis: verum
end;
for i being Nat holds S1[i] from NAT_1:sch_2(A2, A3);
hence B |^ n c= B |^ m by A1; ::_thesis: verum
end;
theorem Th22: :: AOFA_000:22
for A being Universal_Algebra
for B1, B2 being Subset of A st B1 c= B2 holds
for n being Nat holds B1 |^ n c= B2 |^ n
proof
let A be Universal_Algebra; ::_thesis: for B1, B2 being Subset of A st B1 c= B2 holds
for n being Nat holds B1 |^ n c= B2 |^ n
let B1, B2 be Subset of A; ::_thesis: ( B1 c= B2 implies for n being Nat holds B1 |^ n c= B2 |^ n )
assume A1: B1 c= B2 ; ::_thesis: for n being Nat holds B1 |^ n c= B2 |^ n
defpred S1[ Nat] means B1 |^ $1 c= B2 |^ $1;
B1 |^ 0 = B1 by Th18;
then A2: S1[ 0 ] by A1, Th18;
A3: now__::_thesis:_for_n_being_Nat_st_S1[n]_holds_
S1[n_+_1]
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A4: S1[n] ; ::_thesis: S1[n + 1]
thus S1[n + 1] ::_thesis: verum
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin B1 |^ (n + 1) or not x nin B2 |^ (n + 1) )
assume that
A5: x in B1 |^ (n + 1) and
A6: x nin B2 |^ (n + 1) ; ::_thesis: contradiction
reconsider a = x as Element of A by A5;
a nin B1 |^ n by A4, A6, Th20;
then consider o being Element of dom the charact of A, p being Element of the carrier of A * such that
A7: a = (Den (o,A)) . p and
A8: p in dom (Den (o,A)) and
A9: rng p c= B1 |^ n by A5, Th20;
rng p c= B2 |^ n by A4, A9, XBOOLE_1:1;
hence contradiction by A6, A7, A8, Th20; ::_thesis: verum
end;
end;
for n being Nat holds S1[n] from NAT_1:sch_2(A2, A3);
hence for n being Nat holds B1 |^ n c= B2 |^ n ; ::_thesis: verum
end;
theorem Th23: :: AOFA_000:23
for A being Universal_Algebra
for B being Subset of A
for n being Nat
for x being set holds
( x in B |^ (n + 1) iff ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A
for n being Nat
for x being set holds
( x in B |^ (n + 1) iff ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
let B be Subset of A; ::_thesis: for n being Nat
for x being set holds
( x in B |^ (n + 1) iff ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
defpred S1[ Nat] means for x being set holds
( not x in B |^ ($1 + 1) or x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ $1 ) );
A1: B |^ 0 = B by Th18;
then A2: S1[ 0 ] by Th20;
A3: now__::_thesis:_for_n_being_Nat_st_S1[n]_holds_
S1[n_+_1]
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A4: S1[n] ; ::_thesis: S1[n + 1]
thus S1[n + 1] ::_thesis: verum
proof
let x be set ; ::_thesis: ( not x in B |^ ((n + 1) + 1) or x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) ) )
assume x in B |^ ((n + 1) + 1) ; ::_thesis: ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) ) )
then A5: ( x in B |^ (n + 1) or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) ) ) by Th20;
now__::_thesis:_(_ex_o_being_Element_of_dom_the_charact_of_A_ex_p_being_Element_of_the_carrier_of_A_*_st_
(_x_=_(Den_(o,A))_._p_&_p_in_dom_(Den_(o,A))_&_rng_p_c=_B_|^_n_)_implies_ex_o_being_Element_of_dom_the_charact_of_A_ex_p_being_Element_of_the_carrier_of_A_*_st_
(_x_=_(Den_(o,A))_._p_&_p_in_dom_(Den_(o,A))_&_rng_p_c=_B_|^_(n_+_1)_)_)
given o being Element of dom the charact of A, p being Element of the carrier of A * such that A6: x = (Den (o,A)) . p and
A7: p in dom (Den (o,A)) and
A8: rng p c= B |^ n ; ::_thesis: ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) )
take o = o; ::_thesis: ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) )
take p = p; ::_thesis: ( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) )
n <= n + 1 by NAT_1:13;
then B |^ n c= B |^ (n + 1) by Th21;
hence ( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) ) by A6, A7, A8, XBOOLE_1:1; ::_thesis: verum
end;
hence ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ (n + 1) ) ) by A4, A5; ::_thesis: verum
end;
end;
A9: for n being Nat holds S1[n] from NAT_1:sch_2(A2, A3);
let n be Nat; ::_thesis: for x being set holds
( x in B |^ (n + 1) iff ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
let x be set ; ::_thesis: ( x in B |^ (n + 1) iff ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) )
B c= B |^ n by A1, Th21;
hence ( x in B |^ (n + 1) iff ( x in B or ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( x = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= B |^ n ) ) ) by A9, Th20; ::_thesis: verum
end;
scheme :: AOFA_000:sch 1
MaxVal{ F1() -> non empty set , F2() -> set , P1[ set , set ] } :
ex n being Nat st
for x being Element of F1() st x in F2() holds
P1[x,n]
provided
A1: F2() is finite and
A2: for x being Element of F1() st x in F2() holds
ex n being Nat st P1[x,n] and
A3: for x being Element of F1()
for n, m being Nat st P1[x,n] & n <= m holds
P1[x,m]
proof
A4: for x being set st x in F1() /\ F2() holds
ex y being set st
( y in NAT & P1[x,y] )
proof
let x be set ; ::_thesis: ( x in F1() /\ F2() implies ex y being set st
( y in NAT & P1[x,y] ) )
assume A5: x in F1() /\ F2() ; ::_thesis: ex y being set st
( y in NAT & P1[x,y] )
then reconsider x = x as Element of F1() by XBOOLE_0:def_4;
x in F2() by A5, XBOOLE_0:def_4;
then consider n being Nat such that
A6: P1[x,n] by A2;
n is Element of NAT by ORDINAL1:def_12;
hence ex y being set st
( y in NAT & P1[x,y] ) by A6; ::_thesis: verum
end;
consider f being Function such that
A7: ( dom f = F1() /\ F2() & rng f c= NAT ) and
A8: for x being set st x in F1() /\ F2() holds
P1[x,f . x] from FUNCT_1:sch_5(A4);
reconsider Z = rng f as finite Subset of NAT by A1, A7, FINSET_1:8;
consider n being Nat such that
A9: for i being Nat st i in Z holds
i <= n by STIRL2_1:56;
take n ; ::_thesis: for x being Element of F1() st x in F2() holds
P1[x,n]
let x be Element of F1(); ::_thesis: ( x in F2() implies P1[x,n] )
assume x in F2() ; ::_thesis: P1[x,n]
then A10: x in F1() /\ F2() by XBOOLE_0:def_4;
then A11: f . x in rng f by A7, FUNCT_1:def_3;
then reconsider i = f . x as Element of NAT by A7;
i <= n by A9, A11;
hence P1[x,n] by A3, A8, A10; ::_thesis: verum
end;
theorem Th24: :: AOFA_000:24
for A being Universal_Algebra
for B being Subset of A ex C being Subset of A st
( C = union { (B |^ n) where n is Element of NAT : verum } & C is opers_closed )
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A ex C being Subset of A st
( C = union { (B |^ n) where n is Element of NAT : verum } & C is opers_closed )
let B be Subset of A; ::_thesis: ex C being Subset of A st
( C = union { (B |^ n) where n is Element of NAT : verum } & C is opers_closed )
set X = { (B |^ n) where n is Element of NAT : verum } ;
set C = union { (B |^ n) where n is Element of NAT : verum } ;
A1: union (bool the carrier of A) = the carrier of A by ZFMISC_1:81;
{ (B |^ n) where n is Element of NAT : verum } c= bool the carrier of A
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin { (B |^ n) where n is Element of NAT : verum } or not x nin bool the carrier of A )
assume x in { (B |^ n) where n is Element of NAT : verum } ; ::_thesis: not x nin bool the carrier of A
then ex n being Element of NAT st x = B |^ n ;
hence not x nin bool the carrier of A ; ::_thesis: verum
end;
then reconsider C = union { (B |^ n) where n is Element of NAT : verum } as Subset of A by A1, ZFMISC_1:77;
take C ; ::_thesis: ( C = union { (B |^ n) where n is Element of NAT : verum } & C is opers_closed )
thus C = union { (B |^ n) where n is Element of NAT : verum } ; ::_thesis: C is opers_closed
let o be Element of Operations A; :: according to UNIALG_2:def_4 ::_thesis: C is_closed_on o
consider s being set such that
A2: s in dom the charact of A and
A3: o = the charact of A . s by FUNCT_1:def_3;
reconsider s = s as OperSymbol of A by A2;
A4: dom o = (arity o) -tuples_on the carrier of A by MARGREL1:22;
let p be FinSequence of C; :: according to UNIALG_2:def_3 ::_thesis: ( not len p = arity o or not o . p nin C )
assume len p = arity o ; ::_thesis: not o . p nin C
then p is Element of dom (Den (s,A)) by A3, A4, FINSEQ_2:92;
then A5: p in dom (Den (s,A)) by A3, A4;
defpred S1[ set , Nat] means $1 in B |^ $2;
A6: rng p is finite ;
A7: for x being Element of A st x in rng p holds
ex n being Nat st S1[x,n]
proof
let x be Element of A; ::_thesis: ( x in rng p implies ex n being Nat st S1[x,n] )
assume A8: x in rng p ; ::_thesis: ex n being Nat st S1[x,n]
rng p c= C by FINSEQ_1:def_4;
then consider Y being set such that
A9: x in Y and
A10: Y in { (B |^ n) where n is Element of NAT : verum } by A8, TARSKI:def_4;
consider n being Element of NAT such that
A11: Y = B |^ n by A10;
take n ; ::_thesis: S1[x,n]
thus S1[x,n] by A9, A11; ::_thesis: verum
end;
A12: for x being Element of A
for n, m being Nat st S1[x,n] & n <= m holds
S1[x,m]
proof
let x be Element of A; ::_thesis: for n, m being Nat st S1[x,n] & n <= m holds
S1[x,m]
let n, m be Nat; ::_thesis: ( S1[x,n] & n <= m implies S1[x,m] )
assume A13: S1[x,n] ; ::_thesis: ( not n <= m or S1[x,m] )
assume n <= m ; ::_thesis: S1[x,m]
then B |^ n c= B |^ m by Th21;
hence S1[x,m] by A13; ::_thesis: verum
end;
consider n being Nat such that
A14: for x being Element of A st x in rng p holds
S1[x,n] from AOFA_000:sch_1(A6, A7, A12);
rng p c= B |^ n
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin rng p or not x nin B |^ n )
assume x in rng p ; ::_thesis: not x nin B |^ n
hence not x nin B |^ n by A14; ::_thesis: verum
end;
then (Den (s,A)) . p in { ((Den (a,A)) . r) where a is Element of dom the charact of A, r is Element of the carrier of A * : ( r in dom (Den (a,A)) & rng r c= B |^ n ) } by A5;
then ( o . p in (B |^ n) \/ { ((Den (a,A)) . r) where a is Element of dom the charact of A, r is Element of the carrier of A * : ( r in dom (Den (a,A)) & rng r c= B |^ n ) } & n + 1 in NAT ) by A3, XBOOLE_0:def_3;
then A15: o . p in B |^ (n + 1) by Th19;
B |^ (n + 1) in { (B |^ n) where n is Element of NAT : verum } ;
hence not o . p nin C by A15, TARSKI:def_4; ::_thesis: verum
end;
theorem Th25: :: AOFA_000:25
for A being Universal_Algebra
for B, C being Subset of A st C is opers_closed & B c= C holds
union { (B |^ n) where n is Element of NAT : verum } c= C
proof
let A be Universal_Algebra; ::_thesis: for B, C being Subset of A st C is opers_closed & B c= C holds
union { (B |^ n) where n is Element of NAT : verum } c= C
let B, C be Subset of A; ::_thesis: ( C is opers_closed & B c= C implies union { (B |^ n) where n is Element of NAT : verum } c= C )
assume A1: C is opers_closed ; ::_thesis: ( not B c= C or union { (B |^ n) where n is Element of NAT : verum } c= C )
assume A2: B c= C ; ::_thesis: union { (B |^ n) where n is Element of NAT : verum } c= C
let z be set ; :: according to TARSKI:def_3 ::_thesis: ( z nin union { (B |^ n) where n is Element of NAT : verum } or not z nin C )
assume z in union { (B |^ n) where n is Element of NAT : verum } ; ::_thesis: not z nin C
then consider Y being set such that
A3: z in Y and
A4: Y in { (B |^ n) where n is Element of NAT : verum } by TARSKI:def_4;
consider n being Element of NAT such that
A5: Y = B |^ n by A4;
defpred S1[ Nat] means B |^ $1 c= C;
A6: S1[ 0 ] by A2, Th18;
A7: now__::_thesis:_for_n_being_Nat_st_S1[n]_holds_
S1[n_+_1]
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A8: S1[n] ; ::_thesis: S1[n + 1]
thus S1[n + 1] ::_thesis: verum
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin B |^ (n + 1) or not x nin C )
assume that
A9: x in B |^ (n + 1) and
A10: x nin C ; ::_thesis: contradiction
x in (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by A9, Th19;
then ( x in B |^ n or x in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } ) by XBOOLE_0:def_3;
then consider o being Element of dom the charact of A, p being Element of the carrier of A * such that
A11: x = (Den (o,A)) . p and
A12: p in dom (Den (o,A)) and
A13: rng p c= B |^ n by A8, A10;
rng p c= C by A8, A13, XBOOLE_1:1;
then reconsider p = p as FinSequence of C by FINSEQ_1:def_4;
reconsider oo = Den (o,A) as Element of Operations A ;
A14: len p = arity oo by A12, MARGREL1:def_25;
C is_closed_on oo by A1, UNIALG_2:def_4;
hence contradiction by A10, A11, A14, UNIALG_2:def_3; ::_thesis: verum
end;
end;
for n being Nat holds S1[n] from NAT_1:sch_2(A6, A7);
then S1[n] ;
hence not z nin C by A3, A5; ::_thesis: verum
end;
definition
let A be Universal_Algebra;
func Generators A -> Subset of A equals :: AOFA_000:def 9
the carrier of A \ (union { (rng o) where o is Element of Operations A : verum } );
coherence
the carrier of A \ (union { (rng o) where o is Element of Operations A : verum } ) is Subset of A ;
end;
:: deftheorem defines Generators AOFA_000:def_9_:_
for A being Universal_Algebra holds Generators A = the carrier of A \ (union { (rng o) where o is Element of Operations A : verum } );
theorem Th26: :: AOFA_000:26
for A being Universal_Algebra
for a being Element of A holds
( a in Generators A iff for o being Element of Operations A holds not a in rng o )
proof
let A be Universal_Algebra; ::_thesis: for a being Element of A holds
( a in Generators A iff for o being Element of Operations A holds not a in rng o )
set Z = { (rng o) where o is Element of Operations A : verum } ;
let a be Element of A; ::_thesis: ( a in Generators A iff for o being Element of Operations A holds not a in rng o )
hereby ::_thesis: ( ( for o being Element of Operations A holds not a in rng o ) implies a in Generators A )
assume a in Generators A ; ::_thesis: for o being Element of Operations A holds not a in rng o
then A1: a nin union { (rng o) where o is Element of Operations A : verum } by XBOOLE_0:def_5;
given o being Element of Operations A such that A2: a in rng o ; ::_thesis: contradiction
rng o in { (rng o) where o is Element of Operations A : verum } ;
hence contradiction by A1, A2, TARSKI:def_4; ::_thesis: verum
end;
assume A3: for o being Element of Operations A holds not a in rng o ; ::_thesis: a in Generators A
assume a nin Generators A ; ::_thesis: contradiction
then a in union { (rng o) where o is Element of Operations A : verum } by XBOOLE_0:def_5;
then consider X being set such that
A4: a in X and
A5: X in { (rng o) where o is Element of Operations A : verum } by TARSKI:def_4;
ex o being Element of Operations A st X = rng o by A5;
hence contradiction by A3, A4; ::_thesis: verum
end;
theorem :: AOFA_000:27
for A being Universal_Algebra
for B being Subset of A st B is opers_closed holds
Constants A c= B
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A st B is opers_closed holds
Constants A c= B
let B be Subset of A; ::_thesis: ( B is opers_closed implies Constants A c= B )
assume A1: B is opers_closed ; ::_thesis: Constants A c= B
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin Constants A or not x nin B )
assume x in Constants A ; ::_thesis: not x nin B
then consider a being Element of A such that
A2: x = a and
A3: ex o being Element of Operations A st
( arity o = 0 & a in rng o ) ;
consider o being Element of Operations A such that
A4: arity o = 0 and
A5: a in rng o by A3;
consider s being set such that
A6: s in dom o and
A7: a = o . s by A5, FUNCT_1:def_3;
A8: dom o = 0 -tuples_on the carrier of A by A4, MARGREL1:22;
reconsider s = s as Element of the carrier of A * by A6;
A9: len s = 0 by A6, A8;
s = {} by A6, A8;
then rng s c= B by RELAT_1:38, XBOOLE_1:2;
then A10: s is FinSequence of B by FINSEQ_1:def_4;
B is_closed_on o by A1, UNIALG_2:def_4;
hence not x nin B by A2, A4, A7, A9, A10, UNIALG_2:def_3; ::_thesis: verum
end;
theorem Th28: :: AOFA_000:28
for A being Universal_Algebra st Constants A = {} holds
{} A is opers_closed
proof
let A be Universal_Algebra; ::_thesis: ( Constants A = {} implies {} A is opers_closed )
assume A1: Constants A = {} ; ::_thesis: {} A is opers_closed
let o be Element of Operations A; :: according to UNIALG_2:def_4 ::_thesis: {} A is_closed_on o
let s be FinSequence of {} A; :: according to UNIALG_2:def_3 ::_thesis: ( not len s = arity o or not o . s nin {} A )
assume A2: len s = arity o ; ::_thesis: not o . s nin {} A
A3: s is Element of (arity o) -tuples_on the carrier of A by A2, FINSEQ_2:92;
dom o = (arity o) -tuples_on the carrier of A by MARGREL1:22;
then A4: o . s in rng o by A3, FUNCT_1:def_3;
then reconsider a = o . s as Element of A ;
a nin Constants A by A1;
then s <> {} by A2, A4, CARD_1:27;
hence not o . s nin {} A ; ::_thesis: verum
end;
theorem :: AOFA_000:29
for A being Universal_Algebra st Constants A = {} holds
for G being GeneratorSet of A holds G <> {}
proof
let A be Universal_Algebra; ::_thesis: ( Constants A = {} implies for G being GeneratorSet of A holds G <> {} )
assume A1: Constants A = {} ; ::_thesis: for G being GeneratorSet of A holds G <> {}
let G be GeneratorSet of A; ::_thesis: G <> {}
assume A2: G = {} ; ::_thesis: contradiction
then G = {} A ;
then G is opers_closed by A1, Th28;
hence contradiction by A2, FREEALG:def_4; ::_thesis: verum
end;
theorem Th30: :: AOFA_000:30
for A being Universal_Algebra
for G being Subset of A holds
( G is GeneratorSet of A iff for I being Element of A ex n being Nat st I in G |^ n )
proof
let A be Universal_Algebra; ::_thesis: for G being Subset of A holds
( G is GeneratorSet of A iff for I being Element of A ex n being Nat st I in G |^ n )
let B be Subset of A; ::_thesis: ( B is GeneratorSet of A iff for I being Element of A ex n being Nat st I in B |^ n )
set X = { (B |^ n) where n is Element of NAT : verum } ;
consider C being Subset of A such that
A1: C = union { (B |^ n) where n is Element of NAT : verum } and
A2: C is opers_closed by Th24;
B |^ 0 = B by Th18;
then A3: B in { (B |^ n) where n is Element of NAT : verum } ;
thus ( B is GeneratorSet of A implies for I being Element of A ex n being Nat st I in B |^ n ) ::_thesis: ( ( for I being Element of A ex n being Nat st I in B |^ n ) implies B is GeneratorSet of A )
proof
assume for D being Subset of A st D is opers_closed & B c= D holds
D = the carrier of A ; :: according to FREEALG:def_4 ::_thesis: for I being Element of A ex n being Nat st I in B |^ n
then A4: C = the carrier of A by A1, A2, A3, ZFMISC_1:74;
let I be Element of A; ::_thesis: ex n being Nat st I in B |^ n
consider Y being set such that
A5: I in Y and
A6: Y in { (B |^ n) where n is Element of NAT : verum } by A1, A4, TARSKI:def_4;
ex n being Element of NAT st Y = B |^ n by A6;
hence ex n being Nat st I in B |^ n by A5; ::_thesis: verum
end;
assume A7: for I being Element of A ex n being Nat st I in B |^ n ; ::_thesis: B is GeneratorSet of A
let D be Subset of A; :: according to FREEALG:def_4 ::_thesis: ( not D is opers_closed or not B c= D or D = the carrier of A )
assume that
A8: D is opers_closed and
A9: B c= D ; ::_thesis: D = the carrier of A
A10: union { (B |^ n) where n is Element of NAT : verum } c= D by A8, A9, Th25;
thus D c= the carrier of A ; :: according to XBOOLE_0:def_10 ::_thesis: the carrier of A c= D
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin the carrier of A or not x nin D )
assume x in the carrier of A ; ::_thesis: not x nin D
then reconsider I = x as Element of A ;
consider n being Nat such that
A11: I in B |^ n by A7;
reconsider n = n as Element of NAT by ORDINAL1:def_12;
B |^ n in { (B |^ n) where n is Element of NAT : verum } ;
then I in union { (B |^ n) where n is Element of NAT : verum } by A11, TARSKI:def_4;
hence not x nin D by A10; ::_thesis: verum
end;
theorem Th31: :: AOFA_000:31
for A being Universal_Algebra
for B being Subset of A
for G being GeneratorSet of A st G c= B holds
B is GeneratorSet of A
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A
for G being GeneratorSet of A st G c= B holds
B is GeneratorSet of A
let B be Subset of A; ::_thesis: for G being GeneratorSet of A st G c= B holds
B is GeneratorSet of A
let G be GeneratorSet of A; ::_thesis: ( G c= B implies B is GeneratorSet of A )
assume A1: G c= B ; ::_thesis: B is GeneratorSet of A
now__::_thesis:_for_a_being_Element_of_A_ex_n_being_Nat_st_a_in_B_|^_n
let a be Element of A; ::_thesis: ex n being Nat st a in B |^ n
consider n being Nat such that
A2: a in G |^ n by Th30;
take n = n; ::_thesis: a in B |^ n
G |^ n c= B |^ n by A1, Th22;
hence a in B |^ n by A2; ::_thesis: verum
end;
hence B is GeneratorSet of A by Th30; ::_thesis: verum
end;
theorem Th32: :: AOFA_000:32
for A being Universal_Algebra
for G being GeneratorSet of A
for a being Element of A st ( for o being Element of Operations A holds not a in rng o ) holds
a in G
proof
let A be Universal_Algebra; ::_thesis: for G being GeneratorSet of A
for a being Element of A st ( for o being Element of Operations A holds not a in rng o ) holds
a in G
let G be GeneratorSet of A; ::_thesis: for a being Element of A st ( for o being Element of Operations A holds not a in rng o ) holds
a in G
let a be Element of A; ::_thesis: ( ( for o being Element of Operations A holds not a in rng o ) implies a in G )
assume A1: for o being Element of Operations A holds a nin rng o ; ::_thesis: a in G
defpred S1[ Nat] means a nin G |^ $1;
assume a nin G ; ::_thesis: contradiction
then A2: S1[ 0 ] by Th18;
A3: now__::_thesis:_for_n_being_Nat_st_S1[n]_holds_
S1[n_+_1]
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A4: S1[n] ; ::_thesis: S1[n + 1]
thus S1[n + 1] ::_thesis: verum
proof
assume a in G |^ (n + 1) ; ::_thesis: contradiction
then a in (G |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= G |^ n ) } by Th19;
then a in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= G |^ n ) } by A4, XBOOLE_0:def_3;
then consider o being Element of dom the charact of A, p being Element of the carrier of A * such that
A5: a = (Den (o,A)) . p and
A6: p in dom (Den (o,A)) and
rng p c= G |^ n ;
a in rng (Den (o,A)) by A5, A6, FUNCT_1:def_3;
hence contradiction by A1; ::_thesis: verum
end;
end;
for n being Nat holds S1[n] from NAT_1:sch_2(A2, A3);
hence contradiction by Th30; ::_thesis: verum
end;
theorem :: AOFA_000:33
for A being Universal_Algebra
for G being GeneratorSet of A holds Generators A c= G
proof
let A be Universal_Algebra; ::_thesis: for G being GeneratorSet of A holds Generators A c= G
let G be GeneratorSet of A; ::_thesis: Generators A c= G
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin Generators A or not a nin G )
assume A1: a in Generators A ; ::_thesis: not a nin G
then A2: a nin union { (rng o) where o is Element of Operations A : verum } by XBOOLE_0:def_5;
reconsider I = a as Element of A by A1;
assume a nin G ; ::_thesis: contradiction
then consider o0 being Element of Operations A such that
A3: I in rng o0 by Th32;
rng o0 in { (rng o) where o is Element of Operations A : verum } ;
hence contradiction by A2, A3, TARSKI:def_4; ::_thesis: verum
end;
theorem Th34: :: AOFA_000:34
for A being free Universal_Algebra
for G being free GeneratorSet of A holds G = Generators A
proof
let A be free Universal_Algebra; ::_thesis: for G being free GeneratorSet of A holds G = Generators A
let G be free GeneratorSet of A; ::_thesis: G = Generators A
reconsider S = signature A as non empty FinSequence of NAT by MSUALG_1:4;
consider B being Universal_Algebra such that
A1: the carrier of B = NAT and
A2: signature B = S and
A3: for i, j being Nat st i in dom S & j = S . i holds
the charact of B . i = (j -tuples_on NAT) --> i by Th14;
reconsider f = G --> 0 as Function of G, the carrier of B by A1;
A,B are_similar by A2, UNIALG_2:def_1;
then consider h being Function of A,B such that
A4: h is_homomorphism A,B and
A5: h | G = f by FREEALG:def_5;
A6: len S = len the charact of B by A2, UNIALG_1:def_4;
A7: len S = len the charact of A by UNIALG_1:def_4;
A8: dom S = dom the charact of B by A6, FINSEQ_3:29;
A9: dom S = dom the charact of A by A7, FINSEQ_3:29;
thus G c= Generators A :: according to XBOOLE_0:def_10 ::_thesis: Generators A c= G
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin G or not a nin Generators A )
assume A10: a in G ; ::_thesis: not a nin Generators A
then reconsider I = a as Element of A ;
assume a nin Generators A ; ::_thesis: contradiction
then I in union { (rng o) where o is Element of Operations A : verum } by XBOOLE_0:def_5;
then consider Y being set such that
A11: I in Y and
A12: Y in { (rng o) where o is Element of Operations A : verum } by TARSKI:def_4;
consider o being Element of Operations A such that
A13: Y = rng o by A12;
consider i being set such that
A14: i in dom the charact of A and
A15: o = the charact of A . i by FUNCT_1:def_3;
reconsider i = i as Element of NAT by A14;
reconsider j = S . i as Element of NAT ;
reconsider o2 = the charact of B . i as Element of Operations B by A8, A9, A14, FUNCT_1:def_3;
consider x being set such that
A16: x in dom o and
A17: I = o . x by A11, A13, FUNCT_1:def_3;
A18: dom o = (arity o) -tuples_on the carrier of A by MARGREL1:22;
reconsider x = x as FinSequence of A by A16, FINSEQ_1:def_11;
reconsider hx = h * x as FinSequence of NAT by A1;
len (h * x) = len x by FINSEQ_2:33
.= arity o by A16, A18, CARD_1:def_7
.= j by A9, A14, A15, UNIALG_1:def_4 ;
then A19: hx is Element of j -tuples_on NAT by FINSEQ_2:92;
0 = f . I by A10, FUNCOP_1:7
.= h . (o . x) by A5, A10, A17, FUNCT_1:49
.= o2 . (h * x) by A4, A14, A15, A16, ALG_1:def_1
.= ((j -tuples_on NAT) --> i) . (h * x) by A3, A9, A14
.= i by A19, FUNCOP_1:7 ;
hence contradiction by A14, FINSEQ_3:25; ::_thesis: verum
end;
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin Generators A or not a nin G )
assume A20: a in Generators A ; ::_thesis: not a nin G
then A21: a nin union { (rng o) where o is Element of Operations A : verum } by XBOOLE_0:def_5;
reconsider I = a as Element of A by A20;
assume a nin G ; ::_thesis: contradiction
then consider o0 being Element of Operations A such that
A22: I in rng o0 by Th32;
rng o0 in { (rng o) where o is Element of Operations A : verum } ;
hence contradiction by A21, A22, TARSKI:def_4; ::_thesis: verum
end;
registration
let A be free Universal_Algebra;
cluster Generators A -> free for GeneratorSet of A;
coherence
for b1 being GeneratorSet of A st b1 = Generators A holds
b1 is free
proof
set G = the free GeneratorSet of A;
Generators A = the free GeneratorSet of A by Th34;
hence for b1 being GeneratorSet of A st b1 = Generators A holds
b1 is free ; ::_thesis: verum
end;
end;
definition
let A be free Universal_Algebra;
:: original: Generators
redefine func Generators A -> GeneratorSet of A;
coherence
Generators A is GeneratorSet of A
proof
set G = the free GeneratorSet of A;
Generators A = the free GeneratorSet of A by Th34;
hence Generators A is GeneratorSet of A ; ::_thesis: verum
end;
end;
registration
let A, B be set ;
cluster[:A,B:] -> disjoint_with_NAT ;
coherence
[:A,B:] is disjoint_with_NAT
proof
now__::_thesis:_for_z_being_set_st_z_in_[:A,B:]_holds_
not_z_in_NAT
let z be set ; ::_thesis: ( z in [:A,B:] implies not z in NAT )
assume that
A1: z in [:A,B:] and
A2: z in NAT ; ::_thesis: contradiction
ex a, b being set st
( a in A & b in B & z = [a,b] ) by A1, ZFMISC_1:def_2;
hence contradiction by A2; ::_thesis: verum
end;
hence [:A,B:] misses NAT by XBOOLE_0:3; :: according to FREEALG:def_1 ::_thesis: verum
end;
end;
theorem :: AOFA_000:35
for A being free Universal_Algebra
for G being GeneratorSet of A
for B being Universal_Algebra
for h1, h2 being Function of A,B st h1 is_homomorphism A,B & h2 is_homomorphism A,B & h1 | G = h2 | G holds
h1 = h2
proof
let A be free Universal_Algebra; ::_thesis: for G being GeneratorSet of A
for B being Universal_Algebra
for h1, h2 being Function of A,B st h1 is_homomorphism A,B & h2 is_homomorphism A,B & h1 | G = h2 | G holds
h1 = h2
let G be GeneratorSet of A; ::_thesis: for B being Universal_Algebra
for h1, h2 being Function of A,B st h1 is_homomorphism A,B & h2 is_homomorphism A,B & h1 | G = h2 | G holds
h1 = h2
let B be Universal_Algebra; ::_thesis: for h1, h2 being Function of A,B st h1 is_homomorphism A,B & h2 is_homomorphism A,B & h1 | G = h2 | G holds
h1 = h2
let h1, h2 be Function of A,B; ::_thesis: ( h1 is_homomorphism A,B & h2 is_homomorphism A,B & h1 | G = h2 | G implies h1 = h2 )
assume that
A1: h1 is_homomorphism A,B and
A2: h2 is_homomorphism A,B and
A3: h1 | G = h2 | G ; ::_thesis: h1 = h2
defpred S1[ Nat] means for a being Element of A st a in G |^ $1 holds
h1 . a = h2 . a;
A4: S1[ 0 ]
proof
let a be Element of A; ::_thesis: ( a in G |^ 0 implies h1 . a = h2 . a )
assume a in G |^ 0 ; ::_thesis: h1 . a = h2 . a
then A5: a in G by Th18;
then h1 . a = (h1 | G) . a by FUNCT_1:49;
hence h1 . a = h2 . a by A3, A5, FUNCT_1:49; ::_thesis: verum
end;
A6: for n being Nat st S1[n] holds
S1[n + 1]
proof
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A7: S1[n] ; ::_thesis: S1[n + 1]
let a be Element of A; ::_thesis: ( a in G |^ (n + 1) implies h1 . a = h2 . a )
assume that
A8: a in G |^ (n + 1) and
A9: h1 . a <> h2 . a ; ::_thesis: contradiction
a nin G |^ n by A7, A9;
then consider o being Element of dom the charact of A, p being Element of the carrier of A * such that
A10: a = (Den (o,A)) . p and
A11: p in dom (Den (o,A)) and
A12: rng p c= G |^ n by A8, Th20;
A,B are_similar by A1, ALG_1:def_1;
then len the charact of A = len the charact of B by UNIALG_2:1;
then reconsider o9 = o as Element of dom the charact of B by FINSEQ_3:29;
A13: Operations A = rng the charact of A ;
A14: Operations B = rng the charact of B ;
then A15: h1 . a = (Den (o9,B)) . (h1 * p) by A1, A10, A11, A13, ALG_1:def_1;
A16: h2 . a = (Den (o9,B)) . (h2 * p) by A2, A10, A11, A13, A14, ALG_1:def_1;
now__::_thesis:_(_G_|^_n_c=_dom_h1_&_G_|^_n_c=_dom_h2_&_(_for_x_being_set_st_x_in_G_|^_n_holds_
h1_._x_=_h2_._x_)_)
A17: dom h1 = the carrier of A by FUNCT_2:def_1;
dom h2 = the carrier of A by FUNCT_2:def_1;
hence ( G |^ n c= dom h1 & G |^ n c= dom h2 ) by A17; ::_thesis: for x being set st x in G |^ n holds
h1 . x = h2 . x
let x be set ; ::_thesis: ( x in G |^ n implies h1 . x = h2 . x )
assume x in G |^ n ; ::_thesis: h1 . x = h2 . x
hence h1 . x = h2 . x by A7; ::_thesis: verum
end;
hence contradiction by A9, A12, A15, A16, Th1; ::_thesis: verum
end;
A18: for n being Nat holds S1[n] from NAT_1:sch_2(A4, A6);
now__::_thesis:_for_a_being_Element_of_A_holds_h1_._a_=_h2_._a
let a be Element of A; ::_thesis: h1 . a = h2 . a
ex n being Nat st a in G |^ n by Th30;
hence h1 . a = h2 . a by A18; ::_thesis: verum
end;
hence h1 = h2 by FUNCT_2:63; ::_thesis: verum
end;
Lm2: for A being free Universal_Algebra
for o1, o2 being OperSymbol of A
for p1, p2 being FinSequence st p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 holds
o1 = o2
proof
let A be free Universal_Algebra; ::_thesis: for o1, o2 being OperSymbol of A
for p1, p2 being FinSequence st p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 holds
o1 = o2
set G = the free GeneratorSet of A;
let o1, o2 be OperSymbol of A; ::_thesis: for p1, p2 being FinSequence st p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 holds
o1 = o2
let p1, p2 be FinSequence; ::_thesis: ( p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 implies o1 = o2 )
assume that
A1: p1 in dom (Den (o1,A)) and
A2: p2 in dom (Den (o2,A)) and
A3: (Den (o1,A)) . p1 = (Den (o2,A)) . p2 ; ::_thesis: o1 = o2
reconsider S = signature A as non empty FinSequence of NAT by MSUALG_1:4;
consider B being Universal_Algebra such that
A4: the carrier of B = NAT and
A5: signature B = S and
A6: for i, j being Nat st i in dom S & j = S . i holds
the charact of B . i = (j -tuples_on NAT) --> i by Th14;
reconsider f = the free GeneratorSet of A --> 0 as Function of the free GeneratorSet of A, the carrier of B by A4;
A,B are_similar by A5, UNIALG_2:def_1;
then consider h being Function of A,B such that
A7: h is_homomorphism A,B and
h | the free GeneratorSet of A = f by FREEALG:def_5;
A8: len S = len the charact of B by A5, UNIALG_1:def_4;
A9: len S = len the charact of A by UNIALG_1:def_4;
A10: dom S = dom the charact of B by A8, FINSEQ_3:29;
A11: dom S = dom the charact of A by A9, FINSEQ_3:29;
reconsider b1 = o1, b2 = o2 as OperSymbol of B by A8, A9, FINSEQ_3:29;
reconsider n1 = o1, n2 = o2 as Element of NAT ;
reconsider j1 = S . n1, j2 = S . n2 as Element of NAT ;
reconsider x1 = p1, x2 = p2 as FinSequence of A by A1, A2, FINSEQ_1:def_11;
reconsider h1 = h * x1, h2 = h * x2 as FinSequence of NAT by A4;
reconsider oo1 = Den (o1,A), oo2 = Den (o2,A) as Element of Operations A ;
A12: dom oo1 = (arity oo1) -tuples_on the carrier of A by MARGREL1:22;
A13: dom oo2 = (arity oo2) -tuples_on the carrier of A by MARGREL1:22;
len x1 = arity oo1 by A1, A12, CARD_1:def_7
.= j1 by A11, UNIALG_1:def_4 ;
then len h1 = j1 by FINSEQ_2:33;
then A14: h1 is Element of j1 -tuples_on NAT by FINSEQ_2:92;
len x2 = arity oo2 by A2, A13, CARD_1:def_7
.= j2 by A11, UNIALG_1:def_4 ;
then len h2 = j2 by FINSEQ_2:33;
then A15: h2 is Element of j2 -tuples_on NAT by FINSEQ_2:92;
A16: Den (o1,A) is Element of Operations A ;
A17: Den (b1,B) is Element of Operations B ;
then A18: h . ((Den (o1,A)) . x1) = (Den (b1,B)) . h1 by A1, A7, A16, ALG_1:def_1;
A19: h . ((Den (o2,A)) . x2) = (Den (b2,B)) . h2 by A2, A7, A16, A17, ALG_1:def_1;
A20: Den (b1,B) = (j1 -tuples_on NAT) --> n1 by A6, A10;
A21: Den (b2,B) = (j2 -tuples_on NAT) --> n2 by A6, A10;
(Den (b1,B)) . h1 = n1 by A14, A20, FUNCOP_1:7;
hence o1 = o2 by A3, A15, A18, A19, A21, FUNCOP_1:7; ::_thesis: verum
end;
theorem Th36: :: AOFA_000:36
for A being free Universal_Algebra
for o1, o2 being OperSymbol of A
for p1, p2 being FinSequence st p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 holds
( o1 = o2 & p1 = p2 )
proof
let A be free Universal_Algebra; ::_thesis: for o1, o2 being OperSymbol of A
for p1, p2 being FinSequence st p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 holds
( o1 = o2 & p1 = p2 )
set G = the free GeneratorSet of A;
let o1, o2 be OperSymbol of A; ::_thesis: for p1, p2 being FinSequence st p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 holds
( o1 = o2 & p1 = p2 )
let p1, p2 be FinSequence; ::_thesis: ( p1 in dom (Den (o1,A)) & p2 in dom (Den (o2,A)) & (Den (o1,A)) . p1 = (Den (o2,A)) . p2 implies ( o1 = o2 & p1 = p2 ) )
assume that
A1: p1 in dom (Den (o1,A)) and
A2: p2 in dom (Den (o2,A)) and
A3: (Den (o1,A)) . p1 = (Den (o2,A)) . p2 ; ::_thesis: ( o1 = o2 & p1 = p2 )
thus A4: o1 = o2 by A1, A2, A3, Lm2; ::_thesis: p1 = p2
reconsider S = signature A as non empty FinSequence of NAT by MSUALG_1:4;
set G9 = the free GeneratorSet of A \/ { the carrier of A};
reconsider G9 = the free GeneratorSet of A \/ { the carrier of A} as non empty set ;
deffunc H1( set ) -> set = root-tree [0,$1];
consider g being Function such that
A5: ( dom g = the free GeneratorSet of A & ( for x being set st x in the free GeneratorSet of A holds
g . x = H1(x) ) ) from FUNCT_1:sch_3();
set X = [:{0},G9:];
set B = FreeUnivAlgNSG (S,[:{0},G9:]);
A6: signature (FreeUnivAlgNSG (S,[:{0},G9:])) = S by FREEALG:4;
A7: Terminals (DTConUA (S,[:{0},G9:])) = [:{0},G9:] by FREEALG:3;
rng g c= FreeGenSetNSG (S,[:{0},G9:])
proof
let b be set ; :: according to TARSKI:def_3 ::_thesis: ( b nin rng g or not b nin FreeGenSetNSG (S,[:{0},G9:]) )
assume b in rng g ; ::_thesis: not b nin FreeGenSetNSG (S,[:{0},G9:])
then consider a being set such that
A8: a in dom g and
A9: b = g . a by FUNCT_1:def_3;
reconsider a = a as Element of A by A5, A8;
A10: a in G9 by A5, A8, XBOOLE_0:def_3;
0 in {0} by TARSKI:def_1;
then A11: [0,a] in [:{0},G9:] by A10, ZFMISC_1:87;
then reconsider s = [0,a] as Symbol of (DTConUA (S,[:{0},G9:])) by A7;
root-tree s in FreeGenSetNSG (S,[:{0},G9:]) by A7, A11;
hence not b nin FreeGenSetNSG (S,[:{0},G9:]) by A5, A8, A9; ::_thesis: verum
end;
then reconsider g = g as Function of the free GeneratorSet of A, the carrier of (FreeUnivAlgNSG (S,[:{0},G9:])) by A5, FUNCT_2:2, XBOOLE_1:1;
signature (FreeUnivAlgNSG (S,[:{0},G9:])) = S by FREEALG:4;
then A, FreeUnivAlgNSG (S,[:{0},G9:]) are_similar by UNIALG_2:def_1;
then consider h being Function of A,(FreeUnivAlgNSG (S,[:{0},G9:])) such that
A12: h is_homomorphism A, FreeUnivAlgNSG (S,[:{0},G9:]) and
A13: h | the free GeneratorSet of A = g by FREEALG:def_5;
defpred S1[ Nat] means for a1, a2 being set st a1 in the free GeneratorSet of A |^ $1 & a2 in the free GeneratorSet of A |^ $1 & h . a1 = h . a2 holds
a1 = a2;
A14: the free GeneratorSet of A |^ 0 = the free GeneratorSet of A by Th18;
A15: len S = len the charact of (FreeUnivAlgNSG (S,[:{0},G9:])) by A6, UNIALG_1:def_4;
A16: len S = len the charact of A by UNIALG_1:def_4;
A17: dom S = dom the charact of (FreeUnivAlgNSG (S,[:{0},G9:])) by A15, FINSEQ_3:29;
A18: now__::_thesis:_for_o_being_Element_of_dom_the_charact_of_A
for_p_being_FinSequence_of_A_st_p_in_dom_(Den_(o,A))_holds_
(_len_p_=_S_._o_&_len_(h_*_p)_=_S_._o_&_h_._((Den_(o,A))_._p)_=_o_-tree_(h_*_p)_)
let o be Element of dom the charact of A; ::_thesis: for p being FinSequence of A st p in dom (Den (o,A)) holds
( len p = S . o & len (h * p) = S . o & h . ((Den (o,A)) . p) = o -tree (h * p) )
let p be FinSequence of A; ::_thesis: ( p in dom (Den (o,A)) implies ( len p = S . o & len (h * p) = S . o & h . ((Den (o,A)) . p) = o -tree (h * p) ) )
assume A19: p in dom (Den (o,A)) ; ::_thesis: ( len p = S . o & len (h * p) = S . o & h . ((Den (o,A)) . p) = o -tree (h * p) )
reconsider q = p as FinSequence of A ;
reconsider hq = h * q as FinSequence of (FreeUnivAlgNSG (S,[:{0},G9:])) ;
reconsider op = Den (o,A) as Element of Operations A ;
reconsider on = o as Element of NAT ;
reconsider o9 = on as OperSymbol of (FreeUnivAlgNSG (S,[:{0},G9:])) by A15, A16, FINSEQ_3:29;
reconsider op9 = Den (o9,(FreeUnivAlgNSG (S,[:{0},G9:]))) as Element of Operations (FreeUnivAlgNSG (S,[:{0},G9:])) ;
reconsider j = S . o9 as Element of NAT ;
dom op = (arity op) -tuples_on the carrier of A by MARGREL1:22;
then A20: len p = arity op by A19, CARD_1:def_7
.= j by A17, UNIALG_1:def_4 ;
hence ( len p = S . o & len (h * p) = S . o ) by FINSEQ_2:33; ::_thesis: h . ((Den (o,A)) . p) = o -tree (h * p)
A21: h . (op . q) = op9 . hq by A12, A19, ALG_1:def_1;
A22: In (o9,(dom the charact of (FreeUnivAlgNSG (S,[:{0},G9:])))) = o9 by FUNCT_7:def_1;
len hq = S . o9 by A20, FINSEQ_2:33;
hence h . ((Den (o,A)) . p) = o -tree (h * p) by A17, A21, A22, Th17; ::_thesis: verum
end;
A23: S1[ 0 ]
proof
let a1, a2 be set ; ::_thesis: ( a1 in the free GeneratorSet of A |^ 0 & a2 in the free GeneratorSet of A |^ 0 & h . a1 = h . a2 implies a1 = a2 )
assume that
A24: a1 in the free GeneratorSet of A |^ 0 and
A25: a2 in the free GeneratorSet of A |^ 0 and
A26: h . a1 = h . a2 ; ::_thesis: a1 = a2
A27: h . a1 = g . a1 by A13, A14, A24, FUNCT_1:49;
A28: h . a2 = g . a2 by A13, A14, A25, FUNCT_1:49;
A29: h . a1 = H1(a1) by A5, A14, A24, A27;
h . a2 = H1(a2) by A5, A14, A25, A28;
then [0,a1] = [0,a2] by A26, A29, TREES_4:4;
hence a1 = a2 by XTUPLE_0:1; ::_thesis: verum
end;
A30: now__::_thesis:_for_o_being_Element_of_dom_the_charact_of_A
for_p_being_Element_of_the_carrier_of_A_*_st_p_in_dom_(Den_(o,A))_holds_
for_x_being_set_st_x_in_the_free_GeneratorSet_of_A_holds_
not_h_._((Den_(o,A))_._p)_=_h_._x
let o be Element of dom the charact of A; ::_thesis: for p being Element of the carrier of A * st p in dom (Den (o,A)) holds
for x being set st x in the free GeneratorSet of A holds
not h . ((Den (o,A)) . p) = h . x
let p be Element of the carrier of A * ; ::_thesis: ( p in dom (Den (o,A)) implies for x being set st x in the free GeneratorSet of A holds
not h . ((Den (o,A)) . p) = h . x )
assume p in dom (Den (o,A)) ; ::_thesis: for x being set st x in the free GeneratorSet of A holds
not h . ((Den (o,A)) . p) = h . x
then A31: h . ((Den (o,A)) . p) = o -tree (h * p) by A18;
let x be set ; ::_thesis: ( x in the free GeneratorSet of A implies not h . ((Den (o,A)) . p) = h . x )
assume A32: x in the free GeneratorSet of A ; ::_thesis: not h . ((Den (o,A)) . p) = h . x
then A33: h . x = g . x by A13, FUNCT_1:49
.= H1(x) by A5, A32 ;
assume h . ((Den (o,A)) . p) = h . x ; ::_thesis: contradiction
hence contradiction by A31, A33, TREES_4:17; ::_thesis: verum
end;
A34: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A35: S1[k] ; ::_thesis: S1[k + 1]
defpred S2[ set ] means ex o being Element of dom the charact of A ex p being Element of the carrier of A * st
( $1 = (Den (o,A)) . p & p in dom (Den (o,A)) & rng p c= the free GeneratorSet of A |^ k );
let a1, a2 be set ; ::_thesis: ( a1 in the free GeneratorSet of A |^ (k + 1) & a2 in the free GeneratorSet of A |^ (k + 1) & h . a1 = h . a2 implies a1 = a2 )
assume that
A36: a1 in the free GeneratorSet of A |^ (k + 1) and
A37: a2 in the free GeneratorSet of A |^ (k + 1) and
A38: h . a1 = h . a2 ; ::_thesis: a1 = a2
percases ( ( a1 in the free GeneratorSet of A & a2 in the free GeneratorSet of A ) or ( S2[a1] & S2[a2] ) or ( a1 in the free GeneratorSet of A & S2[a2] ) or ( S2[a1] & a2 in the free GeneratorSet of A ) ) by A36, A37, Th23;
supposeA39: ( a1 in the free GeneratorSet of A & a2 in the free GeneratorSet of A ) ; ::_thesis: a1 = a2
then A40: h . a1 = g . a1 by A13, FUNCT_1:49;
A41: h . a2 = g . a2 by A13, A39, FUNCT_1:49;
A42: h . a1 = H1(a1) by A5, A39, A40;
h . a2 = H1(a2) by A5, A39, A41;
then [0,a1] = [0,a2] by A38, A42, TREES_4:4;
hence a1 = a2 by XTUPLE_0:1; ::_thesis: verum
end;
supposeA43: ( S2[a1] & S2[a2] ) ; ::_thesis: a1 = a2
then consider b1 being Element of dom the charact of A, q1 being Element of the carrier of A * such that
A44: a1 = (Den (b1,A)) . q1 and
A45: q1 in dom (Den (b1,A)) and
A46: rng q1 c= the free GeneratorSet of A |^ k ;
consider b2 being Element of dom the charact of A, q2 being Element of the carrier of A * such that
A47: a2 = (Den (b2,A)) . q2 and
A48: q2 in dom (Den (b2,A)) and
A49: rng q2 c= the free GeneratorSet of A |^ k by A43;
A50: b1 -tree (h * q1) = h . a1 by A18, A44, A45
.= b2 -tree (h * q2) by A18, A38, A47, A48 ;
then A51: b1 = b2 by TREES_4:15;
A52: h * q1 = h * q2 by A50, TREES_4:15;
A53: len q1 = S . b1 by A18, A45;
A54: len q2 = S . b2 by A18, A48;
A55: dom q1 = Seg (len q1) by FINSEQ_1:def_3;
A56: dom q2 = Seg (len q1) by A51, A53, A54, FINSEQ_1:def_3;
now__::_thesis:_for_j_being_Nat_st_j_in_dom_q1_holds_
q1_._j_=_q2_._j
let j be Nat; ::_thesis: ( j in dom q1 implies q1 . j = q2 . j )
assume A57: j in dom q1 ; ::_thesis: q1 . j = q2 . j
then A58: q1 . j in rng q1 by FUNCT_1:3;
A59: q2 . j in rng q2 by A55, A56, A57, FUNCT_1:3;
A60: h . (q1 . j) = (h * q1) . j by A57, FUNCT_1:13;
h . (q2 . j) = (h * q2) . j by A55, A56, A57, FUNCT_1:13;
hence q1 . j = q2 . j by A35, A46, A49, A52, A58, A59, A60; ::_thesis: verum
end;
hence a1 = a2 by A44, A47, A51, A55, A56, FINSEQ_1:13; ::_thesis: verum
end;
suppose ( ( a1 in the free GeneratorSet of A & S2[a2] ) or ( S2[a1] & a2 in the free GeneratorSet of A ) ) ; ::_thesis: a1 = a2
hence a1 = a2 by A30, A38; ::_thesis: verum
end;
end;
end;
A61: for k being Nat holds S1[k] from NAT_1:sch_2(A23, A34);
reconsider q1 = p1, q2 = p2 as FinSequence of A by A1, A2, FINSEQ_1:def_11;
o1 -tree (h * q1) = h . ((Den (o1,A)) . p1) by A1, A18
.= o2 -tree (h * q2) by A2, A3, A18 ;
then A62: h * p1 = h * p2 by TREES_4:15;
A63: len q1 = S . o1 by A1, A18;
A64: len q2 = S . o2 by A2, A18;
A65: dom q1 = Seg (len q1) by FINSEQ_1:def_3;
A66: dom q2 = Seg (len q1) by A4, A63, A64, FINSEQ_1:def_3;
now__::_thesis:_for_j_being_Nat_st_j_in_dom_q1_holds_
q1_._j_=_q2_._j
let j be Nat; ::_thesis: ( j in dom q1 implies q1 . j = q2 . j )
assume A67: j in dom q1 ; ::_thesis: q1 . j = q2 . j
then A68: q1 . j in rng q1 by FUNCT_1:3;
A69: q2 . j in rng q2 by A65, A66, A67, FUNCT_1:3;
consider n1 being Nat such that
A70: q1 . j in the free GeneratorSet of A |^ n1 by A68, Th30;
consider n2 being Nat such that
A71: q2 . j in the free GeneratorSet of A |^ n2 by A69, Th30;
reconsider k = max (n1,n2) as Nat ;
A72: the free GeneratorSet of A |^ n1 c= the free GeneratorSet of A |^ k by Th21, XXREAL_0:25;
A73: the free GeneratorSet of A |^ n2 c= the free GeneratorSet of A |^ k by Th21, XXREAL_0:25;
A74: h . (q1 . j) = (h * q1) . j by A67, FUNCT_1:13;
h . (q2 . j) = (h * q2) . j by A65, A66, A67, FUNCT_1:13;
hence q1 . j = q2 . j by A61, A62, A70, A71, A72, A73, A74; ::_thesis: verum
end;
hence p1 = p2 by A65, A66, FINSEQ_1:13; ::_thesis: verum
end;
theorem :: AOFA_000:37
for A being free Universal_Algebra
for o1, o2 being Element of Operations A
for p1, p2 being FinSequence st p1 in dom o1 & p2 in dom o2 & o1 . p1 = o2 . p2 holds
( o1 = o2 & p1 = p2 )
proof
let A be free Universal_Algebra; ::_thesis: for o1, o2 being Element of Operations A
for p1, p2 being FinSequence st p1 in dom o1 & p2 in dom o2 & o1 . p1 = o2 . p2 holds
( o1 = o2 & p1 = p2 )
let o1, o2 be Element of Operations A; ::_thesis: for p1, p2 being FinSequence st p1 in dom o1 & p2 in dom o2 & o1 . p1 = o2 . p2 holds
( o1 = o2 & p1 = p2 )
consider a1 being set such that
A1: a1 in dom the charact of A and
A2: o1 = the charact of A . a1 by FUNCT_1:def_3;
consider a2 being set such that
A3: a2 in dom the charact of A and
A4: o2 = the charact of A . a2 by FUNCT_1:def_3;
reconsider a1 = a1, a2 = a2 as OperSymbol of A by A1, A3;
A5: o1 = Den (a1,A) by A2;
A6: o2 = Den (a2,A) by A4;
let p1, p2 be FinSequence; ::_thesis: ( p1 in dom o1 & p2 in dom o2 & o1 . p1 = o2 . p2 implies ( o1 = o2 & p1 = p2 ) )
assume that
A7: p1 in dom o1 and
A8: p2 in dom o2 and
A9: o1 . p1 = o2 . p2 ; ::_thesis: ( o1 = o2 & p1 = p2 )
thus ( o1 = o2 & p1 = p2 ) by A5, A6, A7, A8, A9, Th36; ::_thesis: verum
end;
theorem Th38: :: AOFA_000:38
for A being free Universal_Algebra
for o being OperSymbol of A
for p being FinSequence st p in dom (Den (o,A)) holds
for a being set st a in rng p holds
a <> (Den (o,A)) . p
proof
let A be free Universal_Algebra; ::_thesis: for o being OperSymbol of A
for p being FinSequence st p in dom (Den (o,A)) holds
for a being set st a in rng p holds
a <> (Den (o,A)) . p
let o be OperSymbol of A; ::_thesis: for p being FinSequence st p in dom (Den (o,A)) holds
for a being set st a in rng p holds
a <> (Den (o,A)) . p
let p be FinSequence; ::_thesis: ( p in dom (Den (o,A)) implies for a being set st a in rng p holds
a <> (Den (o,A)) . p )
assume A1: p in dom (Den (o,A)) ; ::_thesis: for a being set st a in rng p holds
a <> (Den (o,A)) . p
let a be set ; ::_thesis: ( a in rng p implies a <> (Den (o,A)) . p )
assume that
A2: a in rng p and
A3: a = (Den (o,A)) . p ; ::_thesis: contradiction
reconsider p = p as FinSequence of A by A1, FINSEQ_1:def_11;
a in rng p by A2;
then reconsider a = a as Element of A ;
set G = Generators A;
consider n being Nat such that
A4: a in (Generators A) |^ n by Th30;
defpred S1[ Nat] means ex a being Element of A ex o being OperSymbol of A ex p being FinSequence of A st
( p in dom (Den (o,A)) & a in rng p & a = (Den (o,A)) . p & a in (Generators A) |^ $1 );
a in rng p by A2;
then A5: ex n being Nat st S1[n] by A1, A3, A4;
consider n being Nat such that
A6: ( S1[n] & ( for m being Nat st S1[m] holds
n <= m ) ) from NAT_1:sch_5(A5);
consider a being Element of A, o being OperSymbol of A, p being FinSequence of A such that
A7: p in dom (Den (o,A)) and
A8: a in rng p and
A9: a = (Den (o,A)) . p and
A10: a in (Generators A) |^ n by A6;
reconsider op = Den (o,A) as Element of Operations A ;
a in rng op by A7, A9, FUNCT_1:3;
then a nin Generators A by Th26;
then n <> 0 by A10, Th18;
then consider k being Nat such that
A11: n = k + 1 by NAT_1:6;
reconsider k = k as Element of NAT by ORDINAL1:def_12;
A12: k < n by A11, NAT_1:13;
then a nin (Generators A) |^ k by A6, A7, A8, A9;
then consider o9 being Element of dom the charact of A, p9 being Element of the carrier of A * such that
A13: a = (Den (o9,A)) . p9 and
A14: p9 in dom (Den (o9,A)) and
A15: rng p9 c= (Generators A) |^ k by A10, A11, Th20;
p9 = p by A7, A9, A13, A14, Th36;
hence contradiction by A6, A7, A8, A9, A12, A15; ::_thesis: verum
end;
theorem Th39: :: AOFA_000:39
for A being free Universal_Algebra
for G being GeneratorSet of A
for o being OperSymbol of A st ( for o9 being OperSymbol of A
for p being FinSequence st p in dom (Den (o9,A)) & (Den (o9,A)) . p in G holds
o9 <> o ) holds
for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in G |^ (n + 1) holds
rng p c= G |^ n
proof
let A be free Universal_Algebra; ::_thesis: for G being GeneratorSet of A
for o being OperSymbol of A st ( for o9 being OperSymbol of A
for p being FinSequence st p in dom (Den (o9,A)) & (Den (o9,A)) . p in G holds
o9 <> o ) holds
for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in G |^ (n + 1) holds
rng p c= G |^ n
let G be GeneratorSet of A; ::_thesis: for o being OperSymbol of A st ( for o9 being OperSymbol of A
for p being FinSequence st p in dom (Den (o9,A)) & (Den (o9,A)) . p in G holds
o9 <> o ) holds
for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in G |^ (n + 1) holds
rng p c= G |^ n
let o be OperSymbol of A; ::_thesis: ( ( for o9 being OperSymbol of A
for p being FinSequence st p in dom (Den (o9,A)) & (Den (o9,A)) . p in G holds
o9 <> o ) implies for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in G |^ (n + 1) holds
rng p c= G |^ n )
assume A1: for o9 being OperSymbol of A
for p being FinSequence st p in dom (Den (o9,A)) & (Den (o9,A)) . p in G holds
o9 <> o ; ::_thesis: for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in G |^ (n + 1) holds
rng p c= G |^ n
let p be FinSequence; ::_thesis: ( p in dom (Den (o,A)) implies for n being Nat st (Den (o,A)) . p in G |^ (n + 1) holds
rng p c= G |^ n )
assume A2: p in dom (Den (o,A)) ; ::_thesis: for n being Nat st (Den (o,A)) . p in G |^ (n + 1) holds
rng p c= G |^ n
let n be Nat; ::_thesis: ( (Den (o,A)) . p in G |^ (n + 1) implies rng p c= G |^ n )
assume that
A3: (Den (o,A)) . p in G |^ (n + 1) and
A4: not rng p c= G |^ n ; ::_thesis: contradiction
reconsider p = p as FinSequence of A by A2, FINSEQ_1:def_11;
defpred S1[ Nat] means ex p being FinSequence of A st
( p in dom (Den (o,A)) & (Den (o,A)) . p in G |^ ($1 + 1) & not rng p c= G |^ $1 );
p is FinSequence of A ;
then A5: ex n being Nat st S1[n] by A2, A3, A4;
consider n being Nat such that
A6: ( S1[n] & ( for m being Nat st S1[m] holds
n <= m ) ) from NAT_1:sch_5(A5);
consider p being FinSequence of A such that
A7: p in dom (Den (o,A)) and
A8: (Den (o,A)) . p in G |^ (n + 1) and
A9: not rng p c= G |^ n by A6;
set a = (Den (o,A)) . p;
now__::_thesis:_not_(Den_(o,A))_._p_in_G_|^_n
assume A10: (Den (o,A)) . p in G |^ n ; ::_thesis: contradiction
(Den (o,A)) . p nin G by A1, A7;
then n <> 0 by A10, Th18;
then consider k being Nat such that
A11: n = k + 1 by NAT_1:6;
reconsider k = k as Element of NAT by ORDINAL1:def_12;
A12: k < n by A11, NAT_1:13;
then G |^ k c= G |^ n by Th21;
then not rng p c= G |^ k by A9, XBOOLE_1:1;
hence contradiction by A6, A7, A10, A11, A12; ::_thesis: verum
end;
then ex o9 being Element of dom the charact of A ex p9 being Element of the carrier of A * st
( (Den (o,A)) . p = (Den (o9,A)) . p9 & p9 in dom (Den (o9,A)) & rng p9 c= G |^ n ) by A8, Th20;
hence contradiction by A7, A9, Th36; ::_thesis: verum
end;
theorem :: AOFA_000:40
for A being free Universal_Algebra
for o being OperSymbol of A
for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in (Generators A) |^ (n + 1) holds
rng p c= (Generators A) |^ n
proof
let A be free Universal_Algebra; ::_thesis: for o being OperSymbol of A
for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in (Generators A) |^ (n + 1) holds
rng p c= (Generators A) |^ n
set G = Generators A;
let o be OperSymbol of A; ::_thesis: for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in (Generators A) |^ (n + 1) holds
rng p c= (Generators A) |^ n
now__::_thesis:_for_o9_being_OperSymbol_of_A
for_p_being_FinSequence_st_p_in_dom_(Den_(o9,A))_&_(Den_(o9,A))_._p_in_Generators_A_holds_
o9_<>_o
let o9 be OperSymbol of A; ::_thesis: for p being FinSequence st p in dom (Den (o9,A)) & (Den (o9,A)) . p in Generators A holds
o9 <> o
let p be FinSequence; ::_thesis: ( p in dom (Den (o9,A)) & (Den (o9,A)) . p in Generators A implies o9 <> o )
reconsider op = Den (o9,A) as Element of Operations A ;
assume p in dom (Den (o9,A)) ; ::_thesis: ( (Den (o9,A)) . p in Generators A implies o9 <> o )
then op . p in rng op by FUNCT_1:3;
hence ( (Den (o9,A)) . p in Generators A implies o9 <> o ) by Th26; ::_thesis: verum
end;
hence for p being FinSequence st p in dom (Den (o,A)) holds
for n being Nat st (Den (o,A)) . p in (Generators A) |^ (n + 1) holds
rng p c= (Generators A) |^ n by Th39; ::_thesis: verum
end;
begin
definition
let S be non empty UAStr ;
attrS is with_empty-instruction means :Def10: :: AOFA_000:def 10
( 1 in dom the charact of S & the charact of S . 1 is non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of S *), the carrier of S );
attrS is with_catenation means :Def11: :: AOFA_000:def 11
( 2 in dom the charact of S & the charact of S . 2 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S );
attrS is with_if-instruction means :Def12: :: AOFA_000:def 12
( 3 in dom the charact of S & the charact of S . 3 is non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of S *), the carrier of S );
attrS is with_while-instruction means :Def13: :: AOFA_000:def 13
( 4 in dom the charact of S & the charact of S . 4 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S );
attrS is associative means :Def14: :: AOFA_000:def 14
the charact of S . 2 is non empty homogeneous quasi_total 2 -ary associative PartFunc of ( the carrier of S *), the carrier of S;
end;
:: deftheorem Def10 defines with_empty-instruction AOFA_000:def_10_:_
for S being non empty UAStr holds
( S is with_empty-instruction iff ( 1 in dom the charact of S & the charact of S . 1 is non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of S *), the carrier of S ) );
:: deftheorem Def11 defines with_catenation AOFA_000:def_11_:_
for S being non empty UAStr holds
( S is with_catenation iff ( 2 in dom the charact of S & the charact of S . 2 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S ) );
:: deftheorem Def12 defines with_if-instruction AOFA_000:def_12_:_
for S being non empty UAStr holds
( S is with_if-instruction iff ( 3 in dom the charact of S & the charact of S . 3 is non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of S *), the carrier of S ) );
:: deftheorem Def13 defines with_while-instruction AOFA_000:def_13_:_
for S being non empty UAStr holds
( S is with_while-instruction iff ( 4 in dom the charact of S & the charact of S . 4 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S ) );
:: deftheorem Def14 defines associative AOFA_000:def_14_:_
for S being non empty UAStr holds
( S is associative iff the charact of S . 2 is non empty homogeneous quasi_total 2 -ary associative PartFunc of ( the carrier of S *), the carrier of S );
definition
let S be non-empty UAStr ;
attrS is unital means :Def15: :: AOFA_000:def 15
ex f being non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S st
( f = the charact of S . 2 & (Den ((In (1,(dom the charact of S))),S)) . {} is_a_unity_wrt f );
end;
:: deftheorem Def15 defines unital AOFA_000:def_15_:_
for S being non-empty UAStr holds
( S is unital iff ex f being non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S st
( f = the charact of S . 2 & (Den ((In (1,(dom the charact of S))),S)) . {} is_a_unity_wrt f ) );
theorem Th41: :: AOFA_000:41
for X being non empty set
for x being Element of X
for c being non empty homogeneous quasi_total 2 -ary associative unital PartFunc of (X *),X st x is_a_unity_wrt c holds
for i being non empty homogeneous quasi_total 3 -ary PartFunc of (X *),X
for w being non empty homogeneous quasi_total 2 -ary PartFunc of (X *),X ex S being strict non-empty UAStr st
( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
proof
let X be non empty set ; ::_thesis: for x being Element of X
for c being non empty homogeneous quasi_total 2 -ary associative unital PartFunc of (X *),X st x is_a_unity_wrt c holds
for i being non empty homogeneous quasi_total 3 -ary PartFunc of (X *),X
for w being non empty homogeneous quasi_total 2 -ary PartFunc of (X *),X ex S being strict non-empty UAStr st
( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
let x be Element of X; ::_thesis: for c being non empty homogeneous quasi_total 2 -ary associative unital PartFunc of (X *),X st x is_a_unity_wrt c holds
for i being non empty homogeneous quasi_total 3 -ary PartFunc of (X *),X
for w being non empty homogeneous quasi_total 2 -ary PartFunc of (X *),X ex S being strict non-empty UAStr st
( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
let c be non empty homogeneous quasi_total 2 -ary associative unital PartFunc of (X *),X; ::_thesis: ( x is_a_unity_wrt c implies for i being non empty homogeneous quasi_total 3 -ary PartFunc of (X *),X
for w being non empty homogeneous quasi_total 2 -ary PartFunc of (X *),X ex S being strict non-empty UAStr st
( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial ) )
assume A1: x is_a_unity_wrt c ; ::_thesis: for i being non empty homogeneous quasi_total 3 -ary PartFunc of (X *),X
for w being non empty homogeneous quasi_total 2 -ary PartFunc of (X *),X ex S being strict non-empty UAStr st
( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
let i be non empty homogeneous quasi_total 3 -ary PartFunc of (X *),X; ::_thesis: for w being non empty homogeneous quasi_total 2 -ary PartFunc of (X *),X ex S being strict non-empty UAStr st
( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
let w be non empty homogeneous quasi_total 2 -ary PartFunc of (X *),X; ::_thesis: ex S being strict non-empty UAStr st
( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
set Y = 0 -tuples_on X;
set e = (0 -tuples_on X) --> x;
reconsider e = (0 -tuples_on X) --> x as non empty homogeneous quasi_total 0 -ary PartFunc of (X *),X ;
set char = <*e,c*> ^ <*i,w*>;
<*e,c*> ^ <*i,w*> is PFuncFinSequence of X
proof
let a be set ; :: according to TARSKI:def_3,FINSEQ_1:def_4 ::_thesis: ( a nin rng (<*e,c*> ^ <*i,w*>) or not a nin PFuncs ((X *),X) )
assume a in rng (<*e,c*> ^ <*i,w*>) ; ::_thesis: not a nin PFuncs ((X *),X)
then a in (rng <*e,c*>) \/ (rng <*i,w*>) by FINSEQ_1:31;
then ( a in rng <*e,c*> or a in rng <*i,w*> ) by XBOOLE_0:def_3;
then ( a in {e,c} or a in {i,w} ) by FINSEQ_2:127;
then ( a = e or a = c or a = i or a = w ) by TARSKI:def_2;
hence not a nin PFuncs ((X *),X) by PARTFUN1:45; ::_thesis: verum
end;
then reconsider char = <*e,c*> ^ <*i,w*> as non empty non-empty PFuncFinSequence of X ;
reconsider S = UAStr(# X,char #) as strict non-empty UAStr by UNIALG_1:def_3;
take S ; ::_thesis: ( the carrier of S = X & the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
thus the carrier of S = X ; ::_thesis: ( the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
thus the charact of S = <*((0 -tuples_on X) --> x),c*> ^ <*i,w*> ; ::_thesis: ( S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
A2: len <*e,c*> = 2 by FINSEQ_1:44;
len <*i,w*> = 2 by FINSEQ_1:44;
then len char = 2 + 2 by A2, FINSEQ_1:22;
then A3: dom char = Seg 4 by FINSEQ_1:def_3;
reconsider e = e as non empty homogeneous 0 -ary PartFunc of ( the carrier of S *), the carrier of S ;
reconsider c = c as non empty homogeneous quasi_total 2 -ary associative PartFunc of ( the carrier of S *), the carrier of S ;
A4: <*e,c*> . 1 = e by FINSEQ_1:44;
A5: <*e,c*> . 2 = c by FINSEQ_1:44;
A6: <*i,w*> . 1 = i by FINSEQ_1:44;
A7: <*i,w*> . 2 = w by FINSEQ_1:44;
thus 1 in dom the charact of S by A3; :: according to AOFA_000:def_10 ::_thesis: ( the charact of S . 1 is non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of S *), the carrier of S & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
A8: dom <*e,c*> = Seg 2 by FINSEQ_1:89;
then A9: 1 in dom <*e,c*> ;
A10: 2 in dom <*e,c*> by A8;
A11: e = the charact of S . 1 by A4, A9, FINSEQ_1:def_7;
A12: c = the charact of S . 2 by A5, A10, FINSEQ_1:def_7;
thus the charact of S . 1 is non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of S *), the carrier of S by A4, A9, FINSEQ_1:def_7; ::_thesis: ( S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
thus 2 in dom the charact of S by A3; :: according to AOFA_000:def_11 ::_thesis: ( the charact of S . 2 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
thus the charact of S . 2 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S by A5, A10, FINSEQ_1:def_7; ::_thesis: ( S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
thus S is unital ::_thesis: ( S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
proof
take c ; :: according to AOFA_000:def_15 ::_thesis: ( c = the charact of S . 2 & (Den ((In (1,(dom the charact of S))),S)) . {} is_a_unity_wrt c )
thus c = the charact of S . 2 by A5, A10, FINSEQ_1:def_7; ::_thesis: (Den ((In (1,(dom the charact of S))),S)) . {} is_a_unity_wrt c
A13: 1 in dom the charact of S by A3;
A14: 0 -tuples_on X = {{}} by COMPUT_1:5;
A15: In (1,(dom the charact of S)) = 1 by A13, FUNCT_7:def_1;
A16: {} in 0 -tuples_on X by A14, TARSKI:def_1;
e = Den ((In (1,(dom the charact of S))),S) by A4, A9, A15, FINSEQ_1:def_7;
hence (Den ((In (1,(dom the charact of S))),S)) . {} is_a_unity_wrt c by A1, A16, FUNCOP_1:7; ::_thesis: verum
end;
thus the charact of S . 2 is non empty homogeneous quasi_total 2 -ary associative PartFunc of ( the carrier of S *), the carrier of S by A5, A10, FINSEQ_1:def_7; :: according to AOFA_000:def_14 ::_thesis: ( S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial )
thus 3 in dom the charact of S by A3; :: according to AOFA_000:def_12 ::_thesis: ( the charact of S . 3 is non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of S *), the carrier of S & S is with_while-instruction & S is quasi_total & S is partial )
A17: dom <*i,w*> = Seg 2 by FINSEQ_1:89;
then A18: 1 in dom <*i,w*> ;
A19: 2 in dom <*i,w*> by A17;
A20: char . (2 + 1) = i by A2, A6, A18, FINSEQ_1:def_7;
A21: char . (2 + 2) = w by A2, A7, A19, FINSEQ_1:def_7;
thus the charact of S . 3 is non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of S *), the carrier of S by A20; ::_thesis: ( S is with_while-instruction & S is quasi_total & S is partial )
thus 4 in dom the charact of S by A3; :: according to AOFA_000:def_13 ::_thesis: ( the charact of S . 4 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S & S is quasi_total & S is partial )
thus the charact of S . 4 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of S *), the carrier of S by A2, A7, A19, FINSEQ_1:def_7; ::_thesis: ( S is quasi_total & S is partial )
thus S is quasi_total ::_thesis: S is partial
proof
let i be Nat; :: according to UNIALG_1:def_2,MARGREL1:def_24 ::_thesis: for b1 being Element of bool [:( the carrier of S *), the carrier of S:] holds
( i nin dom the charact of S or not b1 = the charact of S . i or b1 is quasi_total )
let h be PartFunc of ( the carrier of S *), the carrier of S; ::_thesis: ( i nin dom the charact of S or not h = the charact of S . i or h is quasi_total )
assume i in dom the charact of S ; ::_thesis: ( not h = the charact of S . i or h is quasi_total )
hence ( not h = the charact of S . i or h is quasi_total ) by A3, A11, A12, A20, A21, ENUMSET1:def_2, FINSEQ_3:2; ::_thesis: verum
end;
let i be Nat; :: according to UNIALG_1:def_1,MARGREL1:def_23 ::_thesis: for b1 being Element of bool [:( the carrier of S *), the carrier of S:] holds
( i nin dom the charact of S or not b1 = the charact of S . i or b1 is homogeneous )
let h be PartFunc of ( the carrier of S *), the carrier of S; ::_thesis: ( i nin dom the charact of S or not h = the charact of S . i or h is homogeneous )
assume that
A22: i in dom the charact of S and
A23: h = the charact of S . i ; ::_thesis: h is homogeneous
let p1, p2 be FinSequence; :: according to MARGREL1:def_1,MARGREL1:def_21 ::_thesis: ( p1 nin dom h or p2 nin dom h or len p1 = len p2 )
( i = 1 or i = 2 or i = 3 or i = 4 ) by A3, A22, ENUMSET1:def_2, FINSEQ_3:2;
hence ( p1 nin dom h or p2 nin dom h or len p1 = len p2 ) by A11, A12, A20, A21, A23, MARGREL1:def_1; ::_thesis: verum
end;
registration
cluster non empty strict partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction associative unital for UAStr ;
existence
ex b1 being strict partial quasi_total non-empty UAStr st
( b1 is with_empty-instruction & b1 is with_catenation & b1 is with_if-instruction & b1 is with_while-instruction & b1 is unital & b1 is associative )
proof
set c = the non empty homogeneous quasi_total 2 -ary associative unital PartFunc of ({{}} *),{{}};
set a = the Element of {{}};
consider x being set such that
A1: x is_a_unity_wrt the non empty homogeneous quasi_total 2 -ary associative unital PartFunc of ({{}} *),{{}} by Def3;
arity the non empty homogeneous quasi_total 2 -ary associative unital PartFunc of ({{}} *),{{}} = 2 by COMPUT_1:def_21;
then A2: dom the non empty homogeneous quasi_total 2 -ary associative unital PartFunc of ({{}} *),{{}} = 2 -tuples_on {{}} by COMPUT_1:22;
then <* the Element of {{}}, the Element of {{}}*> in dom the non empty homogeneous quasi_total 2 -ary associative unital PartFunc of ({{}} *),{{}} by FINSEQ_2:137;
then <* the Element of {{}},x*> in dom the non empty homogeneous quasi_total 2 -ary associative unital PartFunc of ({{}} *),{{}} by A1, Def1;
then reconsider x = x as Element of {{}} by A2, FINSEQ_2:138;
set i = the non empty homogeneous quasi_total 3 -ary PartFunc of ({{}} *),{{}};
set w = the non empty homogeneous quasi_total 2 -ary PartFunc of ({{}} *),{{}};
ex S being strict non-empty UAStr st
( the carrier of S = {{}} & the charact of S = <*((0 -tuples_on {{}}) --> x), the non empty homogeneous quasi_total 2 -ary associative unital PartFunc of ({{}} *),{{}}*> ^ <* the non empty homogeneous quasi_total 3 -ary PartFunc of ({{}} *),{{}}, the non empty homogeneous quasi_total 2 -ary PartFunc of ({{}} *),{{}}*> & S is with_empty-instruction & S is with_catenation & S is unital & S is associative & S is with_if-instruction & S is with_while-instruction & S is quasi_total & S is partial ) by A1, Th41;
hence ex b1 being strict partial quasi_total non-empty UAStr st
( b1 is with_empty-instruction & b1 is with_catenation & b1 is with_if-instruction & b1 is with_while-instruction & b1 is unital & b1 is associative ) ; ::_thesis: verum
end;
end;
definition
mode preIfWhileAlgebra is with_empty-instruction with_catenation with_if-instruction with_while-instruction Universal_Algebra;
end;
definition
let A be non empty UAStr ;
mode Algorithm of A is Element of A;
end;
theorem Th42: :: AOFA_000:42
for A being non-empty with_empty-instruction UAStr holds dom (Den ((In (1,(dom the charact of A))),A)) = {{}}
proof
let A be non-empty with_empty-instruction UAStr ; ::_thesis: dom (Den ((In (1,(dom the charact of A))),A)) = {{}}
reconsider e = the charact of A . 1 as non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of A *), the carrier of A by Def10;
1 in dom the charact of A by Def10;
then A1: Den ((In (1,(dom the charact of A))),A) = e by FUNCT_7:def_1;
arity e = 0 by COMPUT_1:def_21;
then dom e = 0 -tuples_on the carrier of A by COMPUT_1:22;
hence dom (Den ((In (1,(dom the charact of A))),A)) = {{}} by A1, COMPUT_1:5; ::_thesis: verum
end;
definition
let A be non-empty with_empty-instruction UAStr ;
func EmptyIns A -> Algorithm of A equals :: AOFA_000:def 16
(Den ((In (1,(dom the charact of A))),A)) . {};
coherence
(Den ((In (1,(dom the charact of A))),A)) . {} is Algorithm of A
proof
reconsider e = the charact of A . 1 as non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of A *), the carrier of A by Def10;
1 in dom the charact of A by Def10;
then A1: Den ((In (1,(dom the charact of A))),A) = e by FUNCT_7:def_1;
then dom e = {{}} by Th42;
then {} in dom e by TARSKI:def_1;
hence (Den ((In (1,(dom the charact of A))),A)) . {} is Algorithm of A by A1, PARTFUN1:4; ::_thesis: verum
end;
end;
:: deftheorem defines EmptyIns AOFA_000:def_16_:_
for A being non-empty with_empty-instruction UAStr holds EmptyIns A = (Den ((In (1,(dom the charact of A))),A)) . {};
theorem :: AOFA_000:43
for A being with_empty-instruction Universal_Algebra
for o being Element of Operations A st o = Den ((In (1,(dom the charact of A))),A) holds
( arity o = 0 & EmptyIns A in rng o )
proof
let A be with_empty-instruction Universal_Algebra; ::_thesis: for o being Element of Operations A st o = Den ((In (1,(dom the charact of A))),A) holds
( arity o = 0 & EmptyIns A in rng o )
let o be Element of Operations A; ::_thesis: ( o = Den ((In (1,(dom the charact of A))),A) implies ( arity o = 0 & EmptyIns A in rng o ) )
assume A1: o = Den ((In (1,(dom the charact of A))),A) ; ::_thesis: ( arity o = 0 & EmptyIns A in rng o )
A2: dom (Den ((In (1,(dom the charact of A))),A)) = {{}} by Th42;
A3: <*> the carrier of A in {{}} by TARSKI:def_1;
hence arity o = len (<*> the carrier of A) by A1, A2, MARGREL1:def_25
.= 0 ;
::_thesis: EmptyIns A in rng o
thus EmptyIns A in rng o by A1, A2, A3, FUNCT_1:def_3; ::_thesis: verum
end;
theorem Th44: :: AOFA_000:44
for A being non-empty with_catenation UAStr holds dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A
proof
let A be non-empty with_catenation UAStr ; ::_thesis: dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A
reconsider f = the charact of A . 2 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of A *), the carrier of A by Def11;
2 in dom the charact of A by Def11;
then A1: Den ((In (2,(dom the charact of A))),A) = f by FUNCT_7:def_1;
arity f = 2 by COMPUT_1:def_21;
hence dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by A1, COMPUT_1:22; ::_thesis: verum
end;
definition
let A be non-empty with_catenation UAStr ;
let I1, I2 be Algorithm of A;
funcI1 \; I2 -> Algorithm of A equals :: AOFA_000:def 17
(Den ((In (2,(dom the charact of A))),A)) . <*I1,I2*>;
coherence
(Den ((In (2,(dom the charact of A))),A)) . <*I1,I2*> is Algorithm of A
proof
reconsider f = the charact of A . 2 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of A *), the carrier of A by Def11;
2 in dom the charact of A by Def11;
then A1: Den ((In (2,(dom the charact of A))),A) = f by FUNCT_7:def_1;
then dom f = 2 -tuples_on the carrier of A by Th44;
then <*I1,I2*> in dom f by FINSEQ_2:137;
hence (Den ((In (2,(dom the charact of A))),A)) . <*I1,I2*> is Algorithm of A by A1, PARTFUN1:4; ::_thesis: verum
end;
end;
:: deftheorem defines \; AOFA_000:def_17_:_
for A being non-empty with_catenation UAStr
for I1, I2 being Algorithm of A holds I1 \; I2 = (Den ((In (2,(dom the charact of A))),A)) . <*I1,I2*>;
theorem :: AOFA_000:45
for A being non-empty with_empty-instruction with_catenation unital UAStr
for I being Element of A holds
( (EmptyIns A) \; I = I & I \; (EmptyIns A) = I )
proof
let A be non-empty with_empty-instruction with_catenation unital UAStr ; ::_thesis: for I being Element of A holds
( (EmptyIns A) \; I = I & I \; (EmptyIns A) = I )
let I be Element of A; ::_thesis: ( (EmptyIns A) \; I = I & I \; (EmptyIns A) = I )
consider f being non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of A *), the carrier of A such that
A1: f = the charact of A . 2 and
A2: (Den ((In (1,(dom the charact of A))),A)) . {} is_a_unity_wrt f by Def15;
A3: 2 in dom the charact of A by Def11;
arity f = 2 by COMPUT_1:def_21;
then A4: dom f = 2 -tuples_on the carrier of A by COMPUT_1:22;
A5: In (2,(dom the charact of A)) = 2 by A3, FUNCT_7:def_1;
<*I,I*> in dom f by A4, FINSEQ_2:137;
hence ( (EmptyIns A) \; I = I & I \; (EmptyIns A) = I ) by A1, A2, A5, Def1; ::_thesis: verum
end;
theorem :: AOFA_000:46
for A being non-empty with_catenation associative UAStr
for I1, I2, I3 being Element of A holds (I1 \; I2) \; I3 = I1 \; (I2 \; I3)
proof
let A be non-empty with_catenation associative UAStr ; ::_thesis: for I1, I2, I3 being Element of A holds (I1 \; I2) \; I3 = I1 \; (I2 \; I3)
let I1, I2, I3 be Element of A; ::_thesis: (I1 \; I2) \; I3 = I1 \; (I2 \; I3)
reconsider f = the charact of A . 2 as non empty homogeneous quasi_total 2 -ary associative PartFunc of ( the carrier of A *), the carrier of A by Def14;
A1: 2 in dom the charact of A by Def11;
arity f = 2 by COMPUT_1:def_21;
then A2: dom f = 2 -tuples_on the carrier of A by COMPUT_1:22;
A3: In (2,(dom the charact of A)) = 2 by A1, FUNCT_7:def_1;
A4: <*I1,I2*> in dom f by A2, FINSEQ_2:137;
A5: <*I2,I3*> in dom f by A2, FINSEQ_2:137;
A6: <*I1,(I2 \; I3)*> in dom f by A2, FINSEQ_2:137;
<*(I1 \; I2),I3*> in dom f by A2, FINSEQ_2:137;
hence (I1 \; I2) \; I3 = I1 \; (I2 \; I3) by A3, A4, A5, A6, Def2; ::_thesis: verum
end;
theorem Th47: :: AOFA_000:47
for A being non-empty with_if-instruction UAStr holds dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A
proof
let A be non-empty with_if-instruction UAStr ; ::_thesis: dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A
reconsider f = the charact of A . 3 as non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of A *), the carrier of A by Def12;
3 in dom the charact of A by Def12;
then A1: Den ((In (3,(dom the charact of A))),A) = f by FUNCT_7:def_1;
arity f = 3 by COMPUT_1:def_21;
hence dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A by A1, COMPUT_1:22; ::_thesis: verum
end;
definition
let A be non-empty with_if-instruction UAStr ;
let C, I1, I2 be Algorithm of A;
func if-then-else (C,I1,I2) -> Algorithm of A equals :: AOFA_000:def 18
(Den ((In (3,(dom the charact of A))),A)) . <*C,I1,I2*>;
coherence
(Den ((In (3,(dom the charact of A))),A)) . <*C,I1,I2*> is Algorithm of A
proof
reconsider f = the charact of A . 3 as non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of A *), the carrier of A by Def12;
3 in dom the charact of A by Def12;
then A1: Den ((In (3,(dom the charact of A))),A) = f by FUNCT_7:def_1;
arity f = 3 by COMPUT_1:def_21;
then dom f = 3 -tuples_on the carrier of A by COMPUT_1:22;
then <*C,I1,I2*> in dom f by FINSEQ_2:139;
hence (Den ((In (3,(dom the charact of A))),A)) . <*C,I1,I2*> is Algorithm of A by A1, PARTFUN1:4; ::_thesis: verum
end;
end;
:: deftheorem defines if-then-else AOFA_000:def_18_:_
for A being non-empty with_if-instruction UAStr
for C, I1, I2 being Algorithm of A holds if-then-else (C,I1,I2) = (Den ((In (3,(dom the charact of A))),A)) . <*C,I1,I2*>;
definition
let A be non-empty with_empty-instruction with_if-instruction UAStr ;
let C, I be Algorithm of A;
func if-then (C,I) -> Algorithm of A equals :: AOFA_000:def 19
if-then-else (C,I,(EmptyIns A));
coherence
if-then-else (C,I,(EmptyIns A)) is Algorithm of A ;
end;
:: deftheorem defines if-then AOFA_000:def_19_:_
for A being non-empty with_empty-instruction with_if-instruction UAStr
for C, I being Algorithm of A holds if-then (C,I) = if-then-else (C,I,(EmptyIns A));
theorem Th48: :: AOFA_000:48
for A being non-empty with_while-instruction UAStr holds dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A
proof
let A be non-empty with_while-instruction UAStr ; ::_thesis: dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A
reconsider f = the charact of A . 4 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of A *), the carrier of A by Def13;
4 in dom the charact of A by Def13;
then A1: Den ((In (4,(dom the charact of A))),A) = f by FUNCT_7:def_1;
arity f = 2 by COMPUT_1:def_21;
hence dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by A1, COMPUT_1:22; ::_thesis: verum
end;
definition
let A be non-empty with_while-instruction UAStr ;
let C, I be Algorithm of A;
func while (C,I) -> Algorithm of A equals :: AOFA_000:def 20
(Den ((In (4,(dom the charact of A))),A)) . <*C,I*>;
coherence
(Den ((In (4,(dom the charact of A))),A)) . <*C,I*> is Algorithm of A
proof
reconsider f = the charact of A . 4 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of A *), the carrier of A by Def13;
4 in dom the charact of A by Def13;
then A1: Den ((In (4,(dom the charact of A))),A) = f by FUNCT_7:def_1;
arity f = 2 by COMPUT_1:def_21;
then dom f = 2 -tuples_on the carrier of A by COMPUT_1:22;
then <*C,I*> in dom f by FINSEQ_2:137;
hence (Den ((In (4,(dom the charact of A))),A)) . <*C,I*> is Algorithm of A by A1, PARTFUN1:4; ::_thesis: verum
end;
end;
:: deftheorem defines while AOFA_000:def_20_:_
for A being non-empty with_while-instruction UAStr
for C, I being Algorithm of A holds while (C,I) = (Den ((In (4,(dom the charact of A))),A)) . <*C,I*>;
definition
let A be preIfWhileAlgebra;
let I0, C, I, J be Element of A;
func for-do (I0,C,J,I) -> Element of A equals :: AOFA_000:def 21
I0 \; (while (C,(I \; J)));
coherence
I0 \; (while (C,(I \; J))) is Element of A ;
end;
:: deftheorem defines for-do AOFA_000:def_21_:_
for A being preIfWhileAlgebra
for I0, C, I, J being Element of A holds for-do (I0,C,J,I) = I0 \; (while (C,(I \; J)));
definition
let A be preIfWhileAlgebra;
func ElementaryInstructions A -> Subset of A equals :: AOFA_000:def 22
((( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A)))) \ (rng (Den ((In (4,(dom the charact of A))),A)))) \ { (I1 \; I2) where I1, I2 is Algorithm of A : ( I1 <> I1 \; I2 & I2 <> I1 \; I2 ) } ;
coherence
((( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A)))) \ (rng (Den ((In (4,(dom the charact of A))),A)))) \ { (I1 \; I2) where I1, I2 is Algorithm of A : ( I1 <> I1 \; I2 & I2 <> I1 \; I2 ) } is Subset of A ;
end;
:: deftheorem defines ElementaryInstructions AOFA_000:def_22_:_
for A being preIfWhileAlgebra holds ElementaryInstructions A = ((( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A)))) \ (rng (Den ((In (4,(dom the charact of A))),A)))) \ { (I1 \; I2) where I1, I2 is Algorithm of A : ( I1 <> I1 \; I2 & I2 <> I1 \; I2 ) } ;
theorem Th49: :: AOFA_000:49
for A being preIfWhileAlgebra holds EmptyIns A nin ElementaryInstructions A
proof
let A be preIfWhileAlgebra; ::_thesis: EmptyIns A nin ElementaryInstructions A
set I = EmptyIns A;
EmptyIns A in {(EmptyIns A)} by TARSKI:def_1;
then EmptyIns A nin the carrier of A \ {(EmptyIns A)} by XBOOLE_0:def_5;
then EmptyIns A nin ( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A))) by XBOOLE_0:def_5;
then EmptyIns A nin (( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A)))) \ (rng (Den ((In (4,(dom the charact of A))),A))) by XBOOLE_0:def_5;
hence EmptyIns A nin ElementaryInstructions A by XBOOLE_0:def_5; ::_thesis: verum
end;
theorem Th50: :: AOFA_000:50
for A being preIfWhileAlgebra
for I1, I2 being Element of A st I1 <> I1 \; I2 & I2 <> I1 \; I2 holds
I1 \; I2 nin ElementaryInstructions A
proof
let A be preIfWhileAlgebra; ::_thesis: for I1, I2 being Element of A st I1 <> I1 \; I2 & I2 <> I1 \; I2 holds
I1 \; I2 nin ElementaryInstructions A
let I1, I2 be Element of A; ::_thesis: ( I1 <> I1 \; I2 & I2 <> I1 \; I2 implies I1 \; I2 nin ElementaryInstructions A )
assume that
A1: I1 <> I1 \; I2 and
A2: I2 <> I1 \; I2 ; ::_thesis: I1 \; I2 nin ElementaryInstructions A
I1 \; I2 in { (J1 \; J2) where J1, J2 is Algorithm of A : ( J1 <> J1 \; J2 & J2 <> J1 \; J2 ) } by A1, A2;
hence I1 \; I2 nin ElementaryInstructions A by XBOOLE_0:def_5; ::_thesis: verum
end;
theorem Th51: :: AOFA_000:51
for A being preIfWhileAlgebra
for C, I1, I2 being Element of A holds if-then-else (C,I1,I2) nin ElementaryInstructions A
proof
let A be preIfWhileAlgebra; ::_thesis: for C, I1, I2 being Element of A holds if-then-else (C,I1,I2) nin ElementaryInstructions A
let C, I1, I2 be Element of A; ::_thesis: if-then-else (C,I1,I2) nin ElementaryInstructions A
set I = if-then-else (C,I1,I2);
reconsider f = the charact of A . 3 as non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of A *), the carrier of A by Def12;
3 in dom the charact of A by Def12;
then In (3,(dom the charact of A)) = 3 by FUNCT_7:def_1;
then dom (Den ((In (3,(dom the charact of A))),A)) = (arity f) -tuples_on the carrier of A by COMPUT_1:22
.= 3 -tuples_on the carrier of A by COMPUT_1:def_21 ;
then <*C,I1,I2*> in dom (Den ((In (3,(dom the charact of A))),A)) by FINSEQ_2:139;
then if-then-else (C,I1,I2) in rng (Den ((In (3,(dom the charact of A))),A)) by FUNCT_1:def_3;
then if-then-else (C,I1,I2) nin ( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A))) by XBOOLE_0:def_5;
then if-then-else (C,I1,I2) nin (( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A)))) \ (rng (Den ((In (4,(dom the charact of A))),A))) by XBOOLE_0:def_5;
hence if-then-else (C,I1,I2) nin ElementaryInstructions A by XBOOLE_0:def_5; ::_thesis: verum
end;
theorem Th52: :: AOFA_000:52
for A being preIfWhileAlgebra
for C, I being Element of A holds while (C,I) nin ElementaryInstructions A
proof
let A be preIfWhileAlgebra; ::_thesis: for C, I being Element of A holds while (C,I) nin ElementaryInstructions A
let C, I1 be Element of A; ::_thesis: while (C,I1) nin ElementaryInstructions A
set I = while (C,I1);
reconsider f = the charact of A . 4 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of A *), the carrier of A by Def13;
4 in dom the charact of A by Def13;
then In (4,(dom the charact of A)) = 4 by FUNCT_7:def_1;
then dom (Den ((In (4,(dom the charact of A))),A)) = (arity f) -tuples_on the carrier of A by COMPUT_1:22
.= 2 -tuples_on the carrier of A by COMPUT_1:def_21 ;
then <*C,I1*> in dom (Den ((In (4,(dom the charact of A))),A)) by FINSEQ_2:137;
then while (C,I1) in rng (Den ((In (4,(dom the charact of A))),A)) by FUNCT_1:def_3;
then while (C,I1) nin (( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A)))) \ (rng (Den ((In (4,(dom the charact of A))),A))) by XBOOLE_0:def_5;
hence while (C,I1) nin ElementaryInstructions A by XBOOLE_0:def_5; ::_thesis: verum
end;
theorem Th53: :: AOFA_000:53
for A being preIfWhileAlgebra
for I being Element of A holds
( not I nin ElementaryInstructions A or I = EmptyIns A or ex I1, I2 being Element of A st
( I = I1 \; I2 & I1 <> I1 \; I2 & I2 <> I1 \; I2 ) or ex C, I1, I2 being Element of A st I = if-then-else (C,I1,I2) or ex C, J being Element of A st I = while (C,J) )
proof
let A be preIfWhileAlgebra; ::_thesis: for I being Element of A holds
( not I nin ElementaryInstructions A or I = EmptyIns A or ex I1, I2 being Element of A st
( I = I1 \; I2 & I1 <> I1 \; I2 & I2 <> I1 \; I2 ) or ex C, I1, I2 being Element of A st I = if-then-else (C,I1,I2) or ex C, J being Element of A st I = while (C,J) )
let I be Element of A; ::_thesis: ( not I nin ElementaryInstructions A or I = EmptyIns A or ex I1, I2 being Element of A st
( I = I1 \; I2 & I1 <> I1 \; I2 & I2 <> I1 \; I2 ) or ex C, I1, I2 being Element of A st I = if-then-else (C,I1,I2) or ex C, J being Element of A st I = while (C,J) )
assume that
A1: I nin ElementaryInstructions A and
A2: I <> EmptyIns A and
A3: for I1, I2 being Element of A st I = I1 \; I2 & I1 <> I1 \; I2 holds
I2 = I1 \; I2 and
A4: for C, I1, I2 being Element of A holds I <> if-then-else (C,I1,I2) and
A5: for C, J being Element of A holds I <> while (C,J) ; ::_thesis: contradiction
A6: now__::_thesis:_not_I_in_rng_(Den_((In_(3,(dom_the_charact_of_A))),A))
assume I in rng (Den ((In (3,(dom the charact of A))),A)) ; ::_thesis: contradiction
then consider x being set such that
A7: x in dom (Den ((In (3,(dom the charact of A))),A)) and
A8: I = (Den ((In (3,(dom the charact of A))),A)) . x by FUNCT_1:def_3;
reconsider f = the charact of A . 3 as non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of A *), the carrier of A by Def12;
3 in dom the charact of A by Def12;
then In (3,(dom the charact of A)) = 3 by FUNCT_7:def_1;
then dom (Den ((In (3,(dom the charact of A))),A)) = (arity f) -tuples_on the carrier of A by COMPUT_1:22
.= 3 -tuples_on the carrier of A by COMPUT_1:def_21 ;
then consider C, I1, I2 being set such that
A9: C in the carrier of A and
A10: I1 in the carrier of A and
A11: I2 in the carrier of A and
A12: x = <*C,I1,I2*> by A7, FINSEQ_2:139;
reconsider C = C, I1 = I1, I2 = I2 as Element of A by A9, A10, A11;
I = if-then-else (C,I1,I2) by A8, A12;
hence contradiction by A4; ::_thesis: verum
end;
A13: now__::_thesis:_not_I_in_rng_(Den_((In_(4,(dom_the_charact_of_A))),A))
assume I in rng (Den ((In (4,(dom the charact of A))),A)) ; ::_thesis: contradiction
then consider x being set such that
A14: x in dom (Den ((In (4,(dom the charact of A))),A)) and
A15: I = (Den ((In (4,(dom the charact of A))),A)) . x by FUNCT_1:def_3;
reconsider f = the charact of A . 4 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of A *), the carrier of A by Def13;
4 in dom the charact of A by Def13;
then In (4,(dom the charact of A)) = 4 by FUNCT_7:def_1;
then dom (Den ((In (4,(dom the charact of A))),A)) = (arity f) -tuples_on the carrier of A by COMPUT_1:22
.= 2 -tuples_on the carrier of A by COMPUT_1:def_21 ;
then consider C, J being set such that
A16: C in the carrier of A and
A17: J in the carrier of A and
A18: x = <*C,J*> by A14, FINSEQ_2:137;
reconsider C = C, J = J as Element of A by A16, A17;
I = while (C,J) by A15, A18;
hence contradiction by A5; ::_thesis: verum
end;
A19: I nin { (I1 \; I2) where I1, I2 is Algorithm of A : ( I1 <> I1 \; I2 & I2 <> I1 \; I2 ) } by A3;
I in the carrier of A \ {(EmptyIns A)} by A2, ZFMISC_1:56;
then I in ( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A))) by A6, XBOOLE_0:def_5;
then I in (( the carrier of A \ {(EmptyIns A)}) \ (rng (Den ((In (3,(dom the charact of A))),A)))) \ (rng (Den ((In (4,(dom the charact of A))),A))) by A13, XBOOLE_0:def_5;
hence contradiction by A1, A19, XBOOLE_0:def_5; ::_thesis: verum
end;
definition
let A be preIfWhileAlgebra;
attrA is infinite means :Def23: :: AOFA_000:def 23
ElementaryInstructions A is infinite ;
attrA is degenerated means :Def24: :: AOFA_000:def 24
( ex I1, I2 being Element of A st
( ( I1 <> EmptyIns A & I1 \; I2 = I2 ) or ( I2 <> EmptyIns A & I1 \; I2 = I1 ) or ( ( I1 <> EmptyIns A or I2 <> EmptyIns A ) & I1 \; I2 = EmptyIns A ) ) or ex C, I1, I2 being Element of A st if-then-else (C,I1,I2) = EmptyIns A or ex C, I being Element of A st while (C,I) = EmptyIns A or ex I1, I2, C, J1, J2 being Element of A st
( I1 <> EmptyIns A & I2 <> EmptyIns A & I1 \; I2 = if-then-else (C,J1,J2) ) or ex I1, I2, C, J being Element of A st
( I1 <> EmptyIns A & I2 <> EmptyIns A & I1 \; I2 = while (C,J) ) or ex C1, I1, I2, C2, J being Element of A st if-then-else (C1,I1,I2) = while (C2,J) );
attrA is well_founded means :Def25: :: AOFA_000:def 25
ElementaryInstructions A is GeneratorSet of A;
end;
:: deftheorem Def23 defines infinite AOFA_000:def_23_:_
for A being preIfWhileAlgebra holds
( A is infinite iff ElementaryInstructions A is infinite );
:: deftheorem Def24 defines degenerated AOFA_000:def_24_:_
for A being preIfWhileAlgebra holds
( A is degenerated iff ( ex I1, I2 being Element of A st
( ( I1 <> EmptyIns A & I1 \; I2 = I2 ) or ( I2 <> EmptyIns A & I1 \; I2 = I1 ) or ( ( I1 <> EmptyIns A or I2 <> EmptyIns A ) & I1 \; I2 = EmptyIns A ) ) or ex C, I1, I2 being Element of A st if-then-else (C,I1,I2) = EmptyIns A or ex C, I being Element of A st while (C,I) = EmptyIns A or ex I1, I2, C, J1, J2 being Element of A st
( I1 <> EmptyIns A & I2 <> EmptyIns A & I1 \; I2 = if-then-else (C,J1,J2) ) or ex I1, I2, C, J being Element of A st
( I1 <> EmptyIns A & I2 <> EmptyIns A & I1 \; I2 = while (C,J) ) or ex C1, I1, I2, C2, J being Element of A st if-then-else (C1,I1,I2) = while (C2,J) ) );
:: deftheorem Def25 defines well_founded AOFA_000:def_25_:_
for A being preIfWhileAlgebra holds
( A is well_founded iff ElementaryInstructions A is GeneratorSet of A );
definition
func ECIW-signature -> non empty FinSequence of NAT equals :: AOFA_000:def 26
<*0,2*> ^ <*3,2*>;
coherence
<*0,2*> ^ <*3,2*> is non empty FinSequence of NAT ;
end;
:: deftheorem defines ECIW-signature AOFA_000:def_26_:_
ECIW-signature = <*0,2*> ^ <*3,2*>;
theorem Th54: :: AOFA_000:54
( len ECIW-signature = 4 & dom ECIW-signature = Seg 4 & ECIW-signature . 1 = 0 & ECIW-signature . 2 = 2 & ECIW-signature . 3 = 3 & ECIW-signature . 4 = 2 )
proof
A1: len <*0,2*> = 2 by FINSEQ_1:44;
A2: len <*3,2*> = 2 by FINSEQ_1:44;
A3: dom <*0,2*> = Seg 2 by A1, FINSEQ_1:def_3;
A4: dom <*3,2*> = Seg 2 by A2, FINSEQ_1:def_3;
then A5: 1 in dom <*3,2*> ;
A6: <*3,2*> . 1 = 3 by FINSEQ_1:44;
A7: 2 in dom <*3,2*> by A4;
A8: <*3,2*> . 2 = 2 by FINSEQ_1:44;
A9: 2 + 1 = 3 ;
A10: 1 in dom <*0,2*> by A3;
A11: <*0,2*> . 1 = 0 by FINSEQ_1:44;
A12: 2 in dom <*0,2*> by A3;
<*0,2*> . 2 = 2 by FINSEQ_1:44;
hence ( len ECIW-signature = 4 & dom ECIW-signature = Seg 4 & ECIW-signature . 1 = 0 & ECIW-signature . 2 = 2 & ECIW-signature . 3 = 3 & ECIW-signature . 4 = 2 ) by A1, A2, A5, A6, A7, A8, A9, A10, A11, A12, FINSEQ_1:22, FINSEQ_1:def_7; ::_thesis: verum
end;
definition
let A be non empty partial non-empty UAStr ;
attrA is ECIW-strict means :Def27: :: AOFA_000:def 27
signature A = ECIW-signature ;
end;
:: deftheorem Def27 defines ECIW-strict AOFA_000:def_27_:_
for A being non empty partial non-empty UAStr holds
( A is ECIW-strict iff signature A = ECIW-signature );
theorem Th55: :: AOFA_000:55
for A being non empty partial non-empty UAStr st A is ECIW-strict holds
for o being OperSymbol of A holds
( o = 1 or o = 2 or o = 3 or o = 4 )
proof
let A be non empty partial non-empty UAStr ; ::_thesis: ( A is ECIW-strict implies for o being OperSymbol of A holds
( o = 1 or o = 2 or o = 3 or o = 4 ) )
assume signature A = ECIW-signature ; :: according to AOFA_000:def_27 ::_thesis: for o being OperSymbol of A holds
( o = 1 or o = 2 or o = 3 or o = 4 )
then 4 = len the charact of A by Th54, UNIALG_1:def_4;
then dom the charact of A = Seg 4 by FINSEQ_1:def_3;
hence for o being OperSymbol of A holds
( o = 1 or o = 2 or o = 3 or o = 4 ) by ENUMSET1:def_2, FINSEQ_3:2; ::_thesis: verum
end;
registration
let X be non empty disjoint_with_NAT set ;
cluster FreeUnivAlgNSG (ECIW-signature,X) -> with_empty-instruction with_catenation with_if-instruction with_while-instruction ;
coherence
( FreeUnivAlgNSG (ECIW-signature,X) is with_empty-instruction & FreeUnivAlgNSG (ECIW-signature,X) is with_catenation & FreeUnivAlgNSG (ECIW-signature,X) is with_if-instruction & FreeUnivAlgNSG (ECIW-signature,X) is with_while-instruction )
proof
set S = FreeUnivAlgNSG (ECIW-signature,X);
set char = ECIW-signature ;
A1: len <*0,2*> = 2 by FINSEQ_1:44;
A2: len <*3,2*> = 2 by FINSEQ_1:44;
then A3: len ECIW-signature = 2 + 2 by A1, FINSEQ_1:22;
A4: len the charact of (FreeUnivAlgNSG (ECIW-signature,X)) = len ECIW-signature by FREEALG:def_11;
A5: dom <*0,2*> = Seg 2 by A1, FINSEQ_1:def_3;
A6: dom <*3,2*> = Seg 2 by A2, FINSEQ_1:def_3;
A7: dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) = Seg 4 by A3, A4, FINSEQ_1:def_3;
A8: dom ECIW-signature = Seg 4 by A3, FINSEQ_1:def_3;
thus 1 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by A7; :: according to AOFA_000:def_10 ::_thesis: ( the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 1 is non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) & FreeUnivAlgNSG (ECIW-signature,X) is with_catenation & FreeUnivAlgNSG (ECIW-signature,X) is with_if-instruction & FreeUnivAlgNSG (ECIW-signature,X) is with_while-instruction )
then A9: the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 1 = FreeOpNSG (1,ECIW-signature,X) by FREEALG:def_11;
A10: 1 in dom ECIW-signature by A8;
A11: 2 in dom ECIW-signature by A8;
A12: 3 in dom ECIW-signature by A8;
A13: 4 in dom ECIW-signature by A8;
reconsider D = TS (DTConUA (ECIW-signature,X)) as non empty set ;
reconsider char = ECIW-signature as non empty FinSequence of omega ;
set o = FreeOpNSG (1,char,X);
A14: 1 in dom <*0,2*> by A5;
A15: <*0,2*> . 1 = 0 by FINSEQ_1:44;
A16: 2 in dom <*0,2*> by A5;
A17: <*0,2*> . 2 = 2 by FINSEQ_1:44;
char . 1 = 0 by A14, A15, FINSEQ_1:def_7;
then char /. 1 = 0 by A10, PARTFUN1:def_6;
then A18: dom (FreeOpNSG (1,char,X)) = 0 -tuples_on the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A10, FREEALG:def_10;
reconsider o = FreeOpNSG (1,char,X) as non empty homogeneous quasi_total PartFunc of (D *),D ;
arity o = 0 by A18, COMPUT_1:25;
hence the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 1 is non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A9, COMPUT_1:def_21; ::_thesis: ( FreeUnivAlgNSG (ECIW-signature,X) is with_catenation & FreeUnivAlgNSG (ECIW-signature,X) is with_if-instruction & FreeUnivAlgNSG (ECIW-signature,X) is with_while-instruction )
thus 2 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by A7; :: according to AOFA_000:def_11 ::_thesis: ( the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 2 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) & FreeUnivAlgNSG (ECIW-signature,X) is with_if-instruction & FreeUnivAlgNSG (ECIW-signature,X) is with_while-instruction )
then A19: the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 2 = FreeOpNSG (2,char,X) by FREEALG:def_11;
set o = FreeOpNSG (2,char,X);
char . 2 = 2 by A16, A17, FINSEQ_1:def_7;
then char /. 2 = 2 by A11, PARTFUN1:def_6;
then A20: dom (FreeOpNSG (2,char,X)) = 2 -tuples_on the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A11, FREEALG:def_10;
reconsider o = FreeOpNSG (2,char,X) as non empty homogeneous quasi_total PartFunc of (D *),D ;
arity o = 2 by A20, COMPUT_1:25;
hence the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 2 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A19, COMPUT_1:def_21; ::_thesis: ( FreeUnivAlgNSG (ECIW-signature,X) is with_if-instruction & FreeUnivAlgNSG (ECIW-signature,X) is with_while-instruction )
thus 3 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by A7; :: according to AOFA_000:def_12 ::_thesis: ( the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 3 is non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) & FreeUnivAlgNSG (ECIW-signature,X) is with_while-instruction )
then A21: the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 3 = FreeOpNSG (3,char,X) by FREEALG:def_11;
set o = FreeOpNSG (3,char,X);
A22: 1 in dom <*3,2*> by A6;
A23: <*3,2*> . 1 = 3 by FINSEQ_1:44;
A24: 2 in dom <*3,2*> by A6;
A25: <*3,2*> . 2 = 2 by FINSEQ_1:44;
char . (2 + 1) = 3 by A1, A22, A23, FINSEQ_1:def_7;
then char /. 3 = 3 by A12, PARTFUN1:def_6;
then A26: dom (FreeOpNSG (3,char,X)) = 3 -tuples_on the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A12, FREEALG:def_10;
reconsider o = FreeOpNSG (3,char,X) as non empty homogeneous quasi_total PartFunc of (D *),D ;
arity o = 3 by A26, COMPUT_1:25;
hence the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 3 is non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A21, COMPUT_1:def_21; ::_thesis: FreeUnivAlgNSG (ECIW-signature,X) is with_while-instruction
thus 4 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by A7; :: according to AOFA_000:def_13 ::_thesis: the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 4 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X))
then A27: the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 4 = FreeOpNSG (4,char,X) by FREEALG:def_11;
set o = FreeOpNSG (4,char,X);
char . (2 + 2) = 2 by A1, A24, A25, FINSEQ_1:def_7;
then char /. 4 = 2 by A13, PARTFUN1:def_6;
then A28: dom (FreeOpNSG (4,char,X)) = 2 -tuples_on the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A13, FREEALG:def_10;
reconsider o = FreeOpNSG (4,char,X) as non empty homogeneous quasi_total PartFunc of (D *),D ;
arity o = 2 by A28, COMPUT_1:25;
hence the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 4 is non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by A27, COMPUT_1:def_21; ::_thesis: verum
end;
end;
theorem Th56: :: AOFA_000:56
for X being non empty disjoint_with_NAT set
for I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) )
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) )
set S = ECIW-signature ;
set G = DTConUA (ECIW-signature,X);
let I be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) )
assume A1: for x being Element of X holds not I = root-tree x ; ::_thesis: ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n )
Terminals (DTConUA (ECIW-signature,X)) = X by FREEALG:3;
then for d being Symbol of (DTConUA (ECIW-signature,X)) holds
( not d in Terminals (DTConUA (ECIW-signature,X)) or not I = root-tree d ) by A1;
then consider o being Symbol of (DTConUA (ECIW-signature,X)), p being FinSequence of TS (DTConUA (ECIW-signature,X)) such that
A2: o ==> roots p and
A3: I = o -tree p by Th16;
A4: NonTerminals (DTConUA (ECIW-signature,X)) = { s where s is Symbol of (DTConUA (ECIW-signature,X)) : ex n being FinSequence st s ==> n } by LANG1:def_3;
then A5: o in NonTerminals (DTConUA (ECIW-signature,X)) by A2;
A6: NonTerminals (DTConUA (ECIW-signature,X)) = Seg 4 by Th54, FREEALG:2;
then reconsider n = o as Element of NAT by A5;
reconsider p = p as FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) ;
take n ; ::_thesis: ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n )
take p ; ::_thesis: ( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n )
thus n in Seg 4 by A2, A4, A6; ::_thesis: ( I = n -tree p & len p = ECIW-signature . n )
thus I = n -tree p by A3; ::_thesis: len p = ECIW-signature . n
A7: [n,(roots p)] in the Rules of (DTConUA (ECIW-signature,X)) by A2, LANG1:def_1;
then A8: roots p in the carrier of (DTConUA (ECIW-signature,X)) * by ZFMISC_1:87;
dom p = dom (roots p) by TREES_3:def_18;
hence len p = card (dom (roots p)) by CARD_1:62
.= len (roots p) by CARD_1:62
.= ECIW-signature . n by A7, A8, FREEALG:def_7 ;
::_thesis: verum
end;
theorem Th57: :: AOFA_000:57
for X being non empty disjoint_with_NAT set holds EmptyIns (FreeUnivAlgNSG (ECIW-signature,X)) = 1 -tree {}
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: EmptyIns (FreeUnivAlgNSG (ECIW-signature,X)) = 1 -tree {}
set S = ECIW-signature ;
reconsider s = ECIW-signature as non empty FinSequence of omega ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
A1: 1 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by Def10;
reconsider f = the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 1 as non empty homogeneous quasi_total 0 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by Def10;
A2: f = FreeOpNSG (1,ECIW-signature,X) by A1, FREEALG:def_11;
A3: 1 in dom ECIW-signature by Th54;
then A4: s /. 1 = ECIW-signature . 1 by PARTFUN1:def_6;
A5: dom (FreeOpNSG (1,ECIW-signature,X)) = (s /. 1) -tuples_on (TS (DTConUA (ECIW-signature,X))) by A3, FREEALG:def_10
.= {{}} by A4, Th54, COMPUT_1:5 ;
A6: {} in {{}} by TARSKI:def_1;
A7: {} = <*> (TS (DTConUA (ECIW-signature,X))) ;
thus EmptyIns (FreeUnivAlgNSG (ECIW-signature,X)) = f . {} by A1, FUNCT_7:def_1
.= (Sym (1,ECIW-signature,X)) -tree {} by A2, A3, A5, A6, A7, FREEALG:def_10
.= 1 -tree {} by A3, FREEALG:def_9 ; ::_thesis: verum
end;
theorem Th58: :: AOFA_000:58
for X being non empty disjoint_with_NAT set
for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 1 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
p = {}
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 1 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
p = {}
set S = ECIW-signature ;
set G = DTConUA (ECIW-signature,X);
set A = FreeUnivAlgNSG (ECIW-signature,X);
let p be FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( 1 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) implies p = {} )
assume 1 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: p = {}
then reconsider I = 1 -tree p as Element of (FreeUnivAlgNSG (ECIW-signature,X)) ;
percases ( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ) by Th56;
suppose ex x being Element of X st I = root-tree x ; ::_thesis: p = {}
then consider x being Element of X such that
A1: 1 -tree p = root-tree x ;
1 -tree p = x -tree (<*> (TS (DTConUA (ECIW-signature,X)))) by A1, TREES_4:20;
hence p = {} by TREES_4:15; ::_thesis: verum
end;
suppose ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ; ::_thesis: p = {}
then consider n being Nat, q being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) such that
n in Seg 4 and
A2: I = n -tree q and
A3: len q = ECIW-signature . n ;
q = p by A2, TREES_4:15;
hence p = {} by A2, A3, Th54, TREES_4:15; ::_thesis: verum
end;
end;
end;
theorem Th59: :: AOFA_000:59
for X being non empty disjoint_with_NAT set
for I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds I1 \; I2 = 2 -tree (I1,I2)
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds I1 \; I2 = 2 -tree (I1,I2)
set S = ECIW-signature ;
reconsider s = ECIW-signature as non empty FinSequence of omega ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
let I1, I2 be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: I1 \; I2 = 2 -tree (I1,I2)
A1: 2 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by Def11;
reconsider f = the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 2 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by Def11;
A2: f = FreeOpNSG (2,ECIW-signature,X) by A1, FREEALG:def_11;
A3: 2 in dom ECIW-signature by Th54;
then s /. 2 = ECIW-signature . 2 by PARTFUN1:def_6;
then A4: dom (FreeOpNSG (2,ECIW-signature,X)) = 2 -tuples_on (TS (DTConUA (ECIW-signature,X))) by A3, Th54, FREEALG:def_10;
A5: <*I1,I2*> in 2 -tuples_on (TS (DTConUA (ECIW-signature,X))) by FINSEQ_2:137;
thus I1 \; I2 = f . <*I1,I2*> by A1, FUNCT_7:def_1
.= (Sym (2,ECIW-signature,X)) -tree <*I1,I2*> by A2, A3, A4, A5, FREEALG:def_10
.= 2 -tree (I1,I2) by A3, FREEALG:def_9 ; ::_thesis: verum
end;
theorem Th60: :: AOFA_000:60
for X being non empty disjoint_with_NAT set
for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 2 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*>
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 2 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*>
set S = ECIW-signature ;
set G = DTConUA (ECIW-signature,X);
set A = FreeUnivAlgNSG (ECIW-signature,X);
let p be FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( 2 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) implies ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*> )
assume 2 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*>
then reconsider I = 2 -tree p as Element of (FreeUnivAlgNSG (ECIW-signature,X)) ;
percases ( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ) by Th56;
suppose ex x being Element of X st I = root-tree x ; ::_thesis: ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*>
then consider x being Element of X such that
A1: 2 -tree p = root-tree x ;
2 -tree p = x -tree (<*> (TS (DTConUA (ECIW-signature,X)))) by A1, TREES_4:20;
then 2 = x by TREES_4:15;
then X meets NAT by XBOOLE_0:3;
hence ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*> by FREEALG:def_1; ::_thesis: verum
end;
suppose ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ; ::_thesis: ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*>
then consider n being Nat, q being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) such that
n in Seg 4 and
A2: I = n -tree q and
A3: len q = ECIW-signature . n ;
A4: n = 2 by A2, TREES_4:15;
A5: q = p by A2, TREES_4:15;
then p = <*(p . 1),(p . 2)*> by A3, A4, Th54, FINSEQ_1:44;
then rng p = {(p . 1),(p . 2)} by FINSEQ_2:127;
then reconsider I1 = p . 1, I2 = p . 2 as Element of (FreeUnivAlgNSG (ECIW-signature,X)) by ZFMISC_1:32;
take I1 ; ::_thesis: ex I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I2*>
take I2 ; ::_thesis: p = <*I1,I2*>
thus p = <*I1,I2*> by A3, A4, A5, Th54, FINSEQ_1:44; ::_thesis: verum
end;
end;
end;
theorem Th61: :: AOFA_000:61
for X being non empty disjoint_with_NAT set
for I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
( I1 \; I2 <> I1 & I1 \; I2 <> I2 )
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
( I1 \; I2 <> I1 & I1 \; I2 <> I2 )
set S = ECIW-signature ;
set G = DTConUA (ECIW-signature,X);
set A = FreeUnivAlgNSG (ECIW-signature,X);
let I1, I2 be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( I1 \; I2 <> I1 & I1 \; I2 <> I2 )
set p = <*I1,I2*>;
rng <*I1,I2*> c= FinTrees the carrier of (DTConUA (ECIW-signature,X)) by XBOOLE_1:1;
then A1: <*I1,I2*> is FinSequence of FinTrees the carrier of (DTConUA (ECIW-signature,X)) by FINSEQ_1:def_4;
A2: rng <*I1,I2*> = {I1,I2} by FINSEQ_2:127;
then A3: I1 in rng <*I1,I2*> by TARSKI:def_2;
A4: I2 in rng <*I1,I2*> by A2, TARSKI:def_2;
I1 \; I2 = 2 -tree (I1,I2) by Th59
.= 2 -tree <*I1,I2*> ;
hence ( I1 \; I2 <> I1 & I1 \; I2 <> I2 ) by A1, A3, A4, Th3; ::_thesis: verum
end;
theorem :: AOFA_000:62
for X being non empty disjoint_with_NAT set
for I1, I2, J1, J2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I1 \; I2 = J1 \; J2 holds
( I1 = J1 & I2 = J2 )
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for I1, I2, J1, J2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I1 \; I2 = J1 \; J2 holds
( I1 = J1 & I2 = J2 )
set S = ECIW-signature ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
let I1, I2, J1, J2 be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( I1 \; I2 = J1 \; J2 implies ( I1 = J1 & I2 = J2 ) )
A1: I1 \; I2 = 2 -tree (I1,I2) by Th59;
J1 \; J2 = 2 -tree (J1,J2) by Th59;
then ( I1 \; I2 = J1 \; J2 implies <*I1,I2*> = <*J1,J2*> ) by A1, TREES_4:15;
hence ( I1 \; I2 = J1 \; J2 implies ( I1 = J1 & I2 = J2 ) ) by FINSEQ_1:77; ::_thesis: verum
end;
theorem Th63: :: AOFA_000:63
for X being non empty disjoint_with_NAT set
for C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds if-then-else (C,I1,I2) = 3 -tree <*C,I1,I2*>
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds if-then-else (C,I1,I2) = 3 -tree <*C,I1,I2*>
set S = ECIW-signature ;
reconsider s = ECIW-signature as non empty FinSequence of omega ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
let C, I1, I2 be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: if-then-else (C,I1,I2) = 3 -tree <*C,I1,I2*>
A1: 3 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by Def12;
reconsider f = the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 3 as non empty homogeneous quasi_total 3 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by Def12;
A2: f = FreeOpNSG (3,ECIW-signature,X) by A1, FREEALG:def_11;
A3: 3 in dom ECIW-signature by Th54;
then s /. 3 = ECIW-signature . 3 by PARTFUN1:def_6;
then A4: dom (FreeOpNSG (3,ECIW-signature,X)) = 3 -tuples_on (TS (DTConUA (ECIW-signature,X))) by A3, Th54, FREEALG:def_10;
A5: <*C,I1,I2*> in 3 -tuples_on (TS (DTConUA (ECIW-signature,X))) by FINSEQ_2:139;
thus if-then-else (C,I1,I2) = f . <*C,I1,I2*> by A1, FUNCT_7:def_1
.= (Sym (3,ECIW-signature,X)) -tree <*C,I1,I2*> by A2, A3, A4, A5, FREEALG:def_10
.= 3 -tree <*C,I1,I2*> by A3, FREEALG:def_9 ; ::_thesis: verum
end;
theorem Th64: :: AOFA_000:64
for X being non empty disjoint_with_NAT set
for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 3 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*>
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 3 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*>
set S = ECIW-signature ;
set G = DTConUA (ECIW-signature,X);
set A = FreeUnivAlgNSG (ECIW-signature,X);
let p be FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( 3 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) implies ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*> )
assume 3 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*>
then reconsider I = 3 -tree p as Element of (FreeUnivAlgNSG (ECIW-signature,X)) ;
percases ( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ) by Th56;
suppose ex x being Element of X st I = root-tree x ; ::_thesis: ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*>
then consider x being Element of X such that
A1: 3 -tree p = root-tree x ;
3 -tree p = x -tree (<*> (TS (DTConUA (ECIW-signature,X)))) by A1, TREES_4:20;
then 3 = x by TREES_4:15;
then X meets NAT by XBOOLE_0:3;
hence ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*> by FREEALG:def_1; ::_thesis: verum
end;
suppose ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ; ::_thesis: ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*>
then consider n being Nat, q being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) such that
n in Seg 4 and
A2: I = n -tree q and
A3: len q = ECIW-signature . n ;
A4: n = 3 by A2, TREES_4:15;
A5: q = p by A2, TREES_4:15;
then p = <*(p . 1),(p . 2),(p . 3)*> by A3, A4, Th54, FINSEQ_1:45;
then A6: rng p = {(p . 1),(p . 2),(p . 3)} by FINSEQ_2:128;
A7: p . 1 in {(p . 1),(p . 2),(p . 3)} by ENUMSET1:def_1;
A8: p . 2 in {(p . 1),(p . 2),(p . 3)} by ENUMSET1:def_1;
p . 3 in {(p . 1),(p . 2),(p . 3)} by ENUMSET1:def_1;
then reconsider C = p . 1, I1 = p . 2, I2 = p . 3 as Element of (FreeUnivAlgNSG (ECIW-signature,X)) by A6, A7, A8;
take C ; ::_thesis: ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*>
take I1 ; ::_thesis: ex I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I1,I2*>
take I2 ; ::_thesis: p = <*C,I1,I2*>
thus p = <*C,I1,I2*> by A3, A4, A5, Th54, FINSEQ_1:45; ::_thesis: verum
end;
end;
end;
theorem :: AOFA_000:65
for X being non empty disjoint_with_NAT set
for C1, C2, I1, I2, J1, J2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st if-then-else (C1,I1,I2) = if-then-else (C2,J1,J2) holds
( C1 = C2 & I1 = J1 & I2 = J2 )
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for C1, C2, I1, I2, J1, J2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st if-then-else (C1,I1,I2) = if-then-else (C2,J1,J2) holds
( C1 = C2 & I1 = J1 & I2 = J2 )
set S = ECIW-signature ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
let C1, C2, I1, I2, J1, J2 be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( if-then-else (C1,I1,I2) = if-then-else (C2,J1,J2) implies ( C1 = C2 & I1 = J1 & I2 = J2 ) )
A1: if-then-else (C1,I1,I2) = 3 -tree <*C1,I1,I2*> by Th63;
if-then-else (C2,J1,J2) = 3 -tree <*C2,J1,J2*> by Th63;
then ( if-then-else (C1,I1,I2) = if-then-else (C2,J1,J2) implies <*C1,I1,I2*> = <*C2,J1,J2*> ) by A1, TREES_4:15;
hence ( if-then-else (C1,I1,I2) = if-then-else (C2,J1,J2) implies ( C1 = C2 & I1 = J1 & I2 = J2 ) ) by FINSEQ_1:78; ::_thesis: verum
end;
theorem Th66: :: AOFA_000:66
for X being non empty disjoint_with_NAT set
for C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds while (C,I) = 4 -tree (C,I)
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds while (C,I) = 4 -tree (C,I)
set S = ECIW-signature ;
reconsider s = ECIW-signature as non empty FinSequence of omega ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
let C, I be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: while (C,I) = 4 -tree (C,I)
A1: 4 in dom the charact of (FreeUnivAlgNSG (ECIW-signature,X)) by Def13;
reconsider f = the charact of (FreeUnivAlgNSG (ECIW-signature,X)) . 4 as non empty homogeneous quasi_total 2 -ary PartFunc of ( the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) *), the carrier of (FreeUnivAlgNSG (ECIW-signature,X)) by Def13;
A2: f = FreeOpNSG (4,ECIW-signature,X) by A1, FREEALG:def_11;
A3: 4 in dom ECIW-signature by Th54;
then s /. 4 = ECIW-signature . 4 by PARTFUN1:def_6;
then A4: dom (FreeOpNSG (4,ECIW-signature,X)) = 2 -tuples_on (TS (DTConUA (ECIW-signature,X))) by A3, Th54, FREEALG:def_10;
A5: <*C,I*> in 2 -tuples_on (TS (DTConUA (ECIW-signature,X))) by FINSEQ_2:137;
thus while (C,I) = f . <*C,I*> by A1, FUNCT_7:def_1
.= (Sym (4,ECIW-signature,X)) -tree <*C,I*> by A2, A3, A4, A5, FREEALG:def_10
.= 4 -tree (C,I) by A3, FREEALG:def_9 ; ::_thesis: verum
end;
theorem Th67: :: AOFA_000:67
for X being non empty disjoint_with_NAT set
for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 4 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I*>
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st 4 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I*>
set S = ECIW-signature ;
set G = DTConUA (ECIW-signature,X);
set A = FreeUnivAlgNSG (ECIW-signature,X);
let p be FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( 4 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) implies ex C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I*> )
assume 4 -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: ex C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I*>
then reconsider I = 4 -tree p as Element of (FreeUnivAlgNSG (ECIW-signature,X)) ;
percases ( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ) by Th56;
suppose ex x being Element of X st I = root-tree x ; ::_thesis: ex C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I*>
then consider x being Element of X such that
A1: 4 -tree p = root-tree x ;
4 -tree p = x -tree (<*> (TS (DTConUA (ECIW-signature,X)))) by A1, TREES_4:20;
then 4 = x by TREES_4:15;
then X meets NAT by XBOOLE_0:3;
hence ex C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I*> by FREEALG:def_1; ::_thesis: verum
end;
suppose ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ; ::_thesis: ex C, I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*C,I*>
then consider n being Nat, q being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) such that
n in Seg 4 and
A2: I = n -tree q and
A3: len q = ECIW-signature . n ;
A4: n = 4 by A2, TREES_4:15;
A5: q = p by A2, TREES_4:15;
then p = <*(p . 1),(p . 2)*> by A3, A4, Th54, FINSEQ_1:44;
then rng p = {(p . 1),(p . 2)} by FINSEQ_2:127;
then reconsider I1 = p . 1, I2 = p . 2 as Element of (FreeUnivAlgNSG (ECIW-signature,X)) by ZFMISC_1:32;
take I1 ; ::_thesis: ex I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st p = <*I1,I*>
take I2 ; ::_thesis: p = <*I1,I2*>
thus p = <*I1,I2*> by A3, A4, A5, Th54, FINSEQ_1:44; ::_thesis: verum
end;
end;
end;
theorem Th68: :: AOFA_000:68
for X being non empty disjoint_with_NAT set
for I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex x being Element of X st I = x -tree {}
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for I being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) holds
ex x being Element of X st I = x -tree {}
set S = ECIW-signature ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
let I be Element of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: ( I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) implies ex x being Element of X st I = x -tree {} )
assume A1: I in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: ex x being Element of X st I = x -tree {}
percases ( ex x being Element of X st I = root-tree x or ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ) by Th56;
suppose ex x being Element of X st I = root-tree x ; ::_thesis: ex x being Element of X st I = x -tree {}
then consider x being Element of X such that
A2: I = root-tree x ;
root-tree x = x -tree {} by TREES_4:20;
hence ex x being Element of X st I = x -tree {} by A2; ::_thesis: verum
end;
suppose ex n being Nat ex p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) st
( n in Seg 4 & I = n -tree p & len p = ECIW-signature . n ) ; ::_thesis: ex x being Element of X st I = x -tree {}
then consider n being Nat, p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) such that
A3: n in Seg 4 and
A4: I = n -tree p and
len p = ECIW-signature . n ;
percases ( n = 1 or n = 2 or n = 3 or n = 4 ) by A3, ENUMSET1:def_2, FINSEQ_3:2;
supposeA5: n = 1 ; ::_thesis: ex x being Element of X st I = x -tree {}
then p = {} by A4, Th58;
then I = EmptyIns (FreeUnivAlgNSG (ECIW-signature,X)) by A4, A5, Th57;
hence ex x being Element of X st I = x -tree {} by A1, Th49; ::_thesis: verum
end;
supposeA6: n = 2 ; ::_thesis: ex x being Element of X st I = x -tree {}
then consider I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) such that
A7: p = <*I1,I2*> by A4, Th60;
A8: I = n -tree (I1,I2) by A4, A7
.= I1 \; I2 by A6, Th59 ;
then A9: I <> I1 by Th61;
I <> I2 by A8, Th61;
hence ex x being Element of X st I = x -tree {} by A1, A8, A9, Th50; ::_thesis: verum
end;
supposeA10: n = 3 ; ::_thesis: ex x being Element of X st I = x -tree {}
then consider C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) such that
A11: p = <*C,I1,I2*> by A4, Th64;
I = if-then-else (C,I1,I2) by A4, A10, A11, Th63;
hence ex x being Element of X st I = x -tree {} by A1, Th51; ::_thesis: verum
end;
supposeA12: n = 4 ; ::_thesis: ex x being Element of X st I = x -tree {}
then consider C, I9 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) such that
A13: p = <*C,I9*> by A4, Th67;
I = n -tree (C,I9) by A4, A13
.= while (C,I9) by A12, Th66 ;
hence ex x being Element of X st I = x -tree {} by A1, Th52; ::_thesis: verum
end;
end;
end;
end;
end;
theorem :: AOFA_000:69
for X being non empty disjoint_with_NAT set
for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X))
for x being Element of X st x -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
p = {}
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: for p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X))
for x being Element of X st x -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
p = {}
set S = ECIW-signature ;
set A = FreeUnivAlgNSG (ECIW-signature,X);
let p be FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)); ::_thesis: for x being Element of X st x -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) holds
p = {}
let x be Element of X; ::_thesis: ( x -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) implies p = {} )
assume x -tree p is Element of (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: p = {}
then reconsider I = x -tree p as Element of (FreeUnivAlgNSG (ECIW-signature,X)) ;
now__::_thesis:_for_n_being_Nat
for_p_being_FinSequence_of_(FreeUnivAlgNSG_(ECIW-signature,X))_holds_
(_not_n_in_Seg_4_or_not_I_=_n_-tree_p_or_not_len_p_=_ECIW-signature_._n_)
given n being Nat, p being FinSequence of (FreeUnivAlgNSG (ECIW-signature,X)) such that A1: n in Seg 4 and
A2: I = n -tree p and
len p = ECIW-signature . n ; ::_thesis: contradiction
A3: x = n by A2, TREES_4:15;
X misses NAT by FREEALG:def_1;
hence contradiction by A1, A3, XBOOLE_0:3; ::_thesis: verum
end;
then consider y being Element of X such that
A4: I = root-tree y by Th56;
x -tree p = y -tree {} by A4, TREES_4:20;
hence p = {} by TREES_4:15; ::_thesis: verum
end;
theorem Th70: :: AOFA_000:70
for X being non empty disjoint_with_NAT set holds
( ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) = FreeGenSetNSG (ECIW-signature,X) & card X = card (FreeGenSetNSG (ECIW-signature,X)) )
proof
let X be non empty disjoint_with_NAT set ; ::_thesis: ( ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) = FreeGenSetNSG (ECIW-signature,X) & card X = card (FreeGenSetNSG (ECIW-signature,X)) )
set S = ECIW-signature ;
set G = DTConUA (ECIW-signature,X);
A1: X = Terminals (DTConUA (ECIW-signature,X)) by FREEALG:3;
set A = FreeUnivAlgNSG (ECIW-signature,X);
thus ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) = FreeGenSetNSG (ECIW-signature,X) ::_thesis: card X = card (FreeGenSetNSG (ECIW-signature,X))
proof
thus ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) c= FreeGenSetNSG (ECIW-signature,X) :: according to XBOOLE_0:def_10 ::_thesis: FreeGenSetNSG (ECIW-signature,X) c= ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X))
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) or not x nin FreeGenSetNSG (ECIW-signature,X) )
assume x in ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: not x nin FreeGenSetNSG (ECIW-signature,X)
then consider y being Element of X such that
A2: x = y -tree {} by Th68;
reconsider y = y as Symbol of (DTConUA (ECIW-signature,X)) by XBOOLE_0:def_3;
x = root-tree y by A2, TREES_4:20;
hence not x nin FreeGenSetNSG (ECIW-signature,X) by A1; ::_thesis: verum
end;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin FreeGenSetNSG (ECIW-signature,X) or not x nin ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) )
assume A3: x in FreeGenSetNSG (ECIW-signature,X) ; ::_thesis: not x nin ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X))
then reconsider I = x as Element of (FreeUnivAlgNSG (ECIW-signature,X)) ;
consider y being Symbol of (DTConUA (ECIW-signature,X)) such that
A4: x = root-tree y and
A5: y in Terminals (DTConUA (ECIW-signature,X)) by A3;
A6: x = y -tree {} by A4, TREES_4:20;
assume A7: x nin ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: contradiction
percases ( I = EmptyIns (FreeUnivAlgNSG (ECIW-signature,X)) or ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st
( I = I1 \; I2 & I1 <> I1 \; I2 & I2 <> I1 \; I2 ) or ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I = if-then-else (C,I1,I2) or ex C, J being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I = while (C,J) ) by A7, Th53;
suppose I = EmptyIns (FreeUnivAlgNSG (ECIW-signature,X)) ; ::_thesis: contradiction
then x = 1 -tree {} by Th57;
then A8: y = 1 by A6, TREES_4:15;
X misses NAT by FREEALG:def_1;
hence contradiction by A1, A5, A8, XBOOLE_0:3; ::_thesis: verum
end;
suppose ex I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st
( I = I1 \; I2 & I1 <> I1 \; I2 & I2 <> I1 \; I2 ) ; ::_thesis: contradiction
then consider I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) such that
A9: I = I1 \; I2 ;
x = 2 -tree (I1,I2) by A9, Th59
.= 2 -tree <*I1,I2*> ;
hence contradiction by A6, TREES_4:15; ::_thesis: verum
end;
suppose ex C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I = if-then-else (C,I1,I2) ; ::_thesis: contradiction
then consider C, I1, I2 being Element of (FreeUnivAlgNSG (ECIW-signature,X)) such that
A10: I = if-then-else (C,I1,I2) ;
x = 3 -tree <*C,I1,I2*> by A10, Th63;
hence contradiction by A6, TREES_4:15; ::_thesis: verum
end;
suppose ex C, J being Element of (FreeUnivAlgNSG (ECIW-signature,X)) st I = while (C,J) ; ::_thesis: contradiction
then consider C, J being Element of (FreeUnivAlgNSG (ECIW-signature,X)) such that
A11: I = while (C,J) ;
x = 4 -tree (C,J) by A11, Th66
.= 4 -tree <*C,J*> ;
hence contradiction by A6, TREES_4:15; ::_thesis: verum
end;
end;
end;
deffunc H1( set ) -> set = root-tree $1;
consider f being Function such that
A12: ( dom f = X & ( for x being Element of X holds f . x = H1(x) ) ) from FUNCT_1:sch_4();
A13: rng f = FreeGenSetNSG (ECIW-signature,X)
proof
thus rng f c= FreeGenSetNSG (ECIW-signature,X) :: according to XBOOLE_0:def_10 ::_thesis: FreeGenSetNSG (ECIW-signature,X) c= rng f
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin rng f or not a nin FreeGenSetNSG (ECIW-signature,X) )
assume a in rng f ; ::_thesis: not a nin FreeGenSetNSG (ECIW-signature,X)
then consider x being set such that
A14: x in X and
A15: a = f . x by A12, FUNCT_1:def_3;
a = H1(x) by A12, A14, A15;
hence not a nin FreeGenSetNSG (ECIW-signature,X) by A1, A14; ::_thesis: verum
end;
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin FreeGenSetNSG (ECIW-signature,X) or not a nin rng f )
assume a in FreeGenSetNSG (ECIW-signature,X) ; ::_thesis: not a nin rng f
then consider s being Symbol of (DTConUA (ECIW-signature,X)) such that
A16: a = root-tree s and
A17: s in X by A1;
reconsider s = s as Element of X by A17;
f . s = a by A12, A16;
hence not a nin rng f by A12, FUNCT_1:def_3; ::_thesis: verum
end;
f is one-to-one
proof
let a, b be set ; :: according to FUNCT_1:def_4 ::_thesis: ( a nin dom f or b nin dom f or not f . a = f . b or a = b )
assume that
A18: a in dom f and
A19: b in dom f ; ::_thesis: ( not f . a = f . b or a = b )
reconsider x = a, y = b as Element of X by A12, A18, A19;
assume f . a = f . b ; ::_thesis: a = b
then H1(x) = f . b by A12
.= H1(y) by A12 ;
hence a = b by TREES_4:4; ::_thesis: verum
end;
then X, FreeGenSetNSG (ECIW-signature,X) are_equipotent by A12, A13, WELLORD2:def_4;
hence card X = card (FreeGenSetNSG (ECIW-signature,X)) by CARD_1:5; ::_thesis: verum
end;
registration
cluster infinite disjoint_with_NAT for set ;
existence
ex b1 being set st
( b1 is infinite & b1 is disjoint_with_NAT )
proof
take X = [:NAT,{0}:]; ::_thesis: ( X is infinite & X is disjoint_with_NAT )
thus X is infinite ; ::_thesis: X is disjoint_with_NAT
now__::_thesis:_for_x_being_set_st_x_in_X_holds_
not_x_in_NAT
let x be set ; ::_thesis: ( x in X implies not x in NAT )
assume x in X ; ::_thesis: not x in NAT
then A1: ex a, b being set st
( a in NAT & b in {0} & x = [a,b] ) by ZFMISC_1:def_2;
assume x in NAT ; ::_thesis: contradiction
hence contradiction by A1; ::_thesis: verum
end;
hence X misses NAT by XBOOLE_0:3; :: according to FREEALG:def_1 ::_thesis: verum
end;
end;
registration
let X be infinite disjoint_with_NAT set ;
cluster FreeUnivAlgNSG (ECIW-signature,X) -> infinite ;
coherence
FreeUnivAlgNSG (ECIW-signature,X) is infinite
proof
card X = card (FreeGenSetNSG (ECIW-signature,X)) by Th70;
then card (ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X))) is infinite by Th70;
hence ElementaryInstructions (FreeUnivAlgNSG (ECIW-signature,X)) is infinite ; :: according to AOFA_000:def_23 ::_thesis: verum
end;
end;
registration
let X be non empty disjoint_with_NAT set ;
cluster FreeUnivAlgNSG (ECIW-signature,X) -> ECIW-strict ;
coherence
FreeUnivAlgNSG (ECIW-signature,X) is ECIW-strict
proof
thus signature (FreeUnivAlgNSG (ECIW-signature,X)) = ECIW-signature by FREEALG:4; :: according to AOFA_000:def_27 ::_thesis: verum
end;
end;
theorem Th71: :: AOFA_000:71
for A being preIfWhileAlgebra holds Generators A c= ElementaryInstructions A
proof
let A be preIfWhileAlgebra; ::_thesis: Generators A c= ElementaryInstructions A
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin Generators A or not x nin ElementaryInstructions A )
assume that
A1: x in Generators A and
A2: x nin ElementaryInstructions A ; ::_thesis: contradiction
reconsider x = x as Element of A by A1;
dom (Den ((In (1,(dom the charact of A))),A)) = {{}} by Th42;
then A3: {} in dom (Den ((In (1,(dom the charact of A))),A)) by TARSKI:def_1;
percases ( x = EmptyIns A or ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 <> I1 \; I2 & I2 <> I1 \; I2 ) or ex C, I1, I2 being Element of A st x = if-then-else (C,I1,I2) or ex C, J being Element of A st x = while (C,J) ) by A2, Th53;
suppose x = EmptyIns A ; ::_thesis: contradiction
then x in rng (Den ((In (1,(dom the charact of A))),A)) by A3, FUNCT_1:3;
hence contradiction by A1, Th26; ::_thesis: verum
end;
suppose ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 <> I1 \; I2 & I2 <> I1 \; I2 ) ; ::_thesis: contradiction
then consider I1, I2 being Element of A such that
A4: x = I1 \; I2 and
I1 <> I1 \; I2 and
I2 <> I1 \; I2 ;
dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th44;
then <*I1,I2*> in dom (Den ((In (2,(dom the charact of A))),A)) by FINSEQ_2:137;
then x in rng (Den ((In (2,(dom the charact of A))),A)) by A4, FUNCT_1:3;
hence contradiction by A1, Th26; ::_thesis: verum
end;
suppose ex C, I1, I2 being Element of A st x = if-then-else (C,I1,I2) ; ::_thesis: contradiction
then consider C, I1, I2 being Element of A such that
A5: x = if-then-else (C,I1,I2) ;
dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A by Th47;
then <*C,I1,I2*> in dom (Den ((In (3,(dom the charact of A))),A)) by FINSEQ_2:139;
then x in rng (Den ((In (3,(dom the charact of A))),A)) by A5, FUNCT_1:3;
hence contradiction by A1, Th26; ::_thesis: verum
end;
suppose ex C, J being Element of A st x = while (C,J) ; ::_thesis: contradiction
then consider C, J being Element of A such that
A6: x = while (C,J) ;
dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th48;
then <*C,J*> in dom (Den ((In (4,(dom the charact of A))),A)) by FINSEQ_2:137;
then x in rng (Den ((In (4,(dom the charact of A))),A)) by A6, FUNCT_1:3;
hence contradiction by A1, Th26; ::_thesis: verum
end;
end;
end;
theorem Th72: :: AOFA_000:72
for A being preIfWhileAlgebra st A is free holds
for C, I1, I2 being Element of A holds
( EmptyIns A <> I1 \; I2 & EmptyIns A <> if-then-else (C,I1,I2) & EmptyIns A <> while (C,I1) )
proof
let A be preIfWhileAlgebra; ::_thesis: ( A is free implies for C, I1, I2 being Element of A holds
( EmptyIns A <> I1 \; I2 & EmptyIns A <> if-then-else (C,I1,I2) & EmptyIns A <> while (C,I1) ) )
assume A1: A is free ; ::_thesis: for C, I1, I2 being Element of A holds
( EmptyIns A <> I1 \; I2 & EmptyIns A <> if-then-else (C,I1,I2) & EmptyIns A <> while (C,I1) )
let C, I1, I2 be Element of A; ::_thesis: ( EmptyIns A <> I1 \; I2 & EmptyIns A <> if-then-else (C,I1,I2) & EmptyIns A <> while (C,I1) )
A2: dom (Den ((In (1,(dom the charact of A))),A)) = {{}} by Th42;
A3: dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th44;
A4: dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A by Th47;
A5: dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th48;
A6: {} in {{}} by TARSKI:def_1;
<*I1,I2*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
hence EmptyIns A <> I1 \; I2 by A1, A2, A3, A6, Th36; ::_thesis: ( EmptyIns A <> if-then-else (C,I1,I2) & EmptyIns A <> while (C,I1) )
<*C,I1,I2*> in 3 -tuples_on the carrier of A by FINSEQ_2:139;
hence EmptyIns A <> if-then-else (C,I1,I2) by A1, A2, A4, A6, Th36; ::_thesis: EmptyIns A <> while (C,I1)
<*C,I1*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
hence EmptyIns A <> while (C,I1) by A1, A2, A5, A6, Th36; ::_thesis: verum
end;
theorem Th73: :: AOFA_000:73
for A being preIfWhileAlgebra st A is free holds
for I1, I2, C, J1, J2 being Element of A holds
( I1 \; I2 <> I1 & I1 \; I2 <> I2 & ( I1 \; I2 = J1 \; J2 implies ( I1 = J1 & I2 = J2 ) ) & I1 \; I2 <> if-then-else (C,J1,J2) & I1 \; I2 <> while (C,J1) )
proof
let A be preIfWhileAlgebra; ::_thesis: ( A is free implies for I1, I2, C, J1, J2 being Element of A holds
( I1 \; I2 <> I1 & I1 \; I2 <> I2 & ( I1 \; I2 = J1 \; J2 implies ( I1 = J1 & I2 = J2 ) ) & I1 \; I2 <> if-then-else (C,J1,J2) & I1 \; I2 <> while (C,J1) ) )
assume A1: A is free ; ::_thesis: for I1, I2, C, J1, J2 being Element of A holds
( I1 \; I2 <> I1 & I1 \; I2 <> I2 & ( I1 \; I2 = J1 \; J2 implies ( I1 = J1 & I2 = J2 ) ) & I1 \; I2 <> if-then-else (C,J1,J2) & I1 \; I2 <> while (C,J1) )
let I1, I2, C, J1, J2 be Element of A; ::_thesis: ( I1 \; I2 <> I1 & I1 \; I2 <> I2 & ( I1 \; I2 = J1 \; J2 implies ( I1 = J1 & I2 = J2 ) ) & I1 \; I2 <> if-then-else (C,J1,J2) & I1 \; I2 <> while (C,J1) )
A2: 2 in dom the charact of A by Def11;
A3: dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th44;
A4: In (2,(dom the charact of A)) = 2 by A2, FUNCT_7:def_1;
A5: 3 in dom the charact of A by Def12;
A6: dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A by Th47;
A7: In (3,(dom the charact of A)) = 3 by A5, FUNCT_7:def_1;
A8: 4 in dom the charact of A by Def13;
A9: dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th48;
A10: In (4,(dom the charact of A)) = 4 by A8, FUNCT_7:def_1;
A11: <*I1,I2*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
A12: <*J1,J2*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
A13: rng <*I1,I2*> = {I1,I2} by FINSEQ_2:127;
then A14: I1 in rng <*I1,I2*> by TARSKI:def_2;
I2 in rng <*I1,I2*> by A13, TARSKI:def_2;
hence ( I1 \; I2 <> I1 & I1 \; I2 <> I2 ) by A1, A3, A11, A14, Th38; ::_thesis: ( ( I1 \; I2 = J1 \; J2 implies ( I1 = J1 & I2 = J2 ) ) & I1 \; I2 <> if-then-else (C,J1,J2) & I1 \; I2 <> while (C,J1) )
hereby ::_thesis: ( I1 \; I2 <> if-then-else (C,J1,J2) & I1 \; I2 <> while (C,J1) )
assume I1 \; I2 = J1 \; J2 ; ::_thesis: ( I1 = J1 & I2 = J2 )
then <*I1,I2*> = <*J1,J2*> by A1, A3, A11, A12, Th36;
hence ( I1 = J1 & I2 = J2 ) by FINSEQ_1:77; ::_thesis: verum
end;
<*C,J1,J2*> in 3 -tuples_on the carrier of A by FINSEQ_2:139;
hence I1 \; I2 <> if-then-else (C,J1,J2) by A1, A3, A4, A6, A7, A11, Th36; ::_thesis: I1 \; I2 <> while (C,J1)
<*C,J1*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
hence I1 \; I2 <> while (C,J1) by A1, A3, A4, A9, A10, A11, Th36; ::_thesis: verum
end;
theorem Th74: :: AOFA_000:74
for A being preIfWhileAlgebra st A is free holds
for C, I1, I2, D, J1, J2 being Element of A holds
( if-then-else (C,I1,I2) <> C & if-then-else (C,I1,I2) <> I1 & if-then-else (C,I1,I2) <> I2 & if-then-else (C,I1,I2) <> while (D,J1) & ( if-then-else (C,I1,I2) = if-then-else (D,J1,J2) implies ( C = D & I1 = J1 & I2 = J2 ) ) )
proof
let A be preIfWhileAlgebra; ::_thesis: ( A is free implies for C, I1, I2, D, J1, J2 being Element of A holds
( if-then-else (C,I1,I2) <> C & if-then-else (C,I1,I2) <> I1 & if-then-else (C,I1,I2) <> I2 & if-then-else (C,I1,I2) <> while (D,J1) & ( if-then-else (C,I1,I2) = if-then-else (D,J1,J2) implies ( C = D & I1 = J1 & I2 = J2 ) ) ) )
assume A1: A is free ; ::_thesis: for C, I1, I2, D, J1, J2 being Element of A holds
( if-then-else (C,I1,I2) <> C & if-then-else (C,I1,I2) <> I1 & if-then-else (C,I1,I2) <> I2 & if-then-else (C,I1,I2) <> while (D,J1) & ( if-then-else (C,I1,I2) = if-then-else (D,J1,J2) implies ( C = D & I1 = J1 & I2 = J2 ) ) )
let C, I1, I2, D, J1, J2 be Element of A; ::_thesis: ( if-then-else (C,I1,I2) <> C & if-then-else (C,I1,I2) <> I1 & if-then-else (C,I1,I2) <> I2 & if-then-else (C,I1,I2) <> while (D,J1) & ( if-then-else (C,I1,I2) = if-then-else (D,J1,J2) implies ( C = D & I1 = J1 & I2 = J2 ) ) )
A2: 3 in dom the charact of A by Def12;
A3: dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A by Th47;
A4: In (3,(dom the charact of A)) = 3 by A2, FUNCT_7:def_1;
A5: 4 in dom the charact of A by Def13;
A6: dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th48;
A7: In (4,(dom the charact of A)) = 4 by A5, FUNCT_7:def_1;
A8: <*C,I1,I2*> in 3 -tuples_on the carrier of A by FINSEQ_2:139;
A9: <*D,J1,J2*> in 3 -tuples_on the carrier of A by FINSEQ_2:139;
A10: rng <*C,I1,I2*> = {C,I1,I2} by FINSEQ_2:128;
then A11: C in rng <*C,I1,I2*> by ENUMSET1:def_1;
A12: I1 in rng <*C,I1,I2*> by A10, ENUMSET1:def_1;
I2 in rng <*C,I1,I2*> by A10, ENUMSET1:def_1;
hence ( if-then-else (C,I1,I2) <> C & if-then-else (C,I1,I2) <> I1 & if-then-else (C,I1,I2) <> I2 ) by A1, A3, A8, A11, A12, Th38; ::_thesis: ( if-then-else (C,I1,I2) <> while (D,J1) & ( if-then-else (C,I1,I2) = if-then-else (D,J1,J2) implies ( C = D & I1 = J1 & I2 = J2 ) ) )
<*D,J1*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
hence if-then-else (C,I1,I2) <> while (D,J1) by A1, A3, A4, A6, A7, A8, Th36; ::_thesis: ( if-then-else (C,I1,I2) = if-then-else (D,J1,J2) implies ( C = D & I1 = J1 & I2 = J2 ) )
assume if-then-else (C,I1,I2) = if-then-else (D,J1,J2) ; ::_thesis: ( C = D & I1 = J1 & I2 = J2 )
then <*C,I1,I2*> = <*D,J1,J2*> by A1, A3, A8, A9, Th36;
hence ( C = D & I1 = J1 & I2 = J2 ) by FINSEQ_1:78; ::_thesis: verum
end;
theorem Th75: :: AOFA_000:75
for A being preIfWhileAlgebra st A is free holds
for C, I, D, J being Element of A holds
( while (C,I) <> C & while (C,I) <> I & ( while (C,I) = while (D,J) implies ( C = D & I = J ) ) )
proof
let A be preIfWhileAlgebra; ::_thesis: ( A is free implies for C, I, D, J being Element of A holds
( while (C,I) <> C & while (C,I) <> I & ( while (C,I) = while (D,J) implies ( C = D & I = J ) ) ) )
assume A1: A is free ; ::_thesis: for C, I, D, J being Element of A holds
( while (C,I) <> C & while (C,I) <> I & ( while (C,I) = while (D,J) implies ( C = D & I = J ) ) )
let C, I, D, J be Element of A; ::_thesis: ( while (C,I) <> C & while (C,I) <> I & ( while (C,I) = while (D,J) implies ( C = D & I = J ) ) )
A2: dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th48;
A3: <*C,I*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
A4: <*D,J*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
A5: rng <*C,I*> = {C,I} by FINSEQ_2:127;
then A6: C in rng <*C,I*> by TARSKI:def_2;
I in rng <*C,I*> by A5, TARSKI:def_2;
hence ( while (C,I) <> C & while (C,I) <> I ) by A1, A2, A3, A6, Th38; ::_thesis: ( while (C,I) = while (D,J) implies ( C = D & I = J ) )
assume while (C,I) = while (D,J) ; ::_thesis: ( C = D & I = J )
then <*C,I*> = <*D,J*> by A1, A2, A3, A4, Th36;
hence ( C = D & I = J ) by FINSEQ_1:77; ::_thesis: verum
end;
registration
cluster non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction -> non degenerated well_founded for UAStr ;
coherence
for b1 being preIfWhileAlgebra st b1 is free holds
( b1 is well_founded & not b1 is degenerated )
proof
let A be preIfWhileAlgebra; ::_thesis: ( A is free implies ( A is well_founded & not A is degenerated ) )
assume A1: A is free ; ::_thesis: ( A is well_founded & not A is degenerated )
then reconsider A9 = A as free Universal_Algebra ;
set G = the free GeneratorSet of A9;
Generators A = the free GeneratorSet of A9 by Th34;
hence ElementaryInstructions A is GeneratorSet of A by Th31, Th71; :: according to AOFA_000:def_25 ::_thesis: not A is degenerated
thus for I1, I2 being Element of A holds
( not ( I1 <> EmptyIns A & I1 \; I2 = I2 ) & not ( I2 <> EmptyIns A & I1 \; I2 = I1 ) & not ( ( I1 <> EmptyIns A or I2 <> EmptyIns A ) & I1 \; I2 = EmptyIns A ) ) by A1, Th72, Th73; :: according to AOFA_000:def_24 ::_thesis: ( ( for C, I1, I2 being Element of A holds not if-then-else (C,I1,I2) = EmptyIns A ) & ( for C, I being Element of A holds not while (C,I) = EmptyIns A ) & ( for I1, I2, C, J1, J2 being Element of A holds
( not I1 <> EmptyIns A or not I2 <> EmptyIns A or not I1 \; I2 = if-then-else (C,J1,J2) ) ) & ( for I1, I2, C, J being Element of A holds
( not I1 <> EmptyIns A or not I2 <> EmptyIns A or not I1 \; I2 = while (C,J) ) ) & ( for C1, I1, I2, C2, J being Element of A holds not if-then-else (C1,I1,I2) = while (C2,J) ) )
thus ( ( for C, I1, I2 being Element of A holds not if-then-else (C,I1,I2) = EmptyIns A ) & ( for C, I being Element of A holds not while (C,I) = EmptyIns A ) & ( for I1, I2, C, J1, J2 being Element of A holds
( not I1 <> EmptyIns A or not I2 <> EmptyIns A or not I1 \; I2 = if-then-else (C,J1,J2) ) ) & ( for I1, I2, C, J being Element of A holds
( not I1 <> EmptyIns A or not I2 <> EmptyIns A or not I1 \; I2 = while (C,J) ) ) & ( for C1, I1, I2, C2, J being Element of A holds not if-then-else (C1,I1,I2) = while (C2,J) ) ) by A1, Th72, Th73, Th74; ::_thesis: verum
end;
end;
registration
cluster non empty strict partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction infinite non degenerated well_founded ECIW-strict for UAStr ;
existence
ex b1 being preIfWhileAlgebra st
( b1 is infinite & not b1 is degenerated & b1 is well_founded & b1 is ECIW-strict & b1 is free & b1 is strict )
proof
set X = the infinite disjoint_with_NAT set ;
take FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) ; ::_thesis: ( FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is infinite & not FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is degenerated & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is well_founded & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is ECIW-strict & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is free & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is strict )
thus ( FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is infinite & not FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is degenerated & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is well_founded & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is ECIW-strict & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is free & FreeUnivAlgNSG (ECIW-signature, the infinite disjoint_with_NAT set ) is strict ) ; ::_thesis: verum
end;
end;
definition
mode IfWhileAlgebra is non degenerated well_founded ECIW-strict preIfWhileAlgebra;
end;
registration
let A be infinite preIfWhileAlgebra;
cluster ElementaryInstructions A -> infinite ;
coherence
not ElementaryInstructions A is finite by Def23;
end;
theorem Th76: :: AOFA_000:76
for A being preIfWhileAlgebra
for B being Subset of A
for n being Nat holds
( EmptyIns A in B |^ (n + 1) & ( for C, I1, I2 being Element of A st C in B |^ n & I1 in B |^ n & I2 in B |^ n holds
( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) ) ) )
proof
let A be preIfWhileAlgebra; ::_thesis: for B being Subset of A
for n being Nat holds
( EmptyIns A in B |^ (n + 1) & ( for C, I1, I2 being Element of A st C in B |^ n & I1 in B |^ n & I2 in B |^ n holds
( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) ) ) )
let B be Subset of A; ::_thesis: for n being Nat holds
( EmptyIns A in B |^ (n + 1) & ( for C, I1, I2 being Element of A st C in B |^ n & I1 in B |^ n & I2 in B |^ n holds
( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) ) ) )
let n be Nat; ::_thesis: ( EmptyIns A in B |^ (n + 1) & ( for C, I1, I2 being Element of A st C in B |^ n & I1 in B |^ n & I2 in B |^ n holds
( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) ) ) )
set X = { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } ;
A1: B |^ (n + 1) = (B |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by Th19;
reconsider pe = <*> the carrier of A as Element of the carrier of A * by FINSEQ_1:def_11;
A2: pe in {{}} by TARSKI:def_1;
A3: rng pe = {} ;
A4: dom (Den ((In (1,(dom the charact of A))),A)) = {{}} by Th42;
{} c= B |^ n by XBOOLE_1:2;
then EmptyIns A in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by A2, A3, A4;
hence EmptyIns A in B |^ (n + 1) by A1, XBOOLE_0:def_3; ::_thesis: for C, I1, I2 being Element of A st C in B |^ n & I1 in B |^ n & I2 in B |^ n holds
( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) )
let C, I1, I2 be Element of A; ::_thesis: ( C in B |^ n & I1 in B |^ n & I2 in B |^ n implies ( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) ) )
assume A5: C in B |^ n ; ::_thesis: ( not I1 in B |^ n or not I2 in B |^ n or ( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) ) )
assume A6: I1 in B |^ n ; ::_thesis: ( not I2 in B |^ n or ( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) ) )
assume A7: I2 in B |^ n ; ::_thesis: ( I1 \; I2 in B |^ (n + 1) & if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) )
A8: <*I1,I2*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
A9: rng <*I1,I2*> = {I1,I2} by FINSEQ_2:127;
A10: dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th44;
{I1,I2} c= B |^ n by A6, A7, ZFMISC_1:32;
then I1 \; I2 in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by A8, A9, A10;
hence I1 \; I2 in B |^ (n + 1) by A1, XBOOLE_0:def_3; ::_thesis: ( if-then-else (C,I1,I2) in B |^ (n + 1) & while (C,I1) in B |^ (n + 1) )
A11: <*C,I1,I2*> in 3 -tuples_on the carrier of A by FINSEQ_2:139;
A12: rng <*C,I1,I2*> = {C,I1,I2} by FINSEQ_2:128;
A13: dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A by Th47;
{C,I1,I2} c= B |^ n by A5, A6, A7, ZFMISC_1:133;
then if-then-else (C,I1,I2) in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by A11, A12, A13;
hence if-then-else (C,I1,I2) in B |^ (n + 1) by A1, XBOOLE_0:def_3; ::_thesis: while (C,I1) in B |^ (n + 1)
A14: <*C,I1*> in 2 -tuples_on the carrier of A by FINSEQ_2:137;
A15: rng <*C,I1*> = {C,I1} by FINSEQ_2:127;
A16: dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th48;
{C,I1} c= B |^ n by A5, A6, ZFMISC_1:32;
then while (C,I1) in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= B |^ n ) } by A14, A15, A16;
hence while (C,I1) in B |^ (n + 1) by A1, XBOOLE_0:def_3; ::_thesis: verum
end;
theorem Th77: :: AOFA_000:77
for A being ECIW-strict preIfWhileAlgebra
for x being set
for n being Nat holds
( not x in (ElementaryInstructions A) |^ (n + 1) or x in (ElementaryInstructions A) |^ n or x = EmptyIns A or ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
proof
let A be ECIW-strict preIfWhileAlgebra; ::_thesis: for x being set
for n being Nat holds
( not x in (ElementaryInstructions A) |^ (n + 1) or x in (ElementaryInstructions A) |^ n or x = EmptyIns A or ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
set B = ElementaryInstructions A;
let x be set ; ::_thesis: for n being Nat holds
( not x in (ElementaryInstructions A) |^ (n + 1) or x in (ElementaryInstructions A) |^ n or x = EmptyIns A or ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
let n be Nat; ::_thesis: ( not x in (ElementaryInstructions A) |^ (n + 1) or x in (ElementaryInstructions A) |^ n or x = EmptyIns A or ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
assume A1: x in (ElementaryInstructions A) |^ (n + 1) ; ::_thesis: ( x in (ElementaryInstructions A) |^ n or x = EmptyIns A or ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
then reconsider I = x as Element of A ;
assume A2: x nin (ElementaryInstructions A) |^ n ; ::_thesis: ( x = EmptyIns A or ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
assume A3: x <> EmptyIns A ; ::_thesis: ( ex I1, I2 being Element of A st
( x = I1 \; I2 & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
assume A4: for I1, I2 being Element of A holds
( not x = I1 \; I2 or not I1 in (ElementaryInstructions A) |^ n or not I2 in (ElementaryInstructions A) |^ n ) ; ::_thesis: ( ex C, I1, I2 being Element of A st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions A) |^ n & I1 in (ElementaryInstructions A) |^ n & I2 in (ElementaryInstructions A) |^ n ) or ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) )
assume A5: for C, I1, I2 being Element of A holds
( not x = if-then-else (C,I1,I2) or not C in (ElementaryInstructions A) |^ n or not I1 in (ElementaryInstructions A) |^ n or not I2 in (ElementaryInstructions A) |^ n ) ; ::_thesis: ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n )
(ElementaryInstructions A) |^ (n + 1) = ((ElementaryInstructions A) |^ n) \/ { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= (ElementaryInstructions A) |^ n ) } by Th19;
then x in { ((Den (o,A)) . p) where o is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (o,A)) & rng p c= (ElementaryInstructions A) |^ n ) } by A1, A2, XBOOLE_0:def_3;
then consider o being Element of dom the charact of A, p being Element of the carrier of A * such that
A6: I = (Den (o,A)) . p and
A7: p in dom (Den (o,A)) and
A8: rng p c= (ElementaryInstructions A) |^ n ;
reconsider no = o as Element of NAT ;
reconsider oo = Den (o,A) as Element of Operations A ;
len (signature A) = len the charact of A by UNIALG_1:def_4;
then A9: dom (signature A) = dom the charact of A by FINSEQ_3:29;
A10: len p = arity oo by A7, MARGREL1:def_25
.= (signature A) . no by A9, UNIALG_1:def_4
.= ECIW-signature . o by Def27 ;
A11: 1 in Seg 2 ;
A12: 2 in Seg 2 ;
A13: 1 in Seg 3 ;
A14: 2 in Seg 3 ;
A15: 3 in Seg 3 ;
percases ( o = 1 or o = 2 or o = 3 or o = 4 ) by Th55;
supposeA16: o = 1 ; ::_thesis: ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n )
then p = {} by A10, Th54;
hence ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) by A3, A6, A16, FUNCT_7:def_1; ::_thesis: verum
end;
supposeA17: o = 2 ; ::_thesis: ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n )
then A18: p = <*(p . 1),(p . 2)*> by A10, Th54, FINSEQ_1:44;
A19: dom p = Seg 2 by A10, A17, Th54, FINSEQ_1:def_3;
then A20: p . 1 in rng p by A11, FUNCT_1:def_3;
A21: p . 2 in rng p by A12, A19, FUNCT_1:def_3;
then reconsider I1 = p . 1, I2 = p . 2 as Element of A by A20;
I = I1 \; I2 by A6, A17, A18, FUNCT_7:def_1;
hence ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) by A4, A8, A20, A21; ::_thesis: verum
end;
supposeA22: o = 3 ; ::_thesis: ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n )
then A23: p = <*(p . 1),(p . 2),(p . 3)*> by A10, Th54, FINSEQ_1:45;
A24: dom p = Seg 3 by A10, A22, Th54, FINSEQ_1:def_3;
then A25: p . 1 in rng p by A13, FUNCT_1:def_3;
A26: p . 2 in rng p by A14, A24, FUNCT_1:def_3;
A27: p . 3 in rng p by A15, A24, FUNCT_1:def_3;
then reconsider C = p . 1, I1 = p . 2, I2 = p . 3 as Element of A by A25, A26;
I = if-then-else (C,I1,I2) by A6, A22, A23, FUNCT_7:def_1;
hence ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) by A5, A8, A25, A26, A27; ::_thesis: verum
end;
supposeA28: o = 4 ; ::_thesis: ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n )
then A29: p = <*(p . 1),(p . 2)*> by A10, Th54, FINSEQ_1:44;
A30: dom p = Seg 2 by A10, A28, Th54, FINSEQ_1:def_3;
then A31: p . 1 in rng p by A11, FUNCT_1:def_3;
A32: p . 2 in rng p by A12, A30, FUNCT_1:def_3;
then reconsider I1 = p . 1, I2 = p . 2 as Element of A by A31;
I = while (I1,I2) by A6, A28, A29, FUNCT_7:def_1;
hence ex C, I being Element of A st
( x = while (C,I) & C in (ElementaryInstructions A) |^ n & I in (ElementaryInstructions A) |^ n ) by A8, A31, A32; ::_thesis: verum
end;
end;
end;
theorem :: AOFA_000:78
for A being Universal_Algebra
for B being Subset of A holds Constants A c= B |^ 1
proof
let A be Universal_Algebra; ::_thesis: for B being Subset of A holds Constants A c= B |^ 1
let B be Subset of A; ::_thesis: Constants A c= B |^ 1
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin Constants A or not x nin B |^ 1 )
assume x in Constants A ; ::_thesis: not x nin B |^ 1
then consider a being Element of A such that
A1: x = a and
A2: ex o being Element of Operations A st
( arity o = 0 & a in rng o ) ;
consider o being Element of Operations A such that
A3: arity o = 0 and
A4: a in rng o by A2;
consider s being set such that
A5: s in dom o and
A6: a = o . s by A4, FUNCT_1:def_3;
consider z being set such that
A7: z in dom the charact of A and
A8: o = the charact of A . z by FUNCT_1:def_3;
reconsider z = z as Element of dom the charact of A by A7;
A9: Den (z,A) = o by A8;
A10: s is Element of 0 -tuples_on the carrier of A by A3, A5, MARGREL1:22;
reconsider s = s as Element of the carrier of A * by A5;
rng s c= B by A10, RELAT_1:38, XBOOLE_1:2;
then A11: x in { ((Den (r,A)) . p) where r is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (r,A)) & rng p c= B ) } by A1, A5, A6, A9;
B |^ 0 = B by Th18;
then B |^ (0 + 1) = B \/ { ((Den (r,A)) . p) where r is Element of dom the charact of A, p is Element of the carrier of A * : ( p in dom (Den (r,A)) & rng p c= B ) } by Th19;
hence not x nin B |^ 1 by A11, XBOOLE_0:def_3; ::_thesis: verum
end;
theorem Th79: :: AOFA_000:79
for A being preIfWhileAlgebra holds
( A is well_founded iff for I being Element of A ex n being Nat st I in (ElementaryInstructions A) |^ n )
proof
let A be preIfWhileAlgebra; ::_thesis: ( A is well_founded iff for I being Element of A ex n being Nat st I in (ElementaryInstructions A) |^ n )
set B = ElementaryInstructions A;
( A is well_founded iff ElementaryInstructions A is GeneratorSet of A ) by Def25;
hence ( A is well_founded iff for I being Element of A ex n being Nat st I in (ElementaryInstructions A) |^ n ) by Th30; ::_thesis: verum
end;
scheme :: AOFA_000:sch 2
StructInd{ F1() -> well_founded ECIW-strict preIfWhileAlgebra, F2() -> Element of F1(), P1[ set ] } :
P1[F2()]
provided
A1: for I being Element of F1() st I in ElementaryInstructions F1() holds
P1[I] and
A2: P1[ EmptyIns F1()] and
A3: for I1, I2 being Element of F1() st P1[I1] & P1[I2] holds
P1[I1 \; I2] and
A4: for C, I1, I2 being Element of F1() st P1[C] & P1[I1] & P1[I2] holds
P1[ if-then-else (C,I1,I2)] and
A5: for C, I being Element of F1() st P1[C] & P1[I] holds
P1[ while (C,I)]
proof
set A = F1();
A6: ex n being Nat st F2() in (ElementaryInstructions F1()) |^ n by Th79;
defpred S1[ Nat] means for I being Element of F1() st I in (ElementaryInstructions F1()) |^ $1 holds
P1[I];
(ElementaryInstructions F1()) |^ 0 = ElementaryInstructions F1() by Th18;
then A7: S1[ 0 ] by A1;
A8: now__::_thesis:_for_n_being_Nat_st_S1[n]_holds_
S1[n_+_1]
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A9: S1[n] ; ::_thesis: S1[n + 1]
thus S1[n + 1] ::_thesis: verum
proof
let I be Element of F1(); ::_thesis: ( I in (ElementaryInstructions F1()) |^ (n + 1) implies P1[I] )
assume A10: I in (ElementaryInstructions F1()) |^ (n + 1) ; ::_thesis: P1[I]
percases ( I in (ElementaryInstructions F1()) |^ n or I = EmptyIns F1() or ex I1, I2 being Element of F1() st
( I = I1 \; I2 & I1 in (ElementaryInstructions F1()) |^ n & I2 in (ElementaryInstructions F1()) |^ n ) or ex C, I1, I2 being Element of F1() st
( I = if-then-else (C,I1,I2) & C in (ElementaryInstructions F1()) |^ n & I1 in (ElementaryInstructions F1()) |^ n & I2 in (ElementaryInstructions F1()) |^ n ) or ex C, J being Element of F1() st
( I = while (C,J) & C in (ElementaryInstructions F1()) |^ n & J in (ElementaryInstructions F1()) |^ n ) ) by A10, Th77;
suppose I in (ElementaryInstructions F1()) |^ n ; ::_thesis: P1[I]
hence P1[I] by A9; ::_thesis: verum
end;
suppose I = EmptyIns F1() ; ::_thesis: P1[I]
hence P1[I] by A2; ::_thesis: verum
end;
suppose ex I1, I2 being Element of F1() st
( I = I1 \; I2 & I1 in (ElementaryInstructions F1()) |^ n & I2 in (ElementaryInstructions F1()) |^ n ) ; ::_thesis: P1[I]
then consider I1, I2 being Element of F1() such that
A11: I = I1 \; I2 and
A12: I1 in (ElementaryInstructions F1()) |^ n and
A13: I2 in (ElementaryInstructions F1()) |^ n ;
A14: P1[I1] by A9, A12;
P1[I2] by A9, A13;
hence P1[I] by A3, A11, A14; ::_thesis: verum
end;
suppose ex C, I1, I2 being Element of F1() st
( I = if-then-else (C,I1,I2) & C in (ElementaryInstructions F1()) |^ n & I1 in (ElementaryInstructions F1()) |^ n & I2 in (ElementaryInstructions F1()) |^ n ) ; ::_thesis: P1[I]
then consider C, I1, I2 being Element of F1() such that
A15: I = if-then-else (C,I1,I2) and
A16: C in (ElementaryInstructions F1()) |^ n and
A17: I1 in (ElementaryInstructions F1()) |^ n and
A18: I2 in (ElementaryInstructions F1()) |^ n ;
A19: P1[C] by A9, A16;
A20: P1[I1] by A9, A17;
P1[I2] by A9, A18;
hence P1[I] by A4, A15, A19, A20; ::_thesis: verum
end;
suppose ex C, J being Element of F1() st
( I = while (C,J) & C in (ElementaryInstructions F1()) |^ n & J in (ElementaryInstructions F1()) |^ n ) ; ::_thesis: P1[I]
then consider C, J being Element of F1() such that
A21: I = while (C,J) and
A22: C in (ElementaryInstructions F1()) |^ n and
A23: J in (ElementaryInstructions F1()) |^ n ;
A24: P1[C] by A9, A22;
P1[J] by A9, A23;
hence P1[I] by A5, A21, A24; ::_thesis: verum
end;
end;
end;
end;
for n being Nat holds S1[n] from NAT_1:sch_2(A7, A8);
hence P1[F2()] by A6; ::_thesis: verum
end;
begin
definition
let A be preIfWhileAlgebra;
let S be non empty set ;
let f be Function of [:S, the carrier of A:],S;
attrf is complying_with_empty-instruction means :Def28: :: AOFA_000:def 28
for s being Element of S holds f . (s,(EmptyIns A)) = s;
attrf is complying_with_catenation means :Def29: :: AOFA_000:def 29
for s being Element of S
for I1, I2 being Element of A holds f . (s,(I1 \; I2)) = f . ((f . (s,I1)),I2);
end;
:: deftheorem Def28 defines complying_with_empty-instruction AOFA_000:def_28_:_
for A being preIfWhileAlgebra
for S being non empty set
for f being Function of [:S, the carrier of A:],S holds
( f is complying_with_empty-instruction iff for s being Element of S holds f . (s,(EmptyIns A)) = s );
:: deftheorem Def29 defines complying_with_catenation AOFA_000:def_29_:_
for A being preIfWhileAlgebra
for S being non empty set
for f being Function of [:S, the carrier of A:],S holds
( f is complying_with_catenation iff for s being Element of S
for I1, I2 being Element of A holds f . (s,(I1 \; I2)) = f . ((f . (s,I1)),I2) );
definition
let A be preIfWhileAlgebra;
let S be non empty set ;
let T be Subset of S;
let f be Function of [:S, the carrier of A:],S;
predf complies_with_if_wrt T means :Def30: :: AOFA_000:def 30
for s being Element of S
for C, I1, I2 being Element of A holds
( ( f . (s,C) in T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1) ) & ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) ) );
predf complies_with_while_wrt T means :Def31: :: AOFA_000:def 31
for s being Element of S
for C, I being Element of A holds
( ( f . (s,C) in T implies f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I))) ) & ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) );
end;
:: deftheorem Def30 defines complies_with_if_wrt AOFA_000:def_30_:_
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being Function of [:S, the carrier of A:],S holds
( f complies_with_if_wrt T iff for s being Element of S
for C, I1, I2 being Element of A holds
( ( f . (s,C) in T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1) ) & ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) ) ) );
:: deftheorem Def31 defines complies_with_while_wrt AOFA_000:def_31_:_
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being Function of [:S, the carrier of A:],S holds
( f complies_with_while_wrt T iff for s being Element of S
for C, I being Element of A holds
( ( f . (s,C) in T implies f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I))) ) & ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) ) );
theorem :: AOFA_000:80
for A being preIfWhileAlgebra
for C, I being Element of A
for S being non empty set
for T being Subset of S
for f being Function of [:S, the carrier of A:],S st f is complying_with_empty-instruction & f complies_with_if_wrt T holds
for s being Element of S st f . (s,C) nin T holds
f . (s,(if-then (C,I))) = f . (s,C)
proof
let A be preIfWhileAlgebra; ::_thesis: for C, I being Element of A
for S being non empty set
for T being Subset of S
for f being Function of [:S, the carrier of A:],S st f is complying_with_empty-instruction & f complies_with_if_wrt T holds
for s being Element of S st f . (s,C) nin T holds
f . (s,(if-then (C,I))) = f . (s,C)
let C, I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for f being Function of [:S, the carrier of A:],S st f is complying_with_empty-instruction & f complies_with_if_wrt T holds
for s being Element of S st f . (s,C) nin T holds
f . (s,(if-then (C,I))) = f . (s,C)
let S be non empty set ; ::_thesis: for T being Subset of S
for f being Function of [:S, the carrier of A:],S st f is complying_with_empty-instruction & f complies_with_if_wrt T holds
for s being Element of S st f . (s,C) nin T holds
f . (s,(if-then (C,I))) = f . (s,C)
let T be Subset of S; ::_thesis: for f being Function of [:S, the carrier of A:],S st f is complying_with_empty-instruction & f complies_with_if_wrt T holds
for s being Element of S st f . (s,C) nin T holds
f . (s,(if-then (C,I))) = f . (s,C)
let f be Function of [:S, the carrier of A:],S; ::_thesis: ( f is complying_with_empty-instruction & f complies_with_if_wrt T implies for s being Element of S st f . (s,C) nin T holds
f . (s,(if-then (C,I))) = f . (s,C) )
assume that
A1: f is complying_with_empty-instruction and
A2: f complies_with_if_wrt T ; ::_thesis: for s being Element of S st f . (s,C) nin T holds
f . (s,(if-then (C,I))) = f . (s,C)
let s be Element of S; ::_thesis: ( f . (s,C) nin T implies f . (s,(if-then (C,I))) = f . (s,C) )
assume f . (s,C) nin T ; ::_thesis: f . (s,(if-then (C,I))) = f . (s,C)
hence f . (s,(if-then (C,I))) = f . ((f . (s,C)),(EmptyIns A)) by A2, Def30
.= f . (s,C) by A1, Def28 ;
::_thesis: verum
end;
theorem Th81: :: AOFA_000:81
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S holds
( pr1 (S, the carrier of A) is complying_with_empty-instruction & pr1 (S, the carrier of A) is complying_with_catenation & pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T )
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S holds
( pr1 (S, the carrier of A) is complying_with_empty-instruction & pr1 (S, the carrier of A) is complying_with_catenation & pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T )
let S be non empty set ; ::_thesis: for T being Subset of S holds
( pr1 (S, the carrier of A) is complying_with_empty-instruction & pr1 (S, the carrier of A) is complying_with_catenation & pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T )
let T be Subset of S; ::_thesis: ( pr1 (S, the carrier of A) is complying_with_empty-instruction & pr1 (S, the carrier of A) is complying_with_catenation & pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T )
set f = pr1 (S, the carrier of A);
thus for s being Element of S holds (pr1 (S, the carrier of A)) . (s,(EmptyIns A)) = s by FUNCT_3:def_4; :: according to AOFA_000:def_28 ::_thesis: ( pr1 (S, the carrier of A) is complying_with_catenation & pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T )
hereby :: according to AOFA_000:def_29 ::_thesis: ( pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T )
let s be Element of S; ::_thesis: for I1, I2 being Element of A holds (pr1 (S, the carrier of A)) . (s,(I1 \; I2)) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,I1)),I2)
let I1, I2 be Element of A; ::_thesis: (pr1 (S, the carrier of A)) . (s,(I1 \; I2)) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,I1)),I2)
thus (pr1 (S, the carrier of A)) . (s,(I1 \; I2)) = s by FUNCT_3:def_4
.= (pr1 (S, the carrier of A)) . (s,I1) by FUNCT_3:def_4
.= (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,I1)),I2) by FUNCT_3:def_4 ; ::_thesis: verum
end;
hereby :: according to AOFA_000:def_30 ::_thesis: pr1 (S, the carrier of A) complies_with_while_wrt T
let s be Element of S; ::_thesis: for C, I1, I2 being Element of A holds
( ( (pr1 (S, the carrier of A)) . (s,C) in T implies (pr1 (S, the carrier of A)) . (s,(if-then-else (C,I1,I2))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I1) ) & ( (pr1 (S, the carrier of A)) . (s,C) nin T implies (pr1 (S, the carrier of A)) . (s,(if-then-else (C,I1,I2))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I2) ) )
let C, I1, I2 be Element of A; ::_thesis: ( ( (pr1 (S, the carrier of A)) . (s,C) in T implies (pr1 (S, the carrier of A)) . (s,(if-then-else (C,I1,I2))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I1) ) & ( (pr1 (S, the carrier of A)) . (s,C) nin T implies (pr1 (S, the carrier of A)) . (s,(if-then-else (C,I1,I2))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I2) ) )
(pr1 (S, the carrier of A)) . (s,(if-then-else (C,I1,I2))) = s by FUNCT_3:def_4
.= (pr1 (S, the carrier of A)) . (s,C) by FUNCT_3:def_4 ;
hence ( ( (pr1 (S, the carrier of A)) . (s,C) in T implies (pr1 (S, the carrier of A)) . (s,(if-then-else (C,I1,I2))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I1) ) & ( (pr1 (S, the carrier of A)) . (s,C) nin T implies (pr1 (S, the carrier of A)) . (s,(if-then-else (C,I1,I2))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I2) ) ) by FUNCT_3:def_4; ::_thesis: verum
end;
let s be Element of S; :: according to AOFA_000:def_31 ::_thesis: for C, I being Element of A holds
( ( (pr1 (S, the carrier of A)) . (s,C) in T implies (pr1 (S, the carrier of A)) . (s,(while (C,I))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I)),(while (C,I))) ) & ( (pr1 (S, the carrier of A)) . (s,C) nin T implies (pr1 (S, the carrier of A)) . (s,(while (C,I))) = (pr1 (S, the carrier of A)) . (s,C) ) )
let C, I be Element of A; ::_thesis: ( ( (pr1 (S, the carrier of A)) . (s,C) in T implies (pr1 (S, the carrier of A)) . (s,(while (C,I))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I)),(while (C,I))) ) & ( (pr1 (S, the carrier of A)) . (s,C) nin T implies (pr1 (S, the carrier of A)) . (s,(while (C,I))) = (pr1 (S, the carrier of A)) . (s,C) ) )
(pr1 (S, the carrier of A)) . (s,C) = s by FUNCT_3:def_4;
hence ( ( (pr1 (S, the carrier of A)) . (s,C) in T implies (pr1 (S, the carrier of A)) . (s,(while (C,I))) = (pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (((pr1 (S, the carrier of A)) . (s,C)),I)),(while (C,I))) ) & ( (pr1 (S, the carrier of A)) . (s,C) nin T implies (pr1 (S, the carrier of A)) . (s,(while (C,I))) = (pr1 (S, the carrier of A)) . (s,C) ) ) by FUNCT_3:def_4; ::_thesis: verum
end;
definition
let A be preIfWhileAlgebra;
let S be non empty set ;
let T be Subset of S;
mode ExecutionFunction of A,S,T -> Function of [:S, the carrier of A:],S means :Def32: :: AOFA_000:def 32
( it is complying_with_empty-instruction & it is complying_with_catenation & it complies_with_if_wrt T & it complies_with_while_wrt T );
existence
ex b1 being Function of [:S, the carrier of A:],S st
( b1 is complying_with_empty-instruction & b1 is complying_with_catenation & b1 complies_with_if_wrt T & b1 complies_with_while_wrt T )
proof
take pr1 (S, the carrier of A) ; ::_thesis: ( pr1 (S, the carrier of A) is complying_with_empty-instruction & pr1 (S, the carrier of A) is complying_with_catenation & pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T )
thus ( pr1 (S, the carrier of A) is complying_with_empty-instruction & pr1 (S, the carrier of A) is complying_with_catenation & pr1 (S, the carrier of A) complies_with_if_wrt T & pr1 (S, the carrier of A) complies_with_while_wrt T ) by Th81; ::_thesis: verum
end;
end;
:: deftheorem Def32 defines ExecutionFunction AOFA_000:def_32_:_
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for b4 being Function of [:S, the carrier of A:],S holds
( b4 is ExecutionFunction of A,S,T iff ( b4 is complying_with_empty-instruction & b4 is complying_with_catenation & b4 complies_with_if_wrt T & b4 complies_with_while_wrt T ) );
registration
let A be preIfWhileAlgebra;
let S be non empty set ;
let T be Subset of S;
cluster -> complying_with_empty-instruction complying_with_catenation for ExecutionFunction of A,S,T;
coherence
for b1 being ExecutionFunction of A,S,T holds
( b1 is complying_with_empty-instruction & b1 is complying_with_catenation ) by Def32;
end;
definition
let A be preIfWhileAlgebra;
let I be Element of A;
let S be non empty set ;
let s be Element of S;
let T be Subset of S;
let f be ExecutionFunction of A,S,T;
predf iteration_terminates_for I,s means :Def33: :: AOFA_000:def 33
ex r being non empty FinSequence of S st
( r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) );
end;
:: deftheorem Def33 defines iteration_terminates_for AOFA_000:def_33_:_
for A being preIfWhileAlgebra
for I being Element of A
for S being non empty set
for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds
( f iteration_terminates_for I,s iff ex r being non empty FinSequence of S st
( r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) );
definition
let A be preIfWhileAlgebra;
let I be Element of A;
let S be non empty set ;
let s be Element of S;
let T be Subset of S;
let f be ExecutionFunction of A,S,T;
func iteration-degree (I,s,f) -> R_eal means :Def34: :: AOFA_000:def 34
ex r being non empty FinSequence of S st
( it = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) if f iteration_terminates_for I,s
otherwise it = +infty ;
correctness
consistency
for b1 being R_eal holds verum;
existence
( ( for b1 being R_eal holds verum ) & ( f iteration_terminates_for I,s implies ex b1 being R_eal ex r being non empty FinSequence of S st
( b1 = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) ) & ( not f iteration_terminates_for I,s implies ex b1 being R_eal st b1 = +infty ) );
uniqueness
for b1, b2 being R_eal holds
( ( f iteration_terminates_for I,s & ex r being non empty FinSequence of S st
( b1 = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) & ex r being non empty FinSequence of S st
( b2 = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) implies b1 = b2 ) & ( not f iteration_terminates_for I,s & b1 = +infty & b2 = +infty implies b1 = b2 ) );
proof
A1: now__::_thesis:_(_f_iteration_terminates_for_I,s_implies_ex_x_being_R_eal_ex_r_being_non_empty_FinSequence_of_S_st_
(_x_=_(len_r)_-_1_&_r_._1_=_s_&_r_._(len_r)_nin_T_&_(_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_r_._(i_+_1)_=_f_._((r_._i),I)_)_)_)_)
assume f iteration_terminates_for I,s ; ::_thesis: ex x being R_eal ex r being non empty FinSequence of S st
( x = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) )
then consider r being non empty FinSequence of S such that
A2: r . 1 = s and
A3: r . (len r) nin T and
A4: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) by Def33;
reconsider x = (len r) - 1 as R_eal by XXREAL_0:def_1;
take x = x; ::_thesis: ex r being non empty FinSequence of S st
( x = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) )
take r = r; ::_thesis: ( x = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) )
thus ( x = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) by A2, A3, A4; ::_thesis: verum
end;
now__::_thesis:_for_d1,_d2_being_R_eal_st_ex_r1_being_non_empty_FinSequence_of_S_st_
(_d1_=_(len_r1)_-_1_&_r1_._1_=_s_&_r1_._(len_r1)_nin_T_&_(_for_i_being_Nat_st_1_<=_i_&_i_<_len_r1_holds_
(_r1_._i_in_T_&_r1_._(i_+_1)_=_f_._((r1_._i),I)_)_)_)_&_ex_r2_being_non_empty_FinSequence_of_S_st_
(_d2_=_(len_r2)_-_1_&_r2_._1_=_s_&_r2_._(len_r2)_nin_T_&_(_for_i_being_Nat_st_1_<=_i_&_i_<_len_r2_holds_
(_r2_._i_in_T_&_r2_._(i_+_1)_=_f_._((r2_._i),I)_)_)_)_holds_
d1_=_d2
let d1, d2 be R_eal; ::_thesis: ( ex r1 being non empty FinSequence of S st
( d1 = (len r1) - 1 & r1 . 1 = s & r1 . (len r1) nin T & ( for i being Nat st 1 <= i & i < len r1 holds
( r1 . i in T & r1 . (i + 1) = f . ((r1 . i),I) ) ) ) & ex r2 being non empty FinSequence of S st
( d2 = (len r2) - 1 & r2 . 1 = s & r2 . (len r2) nin T & ( for i being Nat st 1 <= i & i < len r2 holds
( r2 . i in T & r2 . (i + 1) = f . ((r2 . i),I) ) ) ) implies d1 = d2 )
given r1 being non empty FinSequence of S such that A5: d1 = (len r1) - 1 and
A6: r1 . 1 = s and
A7: r1 . (len r1) nin T and
A8: for i being Nat st 1 <= i & i < len r1 holds
( r1 . i in T & r1 . (i + 1) = f . ((r1 . i),I) ) ; ::_thesis: ( ex r2 being non empty FinSequence of S st
( d2 = (len r2) - 1 & r2 . 1 = s & r2 . (len r2) nin T & ( for i being Nat st 1 <= i & i < len r2 holds
( r2 . i in T & r2 . (i + 1) = f . ((r2 . i),I) ) ) ) implies d1 = d2 )
given r2 being non empty FinSequence of S such that A9: d2 = (len r2) - 1 and
A10: r2 . 1 = s and
A11: r2 . (len r2) nin T and
A12: for i being Nat st 1 <= i & i < len r2 holds
( r2 . i in T & r2 . (i + 1) = f . ((r2 . i),I) ) ; ::_thesis: d1 = d2
defpred S1[ Nat] means ( $1 < len r1 implies ( $1 < len r2 & r1 . ($1 + 1) = r2 . ($1 + 1) ) );
A13: S1[ 0 ] by A6, A10;
A14: now__::_thesis:_for_i_being_Element_of_NAT_st_S1[i]_holds_
S1[i_+_1]
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A15: S1[i] ; ::_thesis: S1[i + 1]
thus S1[i + 1] ::_thesis: verum
proof
assume A16: i + 1 < len r1 ; ::_thesis: ( i + 1 < len r2 & r1 . ((i + 1) + 1) = r2 . ((i + 1) + 1) )
A17: 1 <= i + 1 by NAT_1:11;
then A18: r1 . ((i + 1) + 1) = f . ((r1 . (i + 1)),I) by A8, A16;
A19: r1 . (i + 1) in T by A8, A16, A17;
i + 1 <= len r2 by A15, A16, NAT_1:13;
hence i + 1 < len r2 by A11, A15, A16, A19, NAT_1:13, XXREAL_0:1; ::_thesis: r1 . ((i + 1) + 1) = r2 . ((i + 1) + 1)
hence r1 . ((i + 1) + 1) = r2 . ((i + 1) + 1) by A12, A15, A16, A17, A18, NAT_1:13; ::_thesis: verum
end;
end;
A20: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A13, A14);
consider i being Nat such that
A21: len r1 = i + 1 by NAT_1:6;
reconsider i = i as Element of NAT by ORDINAL1:def_12;
i < len r1 by A21, NAT_1:13;
then A22: r1 . (len r1) = r2 . (len r1) by A20, A21;
A23: 1 <= len r1 by A21, NAT_1:11;
A24: len r1 <= len r2 by A20;
len r2 <= len r1 by A7, A12, A22, A23;
hence d1 = d2 by A5, A9, A24, XXREAL_0:1; ::_thesis: verum
end;
hence ( ( for b1 being R_eal holds verum ) & ( f iteration_terminates_for I,s implies ex b1 being R_eal ex r being non empty FinSequence of S st
( b1 = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) ) & ( not f iteration_terminates_for I,s implies ex b1 being R_eal st b1 = +infty ) & ( for b1, b2 being R_eal holds
( ( f iteration_terminates_for I,s & ex r being non empty FinSequence of S st
( b1 = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) & ex r being non empty FinSequence of S st
( b2 = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) implies b1 = b2 ) & ( not f iteration_terminates_for I,s & b1 = +infty & b2 = +infty implies b1 = b2 ) ) ) ) by A1; ::_thesis: verum
end;
end;
:: deftheorem Def34 defines iteration-degree AOFA_000:def_34_:_
for A being preIfWhileAlgebra
for I being Element of A
for S being non empty set
for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T
for b7 being R_eal holds
( ( f iteration_terminates_for I,s implies ( b7 = iteration-degree (I,s,f) iff ex r being non empty FinSequence of S st
( b7 = (len r) - 1 & r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) ) ) ) & ( not f iteration_terminates_for I,s implies ( b7 = iteration-degree (I,s,f) iff b7 = +infty ) ) );
theorem :: AOFA_000:82
for A being preIfWhileAlgebra
for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds
( f iteration_terminates_for I,s iff iteration-degree (I,s,f) < +infty )
proof
let A be preIfWhileAlgebra; ::_thesis: for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds
( f iteration_terminates_for I,s iff iteration-degree (I,s,f) < +infty )
let I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds
( f iteration_terminates_for I,s iff iteration-degree (I,s,f) < +infty )
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds
( f iteration_terminates_for I,s iff iteration-degree (I,s,f) < +infty )
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T holds
( f iteration_terminates_for I,s iff iteration-degree (I,s,f) < +infty )
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T holds
( f iteration_terminates_for I,s iff iteration-degree (I,s,f) < +infty )
let f be ExecutionFunction of A,S,T; ::_thesis: ( f iteration_terminates_for I,s iff iteration-degree (I,s,f) < +infty )
hereby ::_thesis: ( iteration-degree (I,s,f) < +infty implies f iteration_terminates_for I,s )
assume f iteration_terminates_for I,s ; ::_thesis: iteration-degree (I,s,f) < +infty
then consider r being non empty FinSequence of S such that
A1: iteration-degree (I,s,f) = (len r) - 1 and
r . 1 = s and
r . (len r) nin T and
for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) by Def34;
(len r) - 1 in REAL by XREAL_0:def_1;
hence iteration-degree (I,s,f) < +infty by A1, XXREAL_0:9; ::_thesis: verum
end;
thus ( iteration-degree (I,s,f) < +infty implies f iteration_terminates_for I,s ) by Def34; ::_thesis: verum
end;
theorem Th83: :: AOFA_000:83
for A being preIfWhileAlgebra
for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s nin T holds
( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 )
proof
let A be preIfWhileAlgebra; ::_thesis: for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s nin T holds
( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 )
let I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s nin T holds
( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 )
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s nin T holds
( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 )
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T st s nin T holds
( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 )
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T st s nin T holds
( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 )
let f be ExecutionFunction of A,S,T; ::_thesis: ( s nin T implies ( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 ) )
assume A1: s nin T ; ::_thesis: ( f iteration_terminates_for I,s & iteration-degree (I,s,f) = 0 )
set r = <*s*>;
A2: <*s*> . 1 = s by FINSEQ_1:40;
A3: len <*s*> = 1 by FINSEQ_1:40;
A4: for i being Nat st 1 <= i & i < len <*s*> holds
( <*s*> . i in T & <*s*> . (i + 1) = f . ((<*s*> . i),I) ) by FINSEQ_1:40;
A5: 1 - 1 = 0. ;
thus f iteration_terminates_for I,s ::_thesis: iteration-degree (I,s,f) = 0
proof
take <*s*> ; :: according to AOFA_000:def_33 ::_thesis: ( <*s*> . 1 = s & <*s*> . (len <*s*>) nin T & ( for i being Nat st 1 <= i & i < len <*s*> holds
( <*s*> . i in T & <*s*> . (i + 1) = f . ((<*s*> . i),I) ) ) )
thus ( <*s*> . 1 = s & <*s*> . (len <*s*>) nin T & ( for i being Nat st 1 <= i & i < len <*s*> holds
( <*s*> . i in T & <*s*> . (i + 1) = f . ((<*s*> . i),I) ) ) ) by A1, A2, FINSEQ_1:40; ::_thesis: verum
end;
hence iteration-degree (I,s,f) = 0 by A1, A2, A3, A4, A5, Def34; ::_thesis: verum
end;
theorem :: AOFA_000:84
for A being preIfWhileAlgebra
for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s in T holds
( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) )
proof
let A be preIfWhileAlgebra; ::_thesis: for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s in T holds
( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) )
let I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s in T holds
( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) )
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st s in T holds
( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) )
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T st s in T holds
( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) )
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T st s in T holds
( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) )
let f be ExecutionFunction of A,S,T; ::_thesis: ( s in T implies ( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) ) )
assume A1: s in T ; ::_thesis: ( ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) & ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s ) & iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) )
thus A2: ( f iteration_terminates_for I,s iff f iteration_terminates_for I,f . (s,I) ) ::_thesis: iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f))
proof
thus ( f iteration_terminates_for I,s implies f iteration_terminates_for I,f . (s,I) ) ::_thesis: ( f iteration_terminates_for I,f . (s,I) implies f iteration_terminates_for I,s )
proof
given r being non empty FinSequence of S such that A3: r . 1 = s and
A4: r . (len r) nin T and
A5: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ; :: according to AOFA_000:def_33 ::_thesis: f iteration_terminates_for I,f . (s,I)
consider r1 being Element of S, q being FinSequence of S such that
r1 = r . 1 and
A6: r = <*r1*> ^ q by FINSEQ_3:102;
A7: len r = 1 + (len q) by A6, FINSEQ_5:8;
then reconsider q = q as non empty FinSequence of S by A1, A3, A4, CARD_1:27;
len r >= 1 by A7, NAT_1:11;
then A8: 1 < len r by A1, A3, A4, XXREAL_0:1;
A9: len q >= 0 + 1 by NAT_1:13;
take q ; :: according to AOFA_000:def_33 ::_thesis: ( q . 1 = f . (s,I) & q . (len q) nin T & ( for i being Nat st 1 <= i & i < len q holds
( q . i in T & q . (i + 1) = f . ((q . i),I) ) ) )
A10: len <*r1*> = 1 by FINSEQ_1:40;
1 in dom q by A9, FINSEQ_3:25;
hence q . 1 = r . (1 + 1) by A6, A10, FINSEQ_1:def_7
.= f . (s,I) by A3, A5, A8 ;
::_thesis: ( q . (len q) nin T & ( for i being Nat st 1 <= i & i < len q holds
( q . i in T & q . (i + 1) = f . ((q . i),I) ) ) )
len q in dom q by A9, FINSEQ_3:25;
hence q . (len q) nin T by A4, A6, A7, A10, FINSEQ_1:def_7; ::_thesis: for i being Nat st 1 <= i & i < len q holds
( q . i in T & q . (i + 1) = f . ((q . i),I) )
let i be Nat; ::_thesis: ( 1 <= i & i < len q implies ( q . i in T & q . (i + 1) = f . ((q . i),I) ) )
assume that
A11: 1 <= i and
A12: i < len q ; ::_thesis: ( q . i in T & q . (i + 1) = f . ((q . i),I) )
A13: i in NAT by ORDINAL1:def_12;
then A14: i in dom q by A11, A12, MSUALG_8:1;
A15: 1 <= i + 1 by NAT_1:11;
A16: i + 1 < len r by A7, A12, XREAL_1:6;
A17: i + 1 in dom q by A11, A12, A13, MSUALG_8:1;
A18: r . (i + 1) = q . i by A6, A10, A14, FINSEQ_1:def_7;
r . ((i + 1) + 1) = q . (i + 1) by A6, A10, A17, FINSEQ_1:def_7;
hence ( q . i in T & q . (i + 1) = f . ((q . i),I) ) by A5, A15, A16, A18; ::_thesis: verum
end;
given q being non empty FinSequence of S such that A19: q . 1 = f . (s,I) and
A20: q . (len q) nin T and
A21: for i being Nat st 1 <= i & i < len q holds
( q . i in T & q . (i + 1) = f . ((q . i),I) ) ; :: according to AOFA_000:def_33 ::_thesis: f iteration_terminates_for I,s
take r = <*s*> ^ q; :: according to AOFA_000:def_33 ::_thesis: ( r . 1 = s & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) )
A22: len <*s*> = 1 by FINSEQ_1:40;
thus A23: r . 1 = s by FINSEQ_1:41; ::_thesis: ( r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ) )
A24: len r = 1 + (len q) by FINSEQ_5:8;
A25: 0 + 1 <= len q by NAT_1:13;
then len q in dom q by FINSEQ_3:25;
hence r . (len r) nin T by A20, A22, A24, FINSEQ_1:def_7; ::_thesis: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) )
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & r . (i + 1) = f . ((r . i),I) ) )
assume that
A26: 1 <= i and
A27: i < len r ; ::_thesis: ( r . i in T & r . (i + 1) = f . ((r . i),I) )
consider j being Nat such that
A28: i = 1 + j by A26, NAT_1:10;
percases ( j = 0 or j > 0 ) ;
supposeA29: j = 0 ; ::_thesis: ( r . i in T & r . (i + 1) = f . ((r . i),I) )
1 in dom q by A25, FINSEQ_3:25;
hence ( r . i in T & r . (i + 1) = f . ((r . i),I) ) by A1, A19, A22, A23, A28, A29, FINSEQ_1:def_7; ::_thesis: verum
end;
suppose j > 0 ; ::_thesis: ( r . i in T & r . (i + 1) = f . ((r . i),I) )
then A30: j >= 0 + 1 by NAT_1:13;
A31: j < len q by A24, A27, A28, XREAL_1:6;
A32: j in NAT by ORDINAL1:def_12;
then A33: j in dom q by A30, A31, MSUALG_8:1;
A34: j + 1 in dom q by A30, A31, A32, MSUALG_8:1;
A35: r . (j + 1) = q . j by A22, A33, FINSEQ_1:def_7;
r . ((j + 1) + 1) = q . (j + 1) by A22, A34, FINSEQ_1:def_7;
hence ( r . i in T & r . (i + 1) = f . ((r . i),I) ) by A21, A28, A30, A31, A35; ::_thesis: verum
end;
end;
end;
percases ( not f iteration_terminates_for I,s or f iteration_terminates_for I,f . (s,I) ) by A2;
supposeA36: not f iteration_terminates_for I,s ; ::_thesis: iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f))
then A37: iteration-degree (I,s,f) = +infty by Def34;
iteration-degree (I,(f . (s,I)),f) = +infty by A2, A36, Def34;
hence iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) by A37, XXREAL_3:def_2; ::_thesis: verum
end;
supposeA38: f iteration_terminates_for I,f . (s,I) ; ::_thesis: iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f))
then consider q being non empty FinSequence of S such that
A39: iteration-degree (I,(f . (s,I)),f) = (len q) - 1 and
A40: q . 1 = f . (s,I) and
A41: q . (len q) nin T and
A42: for i being Nat st 1 <= i & i < len q holds
( q . i in T & q . (i + 1) = f . ((q . i),I) ) by Def34;
set r = <*s*> ^ q;
A43: len <*s*> = 1 by FINSEQ_1:40;
A44: (<*s*> ^ q) . 1 = s by FINSEQ_1:41;
A45: len (<*s*> ^ q) = 1 + (len q) by FINSEQ_5:8;
1 + ((len q) - 1) = len q ;
then A46: (len (<*s*> ^ q)) - 1 = 1. + (iteration-degree (I,(f . (s,I)),f)) by A39, A45, XXREAL_3:def_2;
A47: 0 + 1 <= len q by NAT_1:13;
then len q in dom q by FINSEQ_3:25;
then A48: (<*s*> ^ q) . (len (<*s*> ^ q)) nin T by A41, A43, A45, FINSEQ_1:def_7;
now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_(<*s*>_^_q)_holds_
(_(<*s*>_^_q)_._i_in_T_&_(<*s*>_^_q)_._(i_+_1)_=_f_._(((<*s*>_^_q)_._i),I)_)
let i be Nat; ::_thesis: ( 1 <= i & i < len (<*s*> ^ q) implies ( (<*s*> ^ q) . b1 in T & (<*s*> ^ q) . (b1 + 1) = f . (((<*s*> ^ q) . b1),I) ) )
assume that
A49: 1 <= i and
A50: i < len (<*s*> ^ q) ; ::_thesis: ( (<*s*> ^ q) . b1 in T & (<*s*> ^ q) . (b1 + 1) = f . (((<*s*> ^ q) . b1),I) )
consider j being Nat such that
A51: i = 1 + j by A49, NAT_1:10;
percases ( j = 0 or j > 0 ) ;
supposeA52: j = 0 ; ::_thesis: ( (<*s*> ^ q) . b1 in T & (<*s*> ^ q) . (b1 + 1) = f . (((<*s*> ^ q) . b1),I) )
1 in dom q by A47, FINSEQ_3:25;
hence ( (<*s*> ^ q) . i in T & (<*s*> ^ q) . (i + 1) = f . (((<*s*> ^ q) . i),I) ) by A1, A40, A43, A44, A51, A52, FINSEQ_1:def_7; ::_thesis: verum
end;
suppose j > 0 ; ::_thesis: ( (<*s*> ^ q) . b1 in T & (<*s*> ^ q) . (b1 + 1) = f . (((<*s*> ^ q) . b1),I) )
then A53: j >= 0 + 1 by NAT_1:13;
A54: j < len q by A45, A50, A51, XREAL_1:6;
A55: j in NAT by ORDINAL1:def_12;
then A56: j in dom q by A53, A54, MSUALG_8:1;
A57: j + 1 in dom q by A53, A54, A55, MSUALG_8:1;
A58: (<*s*> ^ q) . (j + 1) = q . j by A43, A56, FINSEQ_1:def_7;
(<*s*> ^ q) . ((j + 1) + 1) = q . (j + 1) by A43, A57, FINSEQ_1:def_7;
hence ( (<*s*> ^ q) . i in T & (<*s*> ^ q) . (i + 1) = f . (((<*s*> ^ q) . i),I) ) by A42, A51, A53, A54, A58; ::_thesis: verum
end;
end;
end;
hence iteration-degree (I,s,f) = 1. + (iteration-degree (I,(f . (s,I)),f)) by A2, A38, A44, A46, A48, Def34; ::_thesis: verum
end;
end;
end;
theorem :: AOFA_000:85
for A being preIfWhileAlgebra
for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds iteration-degree (I,s,f) >= 0
proof
let A be preIfWhileAlgebra; ::_thesis: for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds iteration-degree (I,s,f) >= 0
let I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds iteration-degree (I,s,f) >= 0
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds iteration-degree (I,s,f) >= 0
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T holds iteration-degree (I,s,f) >= 0
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T holds iteration-degree (I,s,f) >= 0
let f be ExecutionFunction of A,S,T; ::_thesis: iteration-degree (I,s,f) >= 0
percases ( not f iteration_terminates_for I,s or f iteration_terminates_for I,s ) ;
suppose not f iteration_terminates_for I,s ; ::_thesis: iteration-degree (I,s,f) >= 0
hence iteration-degree (I,s,f) >= 0 by Def34; ::_thesis: verum
end;
suppose f iteration_terminates_for I,s ; ::_thesis: iteration-degree (I,s,f) >= 0
then consider r being non empty FinSequence of S such that
A1: iteration-degree (I,s,f) = (len r) - 1 and
r . 1 = s and
r . (len r) nin T and
for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) by Def34;
ex i being Nat st len r = i + 1 by NAT_1:6;
hence iteration-degree (I,s,f) >= 0 by A1; ::_thesis: verum
end;
end;
end;
scheme :: AOFA_000:sch 3
Termination{ F1() -> preIfWhileAlgebra, F2() -> Element of F1(), F3() -> non empty set , F4() -> Element of F3(), F5() -> Subset of F3(), F6() -> ExecutionFunction of F1(),F3(),F5(), F7( set ) -> Nat, P1[ set ] } :
F6() iteration_terminates_for F2(),F4()
provided
A1: ( F4() in F5() iff P1[F4()] ) and
A2: for s being Element of F3() st P1[s] holds
( ( P1[F6() . (s,F2())] implies F6() . (s,F2()) in F5() ) & ( F6() . (s,F2()) in F5() implies P1[F6() . (s,F2())] ) & F7((F6() . (s,F2()))) < F7(s) )
proof
percases ( F4() nin F5() or F4() in F5() ) ;
suppose F4() nin F5() ; ::_thesis: F6() iteration_terminates_for F2(),F4()
hence F6() iteration_terminates_for F2(),F4() by Th83; ::_thesis: verum
end;
supposeA3: F4() in F5() ; ::_thesis: F6() iteration_terminates_for F2(),F4()
deffunc H1( set , set ) -> Element of F3() = F6() . ((In ($2,F3())),F2());
consider f being Function of NAT,F3() such that
A4: f . 0 = F4() and
A5: for i being Nat holds f . (i + 1) = H1(i,f . i) from NAT_1:sch_12();
defpred S1[ Nat] means ex i being Element of NAT st F7((f . i)) = $1;
F7((f . 0)) in NAT by ORDINAL1:def_12;
then A6: ex j being Nat st S1[j] ;
consider j being Nat such that
A7: ( S1[j] & ( for i being Nat st S1[i] holds
j <= i ) ) from NAT_1:sch_5(A6);
consider i0 being Element of NAT such that
A8: F7((f . i0)) = j by A7;
defpred S2[ Nat] means P1[f . $1];
In ((f . i0),F3()) = f . i0 by FUNCT_7:def_1;
then f . (i0 + 1) = F6() . ((f . i0),F2()) by A5;
then ( P1[f . i0] implies F7((f . (i0 + 1))) < j ) by A2, A8;
then A9: ex i being Nat st S2[i] by A7;
consider j being Nat such that
A10: ( S2[j] & ( for i being Nat st S2[i] holds
j <= i ) ) from NAT_1:sch_5(A9);
deffunc H2( Nat) -> Element of F3() = f . ($1 -' 1);
consider p being FinSequence of F3() such that
A11: ( len p = j + 1 & ( for i being Nat st i in dom p holds
p . i = H2(i) ) ) from FINSEQ_2:sch_1();
A12: dom p = Seg (j + 1) by A11, FINSEQ_1:def_3;
reconsider p = p as non empty FinSequence of F3() by A11;
take p ; :: according to AOFA_000:def_33 ::_thesis: ( p . 1 = F4() & p . (len p) nin F5() & ( for i being Nat st 1 <= i & i < len p holds
( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) ) )
A13: 1 <= j + 1 by NAT_1:11;
then 1 in Seg (j + 1) ;
hence p . 1 = H2(1) by A11, A12
.= F4() by A4, XREAL_1:232 ;
::_thesis: ( p . (len p) nin F5() & ( for i being Nat st 1 <= i & i < len p holds
( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) ) )
len p in Seg (j + 1) by A11, A13;
then A14: p . (len p) = H2(j + 1) by A11, A12
.= f . j by NAT_D:34 ;
j > 0 by A1, A3, A4, A10;
then j >= 0 + 1 by NAT_1:13;
then consider j9 being Nat such that
A15: j = 1 + j9 by NAT_1:10;
reconsider j9 = j9 as Element of NAT by ORDINAL1:def_12;
A16: f . j = F6() . ((In ((f . j9),F3())),F2()) by A5, A15;
j9 < j by A15, NAT_1:13;
then A17: P1[f . j9] by A10;
In ((f . j9),F3()) = f . j9 by FUNCT_7:def_1;
hence p . (len p) nin F5() by A2, A10, A14, A16, A17; ::_thesis: for i being Nat st 1 <= i & i < len p holds
( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) )
let i be Nat; ::_thesis: ( 1 <= i & i < len p implies ( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) )
assume that
A18: 1 <= i and
A19: i < len p ; ::_thesis: ( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) )
A20: i + 1 >= 1 by A18, NAT_1:13;
A21: i + 1 <= len p by A19, NAT_1:13;
A22: i in Seg (j + 1) by A11, A18, A19, FINSEQ_1:1;
A23: i + 1 in Seg (j + 1) by A11, A20, A21;
A24: p . i = H2(i) by A11, A12, A22;
A25: p . (i + 1) = H2(i + 1) by A11, A12, A23;
consider i9 being Nat such that
A26: i = 1 + i9 by A18, NAT_1:10;
reconsider i9 = i9 as Element of NAT by ORDINAL1:def_12;
i <= j by A11, A19, NAT_1:13;
then A27: i9 < j by A26, NAT_1:13;
then A28: P1[f . i9] by A10;
A29: i -' 1 = i9 by A26, NAT_D:34;
A30: (i + 1) -' 1 = i by NAT_D:34;
A31: In ((f . i9),F3()) = f . i9 by FUNCT_7:def_1;
now__::_thesis:_(_i9_<>_0_implies_p_._i_in_F5()_)
assume i9 <> 0 ; ::_thesis: p . i in F5()
then i9 >= 0 + 1 by NAT_1:13;
then consider i99 being Nat such that
A32: i9 = 1 + i99 by NAT_1:10;
reconsider i99 = i99 as Element of NAT by ORDINAL1:def_12;
i99 <= i9 by A32, NAT_1:11;
then i99 < j by A27, XXREAL_0:2;
then A33: P1[f . i99] by A10;
A34: In ((f . i99),F3()) = f . i99 by FUNCT_7:def_1;
f . i9 = H1(i99,f . i99) by A5, A32;
hence p . i in F5() by A2, A24, A28, A29, A33, A34; ::_thesis: verum
end;
hence ( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) by A3, A4, A5, A24, A25, A26, A29, A30, A31; ::_thesis: verum
end;
end;
end;
scheme :: AOFA_000:sch 4
Termination2{ F1() -> preIfWhileAlgebra, F2() -> Element of F1(), F3() -> non empty set , F4() -> Element of F3(), F5() -> Subset of F3(), F6() -> ExecutionFunction of F1(),F3(),F5(), F7( set ) -> Nat, P1[ set ], P2[ set ] } :
F6() iteration_terminates_for F2(),F4()
provided
A1: P1[F4()] and
A2: ( F4() in F5() iff P2[F4()] ) and
A3: for s being Element of F3() st P1[s] & s in F5() & P2[s] holds
( P1[F6() . (s,F2())] & ( P2[F6() . (s,F2())] implies F6() . (s,F2()) in F5() ) & ( F6() . (s,F2()) in F5() implies P2[F6() . (s,F2())] ) & F7((F6() . (s,F2()))) < F7(s) )
proof
percases ( F4() nin F5() or F4() in F5() ) ;
suppose F4() nin F5() ; ::_thesis: F6() iteration_terminates_for F2(),F4()
hence F6() iteration_terminates_for F2(),F4() by Th83; ::_thesis: verum
end;
supposeA4: F4() in F5() ; ::_thesis: F6() iteration_terminates_for F2(),F4()
deffunc H1( set , set ) -> Element of F3() = F6() . ((In ($2,F3())),F2());
consider f being Function of NAT,F3() such that
A5: f . 0 = F4() and
A6: for i being Nat holds f . (i + 1) = H1(i,f . i) from NAT_1:sch_12();
defpred S1[ Nat] means ex i being Element of NAT st F7((f . i)) = $1;
F7((f . 0)) in NAT by ORDINAL1:def_12;
then A7: ex j being Nat st S1[j] ;
consider j being Nat such that
A8: ( S1[j] & ( for i being Nat st S1[i] holds
j <= i ) ) from NAT_1:sch_5(A7);
consider i0 being Element of NAT such that
A9: F7((f . i0)) = j by A8;
defpred S2[ Nat] means ( not P1[f . $1] or not f . $1 in F5() or not P2[f . $1] );
In ((f . i0),F3()) = f . i0 by FUNCT_7:def_1;
then f . (i0 + 1) = F6() . ((f . i0),F2()) by A6;
then ( not S2[i0] implies F7((f . (i0 + 1))) < j ) by A3, A9;
then A10: ex i being Nat st S2[i] by A8;
consider j being Nat such that
A11: ( S2[j] & ( for i being Nat st S2[i] holds
j <= i ) ) from NAT_1:sch_5(A10);
deffunc H2( Nat) -> Element of F3() = f . ($1 -' 1);
consider p being FinSequence of F3() such that
A12: ( len p = j + 1 & ( for i being Nat st i in dom p holds
p . i = H2(i) ) ) from FINSEQ_2:sch_1();
A13: dom p = Seg (j + 1) by A12, FINSEQ_1:def_3;
reconsider p = p as non empty FinSequence of F3() by A12;
take p ; :: according to AOFA_000:def_33 ::_thesis: ( p . 1 = F4() & p . (len p) nin F5() & ( for i being Nat st 1 <= i & i < len p holds
( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) ) )
A14: 1 <= j + 1 by NAT_1:11;
then 1 in Seg (j + 1) ;
hence p . 1 = H2(1) by A12, A13
.= F4() by A5, XREAL_1:232 ;
::_thesis: ( p . (len p) nin F5() & ( for i being Nat st 1 <= i & i < len p holds
( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) ) )
len p in Seg (j + 1) by A12, A14;
then A15: p . (len p) = H2(j + 1) by A12, A13
.= f . j by NAT_D:34 ;
j > 0 by A1, A2, A4, A5, A11;
then j >= 0 + 1 by NAT_1:13;
then consider j9 being Nat such that
A16: j = 1 + j9 by NAT_1:10;
reconsider j9 = j9 as Element of NAT by ORDINAL1:def_12;
A17: f . j = F6() . ((In ((f . j9),F3())),F2()) by A6, A16;
A18: j9 < j by A16, NAT_1:13;
then A19: P2[f . j9] by A11;
A20: f . j9 in F5() by A11, A18;
A21: P1[f . j9] by A11, A18;
In ((f . j9),F3()) = f . j9 by FUNCT_7:def_1;
hence p . (len p) nin F5() by A3, A11, A15, A17, A19, A20, A21; ::_thesis: for i being Nat st 1 <= i & i < len p holds
( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) )
let i be Nat; ::_thesis: ( 1 <= i & i < len p implies ( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) )
assume that
A22: 1 <= i and
A23: i < len p ; ::_thesis: ( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) )
A24: i + 1 >= 1 by A22, NAT_1:13;
A25: i + 1 <= len p by A23, NAT_1:13;
A26: i in Seg (j + 1) by A12, A22, A23, FINSEQ_1:1;
A27: i + 1 in Seg (j + 1) by A12, A24, A25;
A28: p . i = H2(i) by A12, A13, A26;
A29: p . (i + 1) = H2(i + 1) by A12, A13, A27;
consider i9 being Nat such that
A30: i = 1 + i9 by A22, NAT_1:10;
reconsider i9 = i9 as Element of NAT by ORDINAL1:def_12;
i <= j by A12, A23, NAT_1:13;
then A31: i9 < j by A30, NAT_1:13;
A32: i -' 1 = i9 by A30, NAT_D:34;
A33: (i + 1) -' 1 = i by NAT_D:34;
In ((f . i9),F3()) = f . i9 by FUNCT_7:def_1;
hence ( p . i in F5() & p . (i + 1) = F6() . ((p . i),F2()) ) by A6, A11, A28, A29, A30, A31, A32, A33; ::_thesis: verum
end;
end;
end;
theorem Th86: :: AOFA_000:86
for A being preIfWhileAlgebra
for C, I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for r being non empty FinSequence of S st r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) holds
f . (s,(while (C,I))) = r . (len r)
proof
let A be preIfWhileAlgebra; ::_thesis: for C, I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for r being non empty FinSequence of S st r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) holds
f . (s,(while (C,I))) = r . (len r)
let C, I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for r being non empty FinSequence of S st r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) holds
f . (s,(while (C,I))) = r . (len r)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for r being non empty FinSequence of S st r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) holds
f . (s,(while (C,I))) = r . (len r)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T
for r being non empty FinSequence of S st r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) holds
f . (s,(while (C,I))) = r . (len r)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T
for r being non empty FinSequence of S st r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) holds
f . (s,(while (C,I))) = r . (len r)
let f be ExecutionFunction of A,S,T; ::_thesis: for r being non empty FinSequence of S st r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) holds
f . (s,(while (C,I))) = r . (len r)
A1: f complies_with_while_wrt T by Def32;
let r be non empty FinSequence of S; ::_thesis: ( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) implies f . (s,(while (C,I))) = r . (len r) )
assume A2: r . 1 = f . (s,C) ; ::_thesis: ( not r . (len r) nin T or ex i being Nat st
( 1 <= i & i < len r & not ( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) or f . (s,(while (C,I))) = r . (len r) )
assume A3: r . (len r) nin T ; ::_thesis: ( ex i being Nat st
( 1 <= i & i < len r & not ( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ) or f . (s,(while (C,I))) = r . (len r) )
assume A4: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ; ::_thesis: f . (s,(while (C,I))) = r . (len r)
defpred S1[ Nat] means ( (len r) - $1 in dom r implies for q being Element of S st f . (q,C) = r . ((len r) - $1) holds
f . (q,(while (C,I))) = r . (len r) );
A5: S1[ 0 ] by A1, A3, Def31;
A6: for i being Nat st S1[i] holds
S1[i + 1]
proof
let i be Nat; ::_thesis: ( S1[i] implies S1[i + 1] )
assume that
A7: S1[i] and
A8: (len r) - (i + 1) in dom r ; ::_thesis: for q being Element of S st f . (q,C) = r . ((len r) - (i + 1)) holds
f . (q,(while (C,I))) = r . (len r)
reconsider j = (len r) - (i + 1) as Element of NAT by A8;
A9: (j + 1) + i = len r ;
A10: 1 <= j + 1 by NAT_1:11;
A11: j + 1 <= len r by A9, NAT_1:11;
A12: 1 <= j by A8, FINSEQ_3:25;
A13: j < len r by A11, NAT_1:13;
then A14: r . (j + 1) = f . ((r . j),(I \; C)) by A4, A12;
let q be Element of S; ::_thesis: ( f . (q,C) = r . ((len r) - (i + 1)) implies f . (q,(while (C,I))) = r . (len r) )
assume A15: f . (q,C) = r . ((len r) - (i + 1)) ; ::_thesis: f . (q,(while (C,I))) = r . (len r)
then A16: f . (q,C) in T by A4, A12, A13;
r . (j + 1) = f . ((f . ((f . (q,C)),I)),C) by A14, A15, Def29;
then f . ((f . ((f . (q,C)),I)),(while (C,I))) = r . (len r) by A7, A10, A11, FINSEQ_3:25;
hence f . (q,(while (C,I))) = r . (len r) by A1, A16, Def31; ::_thesis: verum
end;
A17: for i being Nat holds S1[i] from NAT_1:sch_2(A5, A6);
A18: len r >= 0 + 1 by NAT_1:13;
then consider i being Nat such that
A19: len r = 1 + i by NAT_1:10;
S1[i] by A17;
hence f . (s,(while (C,I))) = r . (len r) by A2, A18, A19, FINSEQ_3:25; ::_thesis: verum
end;
theorem Th87: :: AOFA_000:87
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A
for s being Element of S holds
( not f iteration_terminates_for I,s iff ((curry' f) . I) orbit s c= T )
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A
for s being Element of S holds
( not f iteration_terminates_for I,s iff ((curry' f) . I) orbit s c= T )
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A
for s being Element of S holds
( not f iteration_terminates_for I,s iff ((curry' f) . I) orbit s c= T )
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for I being Element of A
for s being Element of S holds
( not f iteration_terminates_for I,s iff ((curry' f) . I) orbit s c= T )
let f be ExecutionFunction of A,S,T; ::_thesis: for I being Element of A
for s being Element of S holds
( not f iteration_terminates_for I,s iff ((curry' f) . I) orbit s c= T )
let I be Element of A; ::_thesis: for s being Element of S holds
( not f iteration_terminates_for I,s iff ((curry' f) . I) orbit s c= T )
let s be Element of S; ::_thesis: ( not f iteration_terminates_for I,s iff ((curry' f) . I) orbit s c= T )
set g = (curry' f) . I;
hereby ::_thesis: ( ((curry' f) . I) orbit s c= T implies not f iteration_terminates_for I,s )
assume A1: not f iteration_terminates_for I,s ; ::_thesis: ((curry' f) . I) orbit s c= T
thus ((curry' f) . I) orbit s c= T ::_thesis: verum
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin ((curry' f) . I) orbit s or not x nin T )
assume x in ((curry' f) . I) orbit s ; ::_thesis: not x nin T
then A2: ex n being Element of NAT st
( x = (iter (((curry' f) . I),n)) . s & s in dom (iter (((curry' f) . I),n)) ) ;
defpred S1[ Nat] means (iter (((curry' f) . I),$1)) . s nin T;
assume x nin T ; ::_thesis: contradiction
then A3: ex n being Nat st S1[n] by A2;
consider n being Nat such that
A4: ( S1[n] & ( for m being Nat st S1[m] holds
n <= m ) ) from NAT_1:sch_5(A3);
deffunc H1( Nat) -> Element of S = (iter (((curry' f) . I),($1 -' 1))) . s;
consider r being FinSequence such that
A5: ( len r = n + 1 & ( for k being Nat st k in dom r holds
r . k = H1(k) ) ) from FINSEQ_1:sch_2();
rng r c= S
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin rng r or not a nin S )
assume a in rng r ; ::_thesis: not a nin S
then consider b being set such that
A6: b in dom r and
A7: a = r . b by FUNCT_1:def_3;
reconsider b = b as Element of NAT by A6;
r . b = (iter (((curry' f) . I),(b -' 1))) . s by A5, A6;
hence not a nin S by A7; ::_thesis: verum
end;
then reconsider r = r as non empty FinSequence of S by A5, FINSEQ_1:def_4;
A8: 1 <= n + 1 by NAT_1:11;
then A9: 1 in dom r by A5, FINSEQ_3:25;
A10: n + 1 in dom r by A5, A8, FINSEQ_3:25;
A11: 1 -' 1 = 0 by XREAL_1:232;
A12: (n + 1) -' 1 = n by NAT_D:34;
A13: iter (((curry' f) . I),0) = id S by FUNCT_7:84;
r . 1 = H1(1) by A5, A9;
then A14: r . 1 = s by A11, A13, FUNCT_1:17;
A15: r . (len r) nin T by A4, A5, A10, A12;
now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_r_._(i_+_1)_=_f_._((r_._i),I)_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & r . (i + 1) = f . ((r . i),I) ) )
assume that
A16: 1 <= i and
A17: i < len r ; ::_thesis: ( r . i in T & r . (i + 1) = f . ((r . i),I) )
consider j being Nat such that
A18: i = 1 + j by A16, NAT_1:10;
reconsider j = j as Element of NAT by ORDINAL1:def_12;
A19: i -' 1 = j by A18, NAT_D:34;
A20: (i + 1) -' 1 = i by NAT_D:34;
A21: dom (curry' f) = the carrier of A by FUNCT_2:def_1;
dom ((curry' f) . I) = S by FUNCT_2:def_1;
then A22: ((curry' f) . I) . ((iter (((curry' f) . I),j)) . s) = f . (((iter (((curry' f) . I),j)) . s),I) by A21, FUNCT_5:34;
A23: iter (((curry' f) . I),i) = ((curry' f) . I) * (iter (((curry' f) . I),j)) by A18, FUNCT_7:71;
A24: 1 <= i + 1 by A16, NAT_1:13;
A25: i + 1 <= n + 1 by A5, A17, NAT_1:13;
A26: i -' 1 < n by A5, A17, A18, A19, XREAL_1:6;
A27: i in dom r by A16, A17, FINSEQ_3:25;
A28: i + 1 in dom r by A5, A24, A25, FINSEQ_3:25;
A29: r . i = (iter (((curry' f) . I),(i -' 1))) . s by A5, A27;
r . (i + 1) = (iter (((curry' f) . I),i)) . s by A5, A20, A28;
hence ( r . i in T & r . (i + 1) = f . ((r . i),I) ) by A4, A19, A22, A23, A26, A29, FUNCT_2:15; ::_thesis: verum
end;
hence contradiction by A1, A14, A15, Def33; ::_thesis: verum
end;
end;
assume A30: ((curry' f) . I) orbit s c= T ; ::_thesis: not f iteration_terminates_for I,s
given r being non empty FinSequence of S such that A31: r . 1 = s and
A32: r . (len r) nin T and
A33: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),I) ) ; :: according to AOFA_000:def_33 ::_thesis: contradiction
defpred S1[ Nat] means ( $1 + 1 <= len r implies r . ($1 + 1) in ((curry' f) . I) orbit s );
dom ((curry' f) . I) = S by FUNCT_2:def_1;
then A34: S1[ 0 ] by A31, Th6;
A35: for i being Nat st S1[i] holds
S1[i + 1]
proof
let i be Nat; ::_thesis: ( S1[i] implies S1[i + 1] )
assume that
A36: S1[i] and
A37: (i + 1) + 1 <= len r ; ::_thesis: r . ((i + 1) + 1) in ((curry' f) . I) orbit s
A38: 1 <= i + 1 by NAT_1:11;
A39: i + 1 < len r by A37, NAT_1:13;
then i + 1 in dom r by A38, FINSEQ_3:25;
then A40: r . (i + 1) in rng r by FUNCT_1:3;
dom f = [:S, the carrier of A:] by FUNCT_2:def_1;
then A41: [(r . (i + 1)),I] in dom f by A40, ZFMISC_1:87;
consider n being Element of NAT such that
A42: r . (i + 1) = (iter (((curry' f) . I),n)) . s and
s in dom (iter (((curry' f) . I),n)) by A36, A37, NAT_1:13;
A43: r . ((i + 1) + 1) = f . ((r . (i + 1)),I) by A33, A38, A39
.= ((curry' f) . I) . (r . (i + 1)) by A41, FUNCT_5:22
.= (((curry' f) . I) * (iter (((curry' f) . I),n))) . s by A42, FUNCT_2:15
.= (iter (((curry' f) . I),(n + 1))) . s by FUNCT_7:71 ;
dom (iter (((curry' f) . I),(n + 1))) = S by FUNCT_2:def_1;
hence r . ((i + 1) + 1) in ((curry' f) . I) orbit s by A43; ::_thesis: verum
end;
consider i being Nat such that
A44: len r = i + 1 by NAT_1:6;
for n being Nat holds S1[n] from NAT_1:sch_2(A34, A35);
then r . (i + 1) in ((curry' f) . I) orbit s by A44;
hence contradiction by A30, A32, A44; ::_thesis: verum
end;
scheme :: AOFA_000:sch 5
InvariantSch{ F1() -> preIfWhileAlgebra, F2() -> Element of F1(), F3() -> Element of F1(), F4() -> non empty set , F5() -> Element of F4(), F6() -> Subset of F4(), F7() -> ExecutionFunction of F1(),F4(),F6(), P1[ set ], P2[ set ] } :
( P1[F7() . (F5(),(while (F2(),F3())))] & P2[F7() . (F5(),(while (F2(),F3())))] )
provided
A1: P1[F5()] and
A2: F7() iteration_terminates_for F3() \; F2(),F7() . (F5(),F2()) and
A3: for s being Element of F4() st P1[s] & s in F6() & P2[s] holds
P1[F7() . (s,F3())] and
A4: for s being Element of F4() st P1[s] holds
( P1[F7() . (s,F2())] & ( F7() . (s,F2()) in F6() implies P2[F7() . (s,F2())] ) & ( P2[F7() . (s,F2())] implies F7() . (s,F2()) in F6() ) )
proof
consider r being non empty FinSequence of F4() such that
A5: r . 1 = F7() . (F5(),F2()) and
A6: r . (len r) nin F6() and
A7: for i being Nat st 1 <= i & i < len r holds
( r . i in F6() & r . (i + 1) = F7() . ((r . i),(F3() \; F2())) ) by A2, Def33;
A8: F7() . (F5(),(while (F2(),F3()))) = r . (len r) by A5, A6, A7, Th86;
defpred S1[ Nat] means ( $1 + 1 in dom r implies ( P1[r . ($1 + 1)] & ( $1 + 1 < len r implies P2[r . ($1 + 1)] ) & ex q being Element of F4() st
( P1[q] & r . ($1 + 1) = F7() . (q,F2()) ) ) );
( 0 + 1 < len r implies r . (0 + 1) in F6() ) by A7;
then A9: S1[ 0 ] by A1, A4, A5;
A10: for n being Nat st S1[n] holds
S1[n + 1]
proof
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A11: S1[n] ; ::_thesis: S1[n + 1]
assume A12: (n + 1) + 1 in dom r ; ::_thesis: ( P1[r . ((n + 1) + 1)] & ( (n + 1) + 1 < len r implies P2[r . ((n + 1) + 1)] ) & ex q being Element of F4() st
( P1[q] & r . ((n + 1) + 1) = F7() . (q,F2()) ) )
then A13: (n + 1) + 1 <= len r by FINSEQ_3:25;
A14: (n + 1) + 1 >= 1 by NAT_1:11;
A15: n + 1 >= 1 by NAT_1:11;
A16: n + 1 < len r by A13, NAT_1:13;
then A17: n + 1 in dom r by A15, FINSEQ_3:25;
A18: r . (n + 1) in F6() by A7, A15, A16;
A19: r . ((n + 1) + 1) = F7() . ((r . (n + 1)),(F3() \; F2())) by A7, A15, A16;
reconsider q1 = r . (n + 1), q2 = r . ((n + 1) + 1) as Element of F4() by A12, A17, DTCONSTR:2;
reconsider q3 = F7() . (q1,F3()) as Element of F4() ;
A20: q2 = F7() . (q3,F2()) by A19, Def29;
A21: P1[q3] by A3, A11, A15, A16, A18, FINSEQ_3:25;
hence P1[r . ((n + 1) + 1)] by A4, A20; ::_thesis: ( ( (n + 1) + 1 < len r implies P2[r . ((n + 1) + 1)] ) & ex q being Element of F4() st
( P1[q] & r . ((n + 1) + 1) = F7() . (q,F2()) ) )
hereby ::_thesis: ex q being Element of F4() st
( P1[q] & r . ((n + 1) + 1) = F7() . (q,F2()) )
assume (n + 1) + 1 < len r ; ::_thesis: P2[r . ((n + 1) + 1)]
then r . ((n + 1) + 1) in F6() by A7, A14;
hence P2[r . ((n + 1) + 1)] by A4, A20, A21; ::_thesis: verum
end;
take q3 ; ::_thesis: ( P1[q3] & r . ((n + 1) + 1) = F7() . (q3,F2()) )
thus ( P1[q3] & r . ((n + 1) + 1) = F7() . (q3,F2()) ) by A3, A11, A15, A16, A18, A19, Def29, FINSEQ_3:25; ::_thesis: verum
end;
A22: for n being Nat holds S1[n] from NAT_1:sch_2(A9, A10);
A23: len r >= 0 + 1 by NAT_1:13;
then consider j being Nat such that
A24: len r = 1 + j by NAT_1:10;
A25: j + 1 in dom r by A23, A24, FINSEQ_3:25;
hence P1[F7() . (F5(),(while (F2(),F3())))] by A8, A22, A24; ::_thesis: P2[F7() . (F5(),(while (F2(),F3())))]
ex q being Element of F4() st
( P1[q] & r . (j + 1) = F7() . (q,F2()) ) by A22, A25;
hence P2[F7() . (F5(),(while (F2(),F3())))] by A4, A6, A8, A24; ::_thesis: verum
end;
scheme :: AOFA_000:sch 6
coInvariantSch{ F1() -> preIfWhileAlgebra, F2() -> Element of F1(), F3() -> Element of F1(), F4() -> non empty set , F5() -> Element of F4(), F6() -> Subset of F4(), F7() -> ExecutionFunction of F1(),F4(),F6(), P1[ set ] } :
P1[F5()]
provided
A1: P1[F7() . (F5(),(while (F2(),F3())))] and
A2: F7() iteration_terminates_for F3() \; F2(),F7() . (F5(),F2()) and
A3: for s being Element of F4() st P1[F7() . ((F7() . (s,F2())),F3())] & F7() . (s,F2()) in F6() holds
P1[F7() . (s,F2())] and
A4: for s being Element of F4() st P1[F7() . (s,F2())] holds
P1[s]
proof
consider r being non empty FinSequence of F4() such that
A5: r . 1 = F7() . (F5(),F2()) and
A6: r . (len r) nin F6() and
A7: for i being Nat st 1 <= i & i < len r holds
( r . i in F6() & r . (i + 1) = F7() . ((r . i),(F3() \; F2())) ) by A2, Def33;
defpred S1[ Nat] means ( (len r) - $1 in dom r implies P1[r . ((len r) - $1)] );
defpred S2[ Nat] means ( $1 + 1 in dom r implies ex q being Element of F4() st r . ($1 + 1) = F7() . (q,F2()) );
A8: S2[ 0 ] by A5;
A9: for n being Nat st S2[n] holds
S2[n + 1]
proof
let n be Nat; ::_thesis: ( S2[n] implies S2[n + 1] )
assume S2[n] ; ::_thesis: S2[n + 1]
assume (n + 1) + 1 in dom r ; ::_thesis: ex q being Element of F4() st r . ((n + 1) + 1) = F7() . (q,F2())
then A10: (n + 1) + 1 <= len r by FINSEQ_3:25;
A11: n + 1 >= 1 by NAT_1:11;
A12: n + 1 < len r by A10, NAT_1:13;
then A13: r . (n + 1) in F6() by A7, A11;
A14: r . ((n + 1) + 1) = F7() . ((r . (n + 1)),(F3() \; F2())) by A7, A11, A12;
reconsider q1 = r . (n + 1) as Element of F4() by A13;
reconsider q3 = F7() . (q1,F3()) as Element of F4() ;
take q3 ; ::_thesis: r . ((n + 1) + 1) = F7() . (q3,F2())
thus r . ((n + 1) + 1) = F7() . (q3,F2()) by A14, Def29; ::_thesis: verum
end;
A15: S1[ 0 ] by A1, A5, A6, A7, Th86;
A16: for n being Nat st S1[n] holds
S1[n + 1]
proof
let n be Nat; ::_thesis: ( S1[n] implies S1[n + 1] )
assume A17: S1[n] ; ::_thesis: S1[n + 1]
assume A18: (len r) - (n + 1) in dom r ; ::_thesis: P1[r . ((len r) - (n + 1))]
then reconsider j = (len r) - (n + 1) as Element of NAT ;
A19: j >= 1 by A18, FINSEQ_3:25;
n + 1 >= 0 + 1 by NAT_1:13;
then j <= (len r) - 1 by XREAL_1:10;
then A20: j + 1 <= ((len r) - 1) + 1 by XREAL_1:6;
A21: 1 <= 1 + j by NAT_1:11;
A22: j < len r by A20, NAT_1:13;
A23: j + 1 in dom r by A20, A21, FINSEQ_3:25;
A24: r . j in F6() by A7, A19, A22;
A25: r . (j + 1) = F7() . ((r . j),(F3() \; F2())) by A7, A19, A22;
reconsider q1 = r . j, q2 = r . (j + 1) as Element of F4() by A23, A24, DTCONSTR:2;
reconsider q9 = F7() . (q1,F3()) as Element of F4() ;
consider j9 being Nat such that
A26: j = 1 + j9 by A19, NAT_1:10;
for n being Nat holds S2[n] from NAT_1:sch_2(A8, A9);
then consider qq being Element of F4() such that
A27: r . (j9 + 1) = F7() . (qq,F2()) by A18, A26;
q2 = F7() . (q9,F2()) by A25, Def29;
then P1[F7() . ((F7() . (qq,F2())),F3())] by A4, A17, A20, A21, A26, A27, FINSEQ_3:25;
hence P1[r . ((len r) - (n + 1))] by A3, A7, A19, A22, A26, A27; ::_thesis: verum
end;
A28: for n being Nat holds S1[n] from NAT_1:sch_2(A15, A16);
A29: len r >= 0 + 1 by NAT_1:13;
then consider j being Nat such that
A30: len r = 1 + j by NAT_1:10;
(len r) - j in dom r by A29, A30, FINSEQ_3:25;
hence P1[F5()] by A4, A5, A28, A30; ::_thesis: verum
end;
theorem Th88: :: AOFA_000:88
for A being free preIfWhileAlgebra
for I1, I2 being Element of A
for n being Nat st I1 \; I2 in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
proof
let A be free preIfWhileAlgebra; ::_thesis: for I1, I2 being Element of A
for n being Nat st I1 \; I2 in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
set B = ElementaryInstructions A;
A1: ElementaryInstructions A is GeneratorSet of A by Def25;
let I1, I2 be Element of A; ::_thesis: for n being Nat st I1 \; I2 in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
A2: I1 \; I2 <> I1 by Th73;
I1 \; I2 <> I2 by Th73;
then I1 \; I2 nin ElementaryInstructions A by A2, Th50;
then A3: I1 \; I2 nin (ElementaryInstructions A) |^ 0 by Th18;
let n be Nat; ::_thesis: ( I1 \; I2 in (ElementaryInstructions A) |^ n implies ex i being Nat st
( n = i + 1 & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i ) )
assume A4: I1 \; I2 in (ElementaryInstructions A) |^ n ; ::_thesis: ex i being Nat st
( n = i + 1 & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
then n > 0 by A3;
then n >= 0 + 1 by NAT_1:13;
then consider i being Nat such that
A5: n = 1 + i by NAT_1:10;
take i ; ::_thesis: ( n = i + 1 & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
thus n = i + 1 by A5; ::_thesis: ( I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
A6: dom (Den ((In (2,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th44;
A7: for o being OperSymbol of A
for p being FinSequence st p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A holds
o <> In (2,(dom the charact of A))
proof
let o be OperSymbol of A; ::_thesis: for p being FinSequence st p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A holds
o <> In (2,(dom the charact of A))
let p be FinSequence; ::_thesis: ( p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A implies o <> In (2,(dom the charact of A)) )
assume that
A8: p in dom (Den (o,A)) and
A9: (Den (o,A)) . p in ElementaryInstructions A and
A10: o = In (2,(dom the charact of A)) ; ::_thesis: contradiction
consider a, b being set such that
A11: a in the carrier of A and
A12: b in the carrier of A and
A13: p = <*a,b*> by A6, A8, A10, FINSEQ_2:137;
reconsider a = a, b = b as Element of A by A11, A12;
A14: a \; b <> a by Th73;
a \; b <> b by Th73;
hence contradiction by A9, A10, A13, A14, Th50; ::_thesis: verum
end;
<*I1,I2*> in dom (Den ((In (2,(dom the charact of A))),A)) by A6, FINSEQ_2:137;
then rng <*I1,I2*> c= (ElementaryInstructions A) |^ i by A1, A4, A5, A7, Th39;
then {I1,I2} c= (ElementaryInstructions A) |^ i by FINSEQ_2:127;
hence ( I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i ) by ZFMISC_1:32; ::_thesis: verum
end;
theorem Th89: :: AOFA_000:89
for A being free preIfWhileAlgebra
for C, I1, I2 being Element of A
for n being Nat st if-then-else (C,I1,I2) in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
proof
let A be free preIfWhileAlgebra; ::_thesis: for C, I1, I2 being Element of A
for n being Nat st if-then-else (C,I1,I2) in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
set B = ElementaryInstructions A;
A1: ElementaryInstructions A is GeneratorSet of A by Def25;
let C, I1, I2 be Element of A; ::_thesis: for n being Nat st if-then-else (C,I1,I2) in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
if-then-else (C,I1,I2) nin ElementaryInstructions A by Th51;
then A2: if-then-else (C,I1,I2) nin (ElementaryInstructions A) |^ 0 by Th18;
let n be Nat; ::_thesis: ( if-then-else (C,I1,I2) in (ElementaryInstructions A) |^ n implies ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i ) )
assume A3: if-then-else (C,I1,I2) in (ElementaryInstructions A) |^ n ; ::_thesis: ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
then consider i being Nat such that
A4: n = i + 1 by A2, NAT_1:6;
take i ; ::_thesis: ( n = i + 1 & C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
thus n = i + 1 by A4; ::_thesis: ( C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i )
A5: dom (Den ((In (3,(dom the charact of A))),A)) = 3 -tuples_on the carrier of A by Th47;
A6: for o being OperSymbol of A
for p being FinSequence st p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A holds
o <> In (3,(dom the charact of A))
proof
let o be OperSymbol of A; ::_thesis: for p being FinSequence st p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A holds
o <> In (3,(dom the charact of A))
let p be FinSequence; ::_thesis: ( p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A implies o <> In (3,(dom the charact of A)) )
assume that
A7: p in dom (Den (o,A)) and
A8: (Den (o,A)) . p in ElementaryInstructions A and
A9: o = In (3,(dom the charact of A)) ; ::_thesis: contradiction
consider a, b, c being set such that
A10: a in the carrier of A and
A11: b in the carrier of A and
A12: c in the carrier of A and
A13: p = <*a,b,c*> by A5, A7, A9, FINSEQ_2:139;
reconsider a = a, b = b, c = c as Element of A by A10, A11, A12;
(Den (o,A)) . p = if-then-else (a,b,c) by A9, A13;
hence contradiction by A8, Th51; ::_thesis: verum
end;
<*C,I1,I2*> in dom (Den ((In (3,(dom the charact of A))),A)) by A5, FINSEQ_2:139;
then rng <*C,I1,I2*> c= (ElementaryInstructions A) |^ i by A1, A3, A4, A6, Th39;
then A14: {C,I1,I2} c= (ElementaryInstructions A) |^ i by FINSEQ_2:128;
A15: C in {C,I1,I2} by ENUMSET1:def_1;
A16: I1 in {C,I1,I2} by ENUMSET1:def_1;
I2 in {C,I1,I2} by ENUMSET1:def_1;
hence ( C in (ElementaryInstructions A) |^ i & I1 in (ElementaryInstructions A) |^ i & I2 in (ElementaryInstructions A) |^ i ) by A14, A15, A16; ::_thesis: verum
end;
theorem Th90: :: AOFA_000:90
for A being free preIfWhileAlgebra
for C, I being Element of A
for n being Nat st while (C,I) in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i )
proof
let A be free preIfWhileAlgebra; ::_thesis: for C, I being Element of A
for n being Nat st while (C,I) in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i )
set B = ElementaryInstructions A;
A1: ElementaryInstructions A is GeneratorSet of A by Def25;
let C, I be Element of A; ::_thesis: for n being Nat st while (C,I) in (ElementaryInstructions A) |^ n holds
ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i )
while (C,I) nin ElementaryInstructions A by Th52;
then A2: while (C,I) nin (ElementaryInstructions A) |^ 0 by Th18;
let n be Nat; ::_thesis: ( while (C,I) in (ElementaryInstructions A) |^ n implies ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i ) )
assume A3: while (C,I) in (ElementaryInstructions A) |^ n ; ::_thesis: ex i being Nat st
( n = i + 1 & C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i )
then consider i being Nat such that
A4: n = i + 1 by A2, NAT_1:6;
take i ; ::_thesis: ( n = i + 1 & C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i )
thus n = i + 1 by A4; ::_thesis: ( C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i )
A5: dom (Den ((In (4,(dom the charact of A))),A)) = 2 -tuples_on the carrier of A by Th48;
A6: for o being OperSymbol of A
for p being FinSequence st p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A holds
o <> In (4,(dom the charact of A))
proof
let o be OperSymbol of A; ::_thesis: for p being FinSequence st p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A holds
o <> In (4,(dom the charact of A))
let p be FinSequence; ::_thesis: ( p in dom (Den (o,A)) & (Den (o,A)) . p in ElementaryInstructions A implies o <> In (4,(dom the charact of A)) )
assume that
A7: p in dom (Den (o,A)) and
A8: (Den (o,A)) . p in ElementaryInstructions A and
A9: o = In (4,(dom the charact of A)) ; ::_thesis: contradiction
consider a, b being set such that
A10: a in the carrier of A and
A11: b in the carrier of A and
A12: p = <*a,b*> by A5, A7, A9, FINSEQ_2:137;
reconsider a = a, b = b as Element of A by A10, A11;
(Den (o,A)) . p = while (a,b) by A9, A12;
hence contradiction by A8, Th52; ::_thesis: verum
end;
<*C,I*> in dom (Den ((In (4,(dom the charact of A))),A)) by A5, FINSEQ_2:137;
then rng <*C,I*> c= (ElementaryInstructions A) |^ i by A1, A3, A4, A6, Th39;
then {C,I} c= (ElementaryInstructions A) |^ i by FINSEQ_2:127;
hence ( C in (ElementaryInstructions A) |^ i & I in (ElementaryInstructions A) |^ i ) by ZFMISC_1:32; ::_thesis: verum
end;
begin
scheme :: AOFA_000:sch 7
IndDef{ F1() -> free ECIW-strict preIfWhileAlgebra, F2() -> non empty set , F3() -> Element of F2(), F4( set ) -> set , F5( set , set ) -> Element of F2(), F6( set , set ) -> Element of F2(), F7( set , set , set ) -> Element of F2() } :
ex f being Function of the carrier of F1(),F2() st
( ( for I being Element of F1() st I in ElementaryInstructions F1() holds
f . I = F4(I) ) & f . (EmptyIns F1()) = F3() & ( for I1, I2 being Element of F1() holds f . (I1 \; I2) = F5((f . I1),(f . I2)) ) & ( for C, I1, I2 being Element of F1() holds f . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2)) ) & ( for C, I being Element of F1() holds f . (while (C,I)) = F6((f . C),(f . I)) ) )
provided
A1: for I being Element of F1() st I in ElementaryInstructions F1() holds
F4(I) in F2()
proof
set B = ElementaryInstructions F1();
A2: (ElementaryInstructions F1()) |^ 0 = ElementaryInstructions F1() by Th18;
set FB = { [I,F4(I)] where I is Element of F1() : I in ElementaryInstructions F1() } ;
deffunc H1( Nat, set ) -> set = { [(I1 \; I2),F5(fI1,fI2)] where I1, I2 is Element of F1(), fI1, fI2 is Element of F2() : ( I1 in (ElementaryInstructions F1()) |^ $1 & I2 in (ElementaryInstructions F1()) |^ $1 & [I1,fI1] in $2 & [I2,fI2] in $2 ) } ;
deffunc H2( Nat, set ) -> set = { [(if-then-else (C,I1,I2)),F7(fC,fI1,fI2)] where C, I1, I2 is Element of F1(), fC, fI1, fI2 is Element of F2() : ( C in (ElementaryInstructions F1()) |^ $1 & I1 in (ElementaryInstructions F1()) |^ $1 & I2 in (ElementaryInstructions F1()) |^ $1 & [C,fC] in $2 & [I1,fI1] in $2 & [I2,fI2] in $2 ) } ;
deffunc H3( Nat, set ) -> set = { [(while (C,I)),F6(gC,gI)] where C, I is Element of F1(), gC, gI is Element of F2() : ( C in (ElementaryInstructions F1()) |^ $1 & I in (ElementaryInstructions F1()) |^ $1 & [C,gC] in $2 & [I,gI] in $2 ) } ;
deffunc H4( Nat, set ) -> set = ((($2 \/ {[(EmptyIns F1()),F3()]}) \/ H1($1,$2)) \/ H2($1,$2)) \/ H3($1,$2);
consider FF being Function such that
A3: ( dom FF = NAT & FF . 0 = { [I,F4(I)] where I is Element of F1() : I in ElementaryInstructions F1() } ) and
A4: for n being Nat holds FF . (n + 1) = H4(n,FF . n) from NAT_1:sch_11();
set f = Union FF;
A5: for n, m being Nat st n <= m holds
FF . n c= FF . m
proof
let n, m be Nat; ::_thesis: ( n <= m implies FF . n c= FF . m )
assume n <= m ; ::_thesis: FF . n c= FF . m
then consider i being Nat such that
A6: m = n + i by NAT_1:10;
reconsider i = i as Element of NAT by ORDINAL1:def_12;
A7: m = n + i by A6;
defpred S1[ Nat] means FF . n c= FF . (n + $1);
A8: S1[ 0 ] ;
A9: now__::_thesis:_for_i_being_Element_of_NAT_st_S1[i]_holds_
S1[i_+_1]
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
reconsider n9 = n as Element of NAT by ORDINAL1:def_12;
FF . ((n9 + i) + 1) = H4(n9 + i,FF . (n9 + i)) by A4
.= (((FF . (n + i)) \/ {[(EmptyIns F1()),F3()]}) \/ H1(n + i,FF . (n + i))) \/ (H2(n + i,FF . (n + i)) \/ H3(n + i,FF . (n + i))) by XBOOLE_1:4
.= ((FF . (n + i)) \/ {[(EmptyIns F1()),F3()]}) \/ (H1(n + i,FF . (n + i)) \/ (H2(n + i,FF . (n + i)) \/ H3(n + i,FF . (n + i)))) by XBOOLE_1:4
.= (FF . (n + i)) \/ ({[(EmptyIns F1()),F3()]} \/ (H1(n + i,FF . (n + i)) \/ (H2(n + i,FF . (n + i)) \/ H3(n + i,FF . (n + i))))) by XBOOLE_1:4 ;
then FF . (n + i) c= FF . ((n + i) + 1) by XBOOLE_1:7;
hence ( S1[i] implies S1[i + 1] ) by XBOOLE_1:1; ::_thesis: verum
end;
for i being Element of NAT holds S1[i] from NAT_1:sch_1(A8, A9);
hence FF . n c= FF . m by A7; ::_thesis: verum
end;
defpred S1[ Nat] means ex g being Function of ((ElementaryInstructions F1()) |^ $1),F2() st
( g = FF . $1 & ( EmptyIns F1() in (ElementaryInstructions F1()) |^ $1 implies g . (EmptyIns F1()) = F3() ) & ( for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ $1 holds
g . (I1 \; I2) = F5((g . I1),(g . I2)) ) & ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ $1 holds
g . (if-then-else (C,I1,I2)) = F7((g . C),(g . I1),(g . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ $1 holds
g . (while (C,I)) = F6((g . C),(g . I)) ) );
defpred S2[ set ] means $1 in ElementaryInstructions F1();
reconsider f0 = { [I,F4(I)] where I is Element of F1() : S2[I] } as Function from ALTCAT_2:sch_1();
A10: dom f0 = ElementaryInstructions F1()
proof
thus dom f0 c= ElementaryInstructions F1() :: according to XBOOLE_0:def_10 ::_thesis: ElementaryInstructions F1() c= dom f0
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin dom f0 or not x nin ElementaryInstructions F1() )
assume x in dom f0 ; ::_thesis: not x nin ElementaryInstructions F1()
then [x,(f0 . x)] in f0 by FUNCT_1:def_2;
then ex I being Element of F1() st
( [x,(f0 . x)] = [I,F4(I)] & S2[I] ) ;
hence not x nin ElementaryInstructions F1() by XTUPLE_0:1; ::_thesis: verum
end;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin ElementaryInstructions F1() or not x nin dom f0 )
assume A11: x in ElementaryInstructions F1() ; ::_thesis: not x nin dom f0
then reconsider I = x as Element of F1() ;
[I,F4(I)] in f0 by A11;
hence not x nin dom f0 by XTUPLE_0:def_12; ::_thesis: verum
end;
rng f0 c= F2()
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( y nin rng f0 or not y nin F2() )
assume y in rng f0 ; ::_thesis: not y nin F2()
then consider x being set such that
A12: [x,y] in f0 by XTUPLE_0:def_13;
consider I being Element of F1() such that
A13: [x,y] = [I,F4(I)] and
A14: S2[I] by A12;
y = F4(I) by A13, XTUPLE_0:1;
hence not y nin F2() by A1, A14; ::_thesis: verum
end;
then reconsider f0 = f0 as Function of ((ElementaryInstructions F1()) |^ 0),F2() by A2, A10, FUNCT_2:2;
A15: S1[ 0 ]
proof
take f0 ; ::_thesis: ( f0 = FF . 0 & ( EmptyIns F1() in (ElementaryInstructions F1()) |^ 0 implies f0 . (EmptyIns F1()) = F3() ) & ( for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ 0 holds
f0 . (I1 \; I2) = F5((f0 . I1),(f0 . I2)) ) & ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ 0 holds
f0 . (if-then-else (C,I1,I2)) = F7((f0 . C),(f0 . I1),(f0 . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ 0 holds
f0 . (while (C,I)) = F6((f0 . C),(f0 . I)) ) )
thus f0 = FF . 0 by A3; ::_thesis: ( ( EmptyIns F1() in (ElementaryInstructions F1()) |^ 0 implies f0 . (EmptyIns F1()) = F3() ) & ( for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ 0 holds
f0 . (I1 \; I2) = F5((f0 . I1),(f0 . I2)) ) & ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ 0 holds
f0 . (if-then-else (C,I1,I2)) = F7((f0 . C),(f0 . I1),(f0 . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ 0 holds
f0 . (while (C,I)) = F6((f0 . C),(f0 . I)) ) )
now__::_thesis:_for_I1,_I2_being_Element_of_F1()_holds_I1_\;_I2_nin_ElementaryInstructions_F1()
let I1, I2 be Element of F1(); ::_thesis: I1 \; I2 nin ElementaryInstructions F1()
A16: I1 \; I2 <> I1 by Th73;
I1 \; I2 <> I2 by Th73;
hence I1 \; I2 nin ElementaryInstructions F1() by A16, Th50; ::_thesis: verum
end;
hence ( ( EmptyIns F1() in (ElementaryInstructions F1()) |^ 0 implies f0 . (EmptyIns F1()) = F3() ) & ( for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ 0 holds
f0 . (I1 \; I2) = F5((f0 . I1),(f0 . I2)) ) & ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ 0 holds
f0 . (if-then-else (C,I1,I2)) = F7((f0 . C),(f0 . I1),(f0 . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ 0 holds
f0 . (while (C,I)) = F6((f0 . C),(f0 . I)) ) ) by A2, Th49, Th51, Th52; ::_thesis: verum
end;
A17: for i being Element of NAT st S1[i] holds
S1[i + 1]
proof
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
given g being Function of ((ElementaryInstructions F1()) |^ i),F2() such that A18: g = FF . i and
A19: ( EmptyIns F1() in (ElementaryInstructions F1()) |^ i implies g . (EmptyIns F1()) = F3() ) and
A20: for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ i holds
g . (I1 \; I2) = F5((g . I1),(g . I2)) and
A21: for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ i holds
g . (if-then-else (C,I1,I2)) = F7((g . C),(g . I1),(g . I2)) and
A22: for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ i holds
g . (while (C,I)) = F6((g . C),(g . I)) ; ::_thesis: S1[i + 1]
set h = FF . (i + 1);
A23: i < i + 1 by NAT_1:13;
A24: FF . (i + 1) = H4(i,g) by A4, A18;
A25: dom g = (ElementaryInstructions F1()) |^ i by FUNCT_2:def_1;
A26: (ElementaryInstructions F1()) |^ i c= (ElementaryInstructions F1()) |^ (i + 1) by A23, Th21;
A27: now__::_thesis:_for_x_being_set_holds_
(_not_x_in_FF_._(i_+_1)_or_x_in_g_or_x_in_{[(EmptyIns_F1()),F3()]}_or_x_in_H1(i,g)_or_x_in_H2(i,g)_or_x_in_H3(i,g)_)
let x be set ; ::_thesis: ( not x in FF . (i + 1) or x in g or x in {[(EmptyIns F1()),F3()]} or x in H1(i,g) or x in H2(i,g) or x in H3(i,g) )
assume x in FF . (i + 1) ; ::_thesis: ( x in g or x in {[(EmptyIns F1()),F3()]} or x in H1(i,g) or x in H2(i,g) or x in H3(i,g) )
then ( x in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) or x in H3(i,g) ) by A24, XBOOLE_0:def_3;
then ( x in (g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g) or x in H2(i,g) or x in H3(i,g) ) by XBOOLE_0:def_3;
then ( x in g \/ {[(EmptyIns F1()),F3()]} or x in H1(i,g) or x in H2(i,g) or x in H3(i,g) ) by XBOOLE_0:def_3;
hence ( x in g or x in {[(EmptyIns F1()),F3()]} or x in H1(i,g) or x in H2(i,g) or x in H3(i,g) ) by XBOOLE_0:def_3; ::_thesis: verum
end;
FF . (i + 1) is Relation-like
proof
let x be set ; :: according to RELAT_1:def_1 ::_thesis: ( x nin FF . (i + 1) or ex b1, b2 being set st x = [b1,b2] )
assume x in FF . (i + 1) ; ::_thesis: ex b1, b2 being set st x = [b1,b2]
then ( x in g or x in {[(EmptyIns F1()),F3()]} or x in H1(i,g) or x in H2(i,g) or x in H3(i,g) ) by A27;
then ( ex a, b being set st x = [a,b] or x = [(EmptyIns F1()),F3()] or ex I1, I2 being Element of F1() ex fI1, fI2 being Element of F2() st
( x = [(I1 \; I2),F5(fI1,fI2)] & I1 in (ElementaryInstructions F1()) |^ i & I2 in (ElementaryInstructions F1()) |^ i & [I1,fI1] in g & [I2,fI2] in g ) or ex C, I1, I2 being Element of F1() ex a, b, c being Element of F2() st
( x = [(if-then-else (C,I1,I2)),F7(a,b,c)] & C in (ElementaryInstructions F1()) |^ i & I1 in (ElementaryInstructions F1()) |^ i & I2 in (ElementaryInstructions F1()) |^ i & [C,a] in g & [I1,b] in g & [I2,c] in g ) or ex C, I being Element of F1() ex a, b being Element of F2() st
( x = [(while (C,I)),F6(a,b)] & C in (ElementaryInstructions F1()) |^ i & I in (ElementaryInstructions F1()) |^ i & [C,a] in g & [I,b] in g ) ) by RELAT_1:def_1;
hence ex b1, b2 being set st x = [b1,b2] ; ::_thesis: verum
end;
then reconsider h = FF . (i + 1) as Relation ;
h is Function-like
proof
let x, y1, y2 be set ; :: according to FUNCT_1:def_1 ::_thesis: ( [x,y1] nin h or [x,y2] nin h or y1 = y2 )
set x1 = [x,y1];
set x2 = [x,y2];
assume A28: [x,y1] in h ; ::_thesis: ( [x,y2] nin h or y1 = y2 )
assume A29: [x,y2] in h ; ::_thesis: y1 = y2
percases ( [x,y1] in g or [x,y1] in {[(EmptyIns F1()),F3()]} or [x,y1] in H1(i,g) or [x,y1] in H2(i,g) or [x,y1] in H3(i,g) ) by A27, A28;
supposeA30: [x,y1] in g ; ::_thesis: y1 = y2
then A31: x in dom g by FUNCT_1:1;
A32: y1 = g . x by A30, FUNCT_1:1;
percases ( [x,y2] in g or [x,y2] in {[(EmptyIns F1()),F3()]} or [x,y2] in H1(i,g) or [x,y2] in H2(i,g) or [x,y2] in H3(i,g) ) by A27, A29;
suppose [x,y2] in g ; ::_thesis: y1 = y2
hence y1 = y2 by A30, FUNCT_1:def_1; ::_thesis: verum
end;
suppose [x,y2] in {[(EmptyIns F1()),F3()]} ; ::_thesis: y1 = y2
then A33: [x,y2] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
then x = EmptyIns F1() by XTUPLE_0:1;
hence y1 = y2 by A19, A31, A32, A33, XTUPLE_0:1; ::_thesis: verum
end;
suppose [x,y2] in H1(i,g) ; ::_thesis: y1 = y2
then consider J1, J2 being Element of F1(), gJ1, gJ2 being Element of F2() such that
A34: [x,y2] = [(J1 \; J2),F5(gJ1,gJ2)] and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
A35: [J1,gJ1] in g and
A36: [J2,gJ2] in g ;
A37: x = J1 \; J2 by A34, XTUPLE_0:1;
A38: y2 = F5(gJ1,gJ2) by A34, XTUPLE_0:1;
A39: g . J1 = gJ1 by A35, FUNCT_1:1;
g . J2 = gJ2 by A36, FUNCT_1:1;
hence y1 = y2 by A20, A31, A32, A37, A38, A39; ::_thesis: verum
end;
suppose [x,y2] in H2(i,g) ; ::_thesis: y1 = y2
then consider D, J1, J2 being Element of F1(), a, b, c being Element of F2() such that
A40: [x,y2] = [(if-then-else (D,J1,J2)),F7(a,b,c)] and
D in (ElementaryInstructions F1()) |^ i and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
A41: [D,a] in g and
A42: [J1,b] in g and
A43: [J2,c] in g ;
A44: x = if-then-else (D,J1,J2) by A40, XTUPLE_0:1;
A45: y2 = F7(a,b,c) by A40, XTUPLE_0:1;
A46: g . D = a by A41, FUNCT_1:1;
A47: g . J1 = b by A42, FUNCT_1:1;
g . J2 = c by A43, FUNCT_1:1;
hence y1 = y2 by A21, A31, A32, A44, A45, A46, A47; ::_thesis: verum
end;
suppose [x,y2] in H3(i,g) ; ::_thesis: y1 = y2
then consider D, J being Element of F1(), a, b being Element of F2() such that
A48: [x,y2] = [(while (D,J)),F6(a,b)] and
D in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
A49: [D,a] in g and
A50: [J,b] in g ;
A51: x = while (D,J) by A48, XTUPLE_0:1;
A52: y2 = F6(a,b) by A48, XTUPLE_0:1;
A53: g . D = a by A49, FUNCT_1:1;
g . J = b by A50, FUNCT_1:1;
hence y1 = y2 by A22, A31, A32, A51, A52, A53; ::_thesis: verum
end;
end;
end;
suppose [x,y1] in {[(EmptyIns F1()),F3()]} ; ::_thesis: y1 = y2
then A54: [x,y1] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
then A55: x = EmptyIns F1() by XTUPLE_0:1;
A56: y1 = F3() by A54, XTUPLE_0:1;
percases ( [x,y2] in g or [x,y2] in {[(EmptyIns F1()),F3()]} or [x,y2] in H1(i,g) or [x,y2] in H2(i,g) or [x,y2] in H3(i,g) ) by A27, A29;
supposeA57: [x,y2] in g ; ::_thesis: y1 = y2
then x in dom g by FUNCT_1:1;
hence y1 = y2 by A19, A55, A56, A57, FUNCT_1:1; ::_thesis: verum
end;
suppose [x,y2] in {[(EmptyIns F1()),F3()]} ; ::_thesis: y1 = y2
then [x,y2] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
hence y1 = y2 by A54, XTUPLE_0:1; ::_thesis: verum
end;
suppose [x,y2] in H1(i,g) ; ::_thesis: y1 = y2
then consider J1, J2 being Element of F1(), a, b being Element of F2() such that
A58: [x,y2] = [(J1 \; J2),F5(a,b)] and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
[J1,a] in g and
[J2,b] in g ;
x = J1 \; J2 by A58, XTUPLE_0:1;
hence y1 = y2 by A55, Th72; ::_thesis: verum
end;
suppose [x,y2] in H2(i,g) ; ::_thesis: y1 = y2
then consider D, J1, J2 being Element of F1(), a, b, c being Element of F2() such that
A59: [x,y2] = [(if-then-else (D,J1,J2)),F7(a,b,c)] and
D in (ElementaryInstructions F1()) |^ i and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
[D,a] in g and
[J1,b] in g and
[J2,c] in g ;
x = if-then-else (D,J1,J2) by A59, XTUPLE_0:1;
hence y1 = y2 by A55, Def24; ::_thesis: verum
end;
suppose [x,y2] in H3(i,g) ; ::_thesis: y1 = y2
then consider D, J being Element of F1(), a, b being Element of F2() such that
A60: [x,y2] = [(while (D,J)),F6(a,b)] and
D in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
[D,a] in g and
[J,b] in g ;
x = while (D,J) by A60, XTUPLE_0:1;
hence y1 = y2 by A55, Def24; ::_thesis: verum
end;
end;
end;
suppose [x,y1] in H1(i,g) ; ::_thesis: y1 = y2
then consider I1, I2 being Element of F1(), gI1, gI2 being Element of F2() such that
A61: [x,y1] = [(I1 \; I2),F5(gI1,gI2)] and
I1 in (ElementaryInstructions F1()) |^ i and
I2 in (ElementaryInstructions F1()) |^ i and
A62: [I1,gI1] in g and
A63: [I2,gI2] in g ;
A64: x = I1 \; I2 by A61, XTUPLE_0:1;
A65: y1 = F5(gI1,gI2) by A61, XTUPLE_0:1;
A66: g . I1 = gI1 by A62, FUNCT_1:1;
A67: g . I2 = gI2 by A63, FUNCT_1:1;
percases ( [x,y2] in g or [x,y2] in {[(EmptyIns F1()),F3()]} or [x,y2] in H1(i,g) or [x,y2] in H2(i,g) or [x,y2] in H3(i,g) ) by A27, A29;
supposeA68: [x,y2] in g ; ::_thesis: y1 = y2
then A69: x in dom g by FUNCT_1:1;
y2 = g . x by A68, FUNCT_1:1;
hence y1 = y2 by A20, A64, A65, A66, A67, A69; ::_thesis: verum
end;
suppose [x,y2] in {[(EmptyIns F1()),F3()]} ; ::_thesis: y1 = y2
then [x,y2] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
then x = EmptyIns F1() by XTUPLE_0:1;
hence y1 = y2 by A64, Th72; ::_thesis: verum
end;
suppose [x,y2] in H1(i,g) ; ::_thesis: y1 = y2
then consider J1, J2 being Element of F1(), a, b being Element of F2() such that
A70: [x,y2] = [(J1 \; J2),F5(a,b)] and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
A71: [J1,a] in g and
A72: [J2,b] in g ;
A73: x = J1 \; J2 by A70, XTUPLE_0:1;
A74: y2 = F5(a,b) by A70, XTUPLE_0:1;
A75: g . J1 = a by A71, FUNCT_1:1;
A76: g . J2 = b by A72, FUNCT_1:1;
I1 = J1 by A64, A73, Th73;
hence y1 = y2 by A64, A65, A66, A67, A73, A74, A75, A76, Th73; ::_thesis: verum
end;
suppose [x,y2] in H2(i,g) ; ::_thesis: y1 = y2
then consider D, J1, J2 being Element of F1(), a, b, c being Element of F2() such that
A77: [x,y2] = [(if-then-else (D,J1,J2)),F7(a,b,c)] and
D in (ElementaryInstructions F1()) |^ i and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
[D,a] in g and
[J1,b] in g and
[J2,c] in g ;
x = if-then-else (D,J1,J2) by A77, XTUPLE_0:1;
hence y1 = y2 by A64, Th73; ::_thesis: verum
end;
suppose [x,y2] in H3(i,g) ; ::_thesis: y1 = y2
then consider D, J being Element of F1(), a, b being Element of F2() such that
A78: [x,y2] = [(while (D,J)),F6(a,b)] and
D in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
[D,a] in g and
[J,b] in g ;
x = while (D,J) by A78, XTUPLE_0:1;
hence y1 = y2 by A64, Th73; ::_thesis: verum
end;
end;
end;
suppose [x,y1] in H2(i,g) ; ::_thesis: y1 = y2
then consider C, I1, I2 being Element of F1(), gC, gI1, gI2 being Element of F2() such that
A79: [x,y1] = [(if-then-else (C,I1,I2)),F7(gC,gI1,gI2)] and
C in (ElementaryInstructions F1()) |^ i and
I1 in (ElementaryInstructions F1()) |^ i and
I2 in (ElementaryInstructions F1()) |^ i and
A80: [C,gC] in g and
A81: [I1,gI1] in g and
A82: [I2,gI2] in g ;
A83: x = if-then-else (C,I1,I2) by A79, XTUPLE_0:1;
A84: y1 = F7(gC,gI1,gI2) by A79, XTUPLE_0:1;
A85: g . I1 = gI1 by A81, FUNCT_1:1;
A86: g . I2 = gI2 by A82, FUNCT_1:1;
A87: g . C = gC by A80, FUNCT_1:1;
percases ( [x,y2] in g or [x,y2] in {[(EmptyIns F1()),F3()]} or [x,y2] in H1(i,g) or [x,y2] in H2(i,g) or [x,y2] in H3(i,g) ) by A27, A29;
supposeA88: [x,y2] in g ; ::_thesis: y1 = y2
then A89: x in dom g by FUNCT_1:1;
y2 = g . x by A88, FUNCT_1:1;
hence y1 = y2 by A21, A83, A84, A85, A86, A87, A89; ::_thesis: verum
end;
suppose [x,y2] in {[(EmptyIns F1()),F3()]} ; ::_thesis: y1 = y2
then [x,y2] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
then x = EmptyIns F1() by XTUPLE_0:1;
hence y1 = y2 by A83, Th72; ::_thesis: verum
end;
suppose [x,y2] in H1(i,g) ; ::_thesis: y1 = y2
then consider J1, J2 being Element of F1(), a, b being Element of F2() such that
A90: [x,y2] = [(J1 \; J2),F5(a,b)] and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
[J1,a] in g and
[J2,b] in g ;
x = J1 \; J2 by A90, XTUPLE_0:1;
hence y1 = y2 by A83, Th73; ::_thesis: verum
end;
suppose [x,y2] in H2(i,g) ; ::_thesis: y1 = y2
then consider D, J1, J2 being Element of F1(), a, b, c being Element of F2() such that
A91: [x,y2] = [(if-then-else (D,J1,J2)),F7(a,b,c)] and
D in (ElementaryInstructions F1()) |^ i and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
A92: [D,a] in g and
A93: [J1,b] in g and
A94: [J2,c] in g ;
A95: x = if-then-else (D,J1,J2) by A91, XTUPLE_0:1;
A96: y2 = F7(a,b,c) by A91, XTUPLE_0:1;
A97: g . D = a by A92, FUNCT_1:1;
A98: g . J1 = b by A93, FUNCT_1:1;
A99: g . J2 = c by A94, FUNCT_1:1;
A100: C = D by A83, A95, Th74;
I1 = J1 by A83, A95, Th74;
hence y1 = y2 by A83, A84, A85, A86, A87, A95, A96, A97, A98, A99, A100, Th74; ::_thesis: verum
end;
suppose [x,y2] in H3(i,g) ; ::_thesis: y1 = y2
then consider D, J being Element of F1(), a, b being Element of F2() such that
A101: [x,y2] = [(while (D,J)),F6(a,b)] and
D in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
[D,a] in g and
[J,b] in g ;
x = while (D,J) by A101, XTUPLE_0:1;
hence y1 = y2 by A83, Th74; ::_thesis: verum
end;
end;
end;
suppose [x,y1] in H3(i,g) ; ::_thesis: y1 = y2
then consider C, I being Element of F1(), gC, gI being Element of F2() such that
A102: [x,y1] = [(while (C,I)),F6(gC,gI)] and
C in (ElementaryInstructions F1()) |^ i and
I in (ElementaryInstructions F1()) |^ i and
A103: [C,gC] in g and
A104: [I,gI] in g ;
A105: x = while (C,I) by A102, XTUPLE_0:1;
A106: y1 = F6(gC,gI) by A102, XTUPLE_0:1;
A107: g . C = gC by A103, FUNCT_1:1;
A108: g . I = gI by A104, FUNCT_1:1;
percases ( [x,y2] in g or [x,y2] in {[(EmptyIns F1()),F3()]} or [x,y2] in H1(i,g) or [x,y2] in H2(i,g) or [x,y2] in H3(i,g) ) by A27, A29;
supposeA109: [x,y2] in g ; ::_thesis: y1 = y2
then A110: x in dom g by FUNCT_1:1;
y2 = g . x by A109, FUNCT_1:1;
hence y1 = y2 by A22, A105, A106, A107, A108, A110; ::_thesis: verum
end;
suppose [x,y2] in {[(EmptyIns F1()),F3()]} ; ::_thesis: y1 = y2
then [x,y2] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
then x = EmptyIns F1() by XTUPLE_0:1;
hence y1 = y2 by A105, Th72; ::_thesis: verum
end;
suppose [x,y2] in H1(i,g) ; ::_thesis: y1 = y2
then consider J1, J2 being Element of F1(), a, b being Element of F2() such that
A111: [x,y2] = [(J1 \; J2),F5(a,b)] and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
[J1,a] in g and
[J2,b] in g ;
x = J1 \; J2 by A111, XTUPLE_0:1;
hence y1 = y2 by A105, Th73; ::_thesis: verum
end;
suppose [x,y2] in H2(i,g) ; ::_thesis: y1 = y2
then consider D, J1, J2 being Element of F1(), a, b, c being Element of F2() such that
A112: [x,y2] = [(if-then-else (D,J1,J2)),F7(a,b,c)] and
D in (ElementaryInstructions F1()) |^ i and
J1 in (ElementaryInstructions F1()) |^ i and
J2 in (ElementaryInstructions F1()) |^ i and
[D,a] in g and
[J1,b] in g and
[J2,c] in g ;
x = if-then-else (D,J1,J2) by A112, XTUPLE_0:1;
hence y1 = y2 by A105, Th74; ::_thesis: verum
end;
suppose [x,y2] in H3(i,g) ; ::_thesis: y1 = y2
then consider D, J being Element of F1(), a, b being Element of F2() such that
A113: [x,y2] = [(while (D,J)),F6(a,b)] and
D in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
A114: [D,a] in g and
A115: [J,b] in g ;
A116: x = while (D,J) by A113, XTUPLE_0:1;
A117: y2 = F6(a,b) by A113, XTUPLE_0:1;
A118: g . D = a by A114, FUNCT_1:1;
A119: g . J = b by A115, FUNCT_1:1;
D = C by A105, A116, Th75;
hence y1 = y2 by A105, A106, A107, A108, A116, A117, A118, A119, Th75; ::_thesis: verum
end;
end;
end;
end;
end;
then reconsider h = h as Function ;
A120: dom h = (ElementaryInstructions F1()) |^ (i + 1)
proof
thus dom h c= (ElementaryInstructions F1()) |^ (i + 1) :: according to XBOOLE_0:def_10 ::_thesis: (ElementaryInstructions F1()) |^ (i + 1) c= dom h
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin dom h or not a nin (ElementaryInstructions F1()) |^ (i + 1) )
set ah = [a,(h . a)];
assume a in dom h ; ::_thesis: not a nin (ElementaryInstructions F1()) |^ (i + 1)
then A121: [a,(h . a)] in h by FUNCT_1:def_2;
percases ( [a,(h . a)] in g or [a,(h . a)] in {[(EmptyIns F1()),F3()]} or [a,(h . a)] in H1(i,g) or [a,(h . a)] in H2(i,g) or [a,(h . a)] in H3(i,g) ) by A27, A121;
suppose [a,(h . a)] in g ; ::_thesis: not a nin (ElementaryInstructions F1()) |^ (i + 1)
then a in dom g by FUNCT_1:1;
hence not a nin (ElementaryInstructions F1()) |^ (i + 1) by A25, A26; ::_thesis: verum
end;
suppose [a,(h . a)] in {[(EmptyIns F1()),F3()]} ; ::_thesis: not a nin (ElementaryInstructions F1()) |^ (i + 1)
then [a,(h . a)] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
then a = EmptyIns F1() by XTUPLE_0:1;
hence not a nin (ElementaryInstructions F1()) |^ (i + 1) by Th76; ::_thesis: verum
end;
suppose [a,(h . a)] in H1(i,g) ; ::_thesis: not a nin (ElementaryInstructions F1()) |^ (i + 1)
then consider I, J being Element of F1(), e, b being Element of F2() such that
A122: [a,(h . a)] = [(I \; J),F5(e,b)] and
A123: I in (ElementaryInstructions F1()) |^ i and
A124: J in (ElementaryInstructions F1()) |^ i and
[I,e] in g and
[J,b] in g ;
a = I \; J by A122, XTUPLE_0:1;
hence not a nin (ElementaryInstructions F1()) |^ (i + 1) by A123, A124, Th76; ::_thesis: verum
end;
suppose [a,(h . a)] in H2(i,g) ; ::_thesis: not a nin (ElementaryInstructions F1()) |^ (i + 1)
then consider C, I, J being Element of F1(), e, b, c being Element of F2() such that
A125: [a,(h . a)] = [(if-then-else (C,I,J)),F7(e,b,c)] and
A126: C in (ElementaryInstructions F1()) |^ i and
A127: I in (ElementaryInstructions F1()) |^ i and
A128: J in (ElementaryInstructions F1()) |^ i and
[C,e] in g and
[I,b] in g and
[J,c] in g ;
a = if-then-else (C,I,J) by A125, XTUPLE_0:1;
hence not a nin (ElementaryInstructions F1()) |^ (i + 1) by A126, A127, A128, Th76; ::_thesis: verum
end;
suppose [a,(h . a)] in H3(i,g) ; ::_thesis: not a nin (ElementaryInstructions F1()) |^ (i + 1)
then consider I, J being Element of F1(), e, b being Element of F2() such that
A129: [a,(h . a)] = [(while (I,J)),F6(e,b)] and
A130: I in (ElementaryInstructions F1()) |^ i and
A131: J in (ElementaryInstructions F1()) |^ i and
[I,e] in g and
[J,b] in g ;
a = while (I,J) by A129, XTUPLE_0:1;
hence not a nin (ElementaryInstructions F1()) |^ (i + 1) by A130, A131, Th76; ::_thesis: verum
end;
end;
end;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin (ElementaryInstructions F1()) |^ (i + 1) or not x nin dom h )
assume A132: x in (ElementaryInstructions F1()) |^ (i + 1) ; ::_thesis: not x nin dom h
percases ( x in (ElementaryInstructions F1()) |^ i or x = EmptyIns F1() or ex I1, I2 being Element of F1() st
( x = I1 \; I2 & I1 in (ElementaryInstructions F1()) |^ i & I2 in (ElementaryInstructions F1()) |^ i ) or ex C, I1, I2 being Element of F1() st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions F1()) |^ i & I1 in (ElementaryInstructions F1()) |^ i & I2 in (ElementaryInstructions F1()) |^ i ) or ex C, I being Element of F1() st
( x = while (C,I) & C in (ElementaryInstructions F1()) |^ i & I in (ElementaryInstructions F1()) |^ i ) ) by A132, Th77;
suppose x in (ElementaryInstructions F1()) |^ i ; ::_thesis: not x nin dom h
then [x,(g . x)] in g by A25, FUNCT_1:def_2;
then [x,(g . x)] in g \/ {[(EmptyIns F1()),F3()]} by XBOOLE_0:def_3;
then [x,(g . x)] in (g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g) by XBOOLE_0:def_3;
then [x,(g . x)] in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) by XBOOLE_0:def_3;
then [x,(g . x)] in h by A24, XBOOLE_0:def_3;
hence not x nin dom h by XTUPLE_0:def_12; ::_thesis: verum
end;
suppose x = EmptyIns F1() ; ::_thesis: not x nin dom h
then [x,F3()] in {[(EmptyIns F1()),F3()]} by TARSKI:def_1;
then [x,F3()] in g \/ {[(EmptyIns F1()),F3()]} by XBOOLE_0:def_3;
then [x,F3()] in (g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g) by XBOOLE_0:def_3;
then [x,F3()] in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) by XBOOLE_0:def_3;
then [x,F3()] in h by A24, XBOOLE_0:def_3;
hence not x nin dom h by XTUPLE_0:def_12; ::_thesis: verum
end;
suppose ex I1, I2 being Element of F1() st
( x = I1 \; I2 & I1 in (ElementaryInstructions F1()) |^ i & I2 in (ElementaryInstructions F1()) |^ i ) ; ::_thesis: not x nin dom h
then consider I1, I2 being Element of F1() such that
A133: x = I1 \; I2 and
A134: I1 in (ElementaryInstructions F1()) |^ i and
A135: I2 in (ElementaryInstructions F1()) |^ i ;
reconsider a = g . I1, b = g . I2 as Element of F2() by A134, A135, FUNCT_2:5;
A136: [I1,a] in g by A25, A134, FUNCT_1:def_2;
[I2,b] in g by A25, A135, FUNCT_1:def_2;
then [x,F5(a,b)] in H1(i,g) by A133, A134, A135, A136;
then [x,F5(a,b)] in (g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g) by XBOOLE_0:def_3;
then [x,F5(a,b)] in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) by XBOOLE_0:def_3;
then [x,F5(a,b)] in h by A24, XBOOLE_0:def_3;
hence not x nin dom h by XTUPLE_0:def_12; ::_thesis: verum
end;
suppose ex C, I1, I2 being Element of F1() st
( x = if-then-else (C,I1,I2) & C in (ElementaryInstructions F1()) |^ i & I1 in (ElementaryInstructions F1()) |^ i & I2 in (ElementaryInstructions F1()) |^ i ) ; ::_thesis: not x nin dom h
then consider C, I1, I2 being Element of F1() such that
A137: x = if-then-else (C,I1,I2) and
A138: C in (ElementaryInstructions F1()) |^ i and
A139: I1 in (ElementaryInstructions F1()) |^ i and
A140: I2 in (ElementaryInstructions F1()) |^ i ;
reconsider a = g . I1, b = g . I2, c = g . C as Element of F2() by A138, A139, A140, FUNCT_2:5;
A141: [I1,a] in g by A25, A139, FUNCT_1:def_2;
A142: [I2,b] in g by A25, A140, FUNCT_1:def_2;
[C,c] in g by A25, A138, FUNCT_1:def_2;
then [x,F7(c,a,b)] in H2(i,g) by A137, A138, A139, A140, A141, A142;
then [x,F7(c,a,b)] in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) by XBOOLE_0:def_3;
then [x,F7(c,a,b)] in h by A24, XBOOLE_0:def_3;
hence not x nin dom h by XTUPLE_0:def_12; ::_thesis: verum
end;
suppose ex C, I being Element of F1() st
( x = while (C,I) & C in (ElementaryInstructions F1()) |^ i & I in (ElementaryInstructions F1()) |^ i ) ; ::_thesis: not x nin dom h
then consider C, I being Element of F1() such that
A143: x = while (C,I) and
A144: C in (ElementaryInstructions F1()) |^ i and
A145: I in (ElementaryInstructions F1()) |^ i ;
reconsider a = g . C, b = g . I as Element of F2() by A144, A145, FUNCT_2:5;
A146: [C,a] in g by A25, A144, FUNCT_1:def_2;
[I,b] in g by A25, A145, FUNCT_1:def_2;
then [x,F6(a,b)] in H3(i,g) by A143, A144, A145, A146;
then [x,F6(a,b)] in h by A24, XBOOLE_0:def_3;
hence not x nin dom h by XTUPLE_0:def_12; ::_thesis: verum
end;
end;
end;
rng h c= F2()
proof
let a be set ; :: according to TARSKI:def_3 ::_thesis: ( a nin rng h or not a nin F2() )
assume a in rng h ; ::_thesis: not a nin F2()
then consider x being set such that
A147: [x,a] in h by XTUPLE_0:def_13;
set ah = [x,a];
percases ( [x,a] in g or [x,a] in {[(EmptyIns F1()),F3()]} or [x,a] in H1(i,g) or [x,a] in H2(i,g) or [x,a] in H3(i,g) ) by A27, A147;
suppose [x,a] in g ; ::_thesis: not a nin F2()
hence not a nin F2() by ZFMISC_1:87; ::_thesis: verum
end;
suppose [x,a] in {[(EmptyIns F1()),F3()]} ; ::_thesis: not a nin F2()
then [x,a] = [(EmptyIns F1()),F3()] by TARSKI:def_1;
then a = F3() by XTUPLE_0:1;
hence not a nin F2() ; ::_thesis: verum
end;
suppose [x,a] in H1(i,g) ; ::_thesis: not a nin F2()
then consider I, J being Element of F1(), e, b being Element of F2() such that
A148: [x,a] = [(I \; J),F5(e,b)] and
I in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
[I,e] in g and
[J,b] in g ;
a = F5(e,b) by A148, XTUPLE_0:1;
hence not a nin F2() ; ::_thesis: verum
end;
suppose [x,a] in H2(i,g) ; ::_thesis: not a nin F2()
then consider C, I, J being Element of F1(), e, b, c being Element of F2() such that
A149: [x,a] = [(if-then-else (C,I,J)),F7(e,b,c)] and
C in (ElementaryInstructions F1()) |^ i and
I in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
[C,e] in g and
[I,b] in g and
[J,c] in g ;
a = F7(e,b,c) by A149, XTUPLE_0:1;
hence not a nin F2() ; ::_thesis: verum
end;
suppose [x,a] in H3(i,g) ; ::_thesis: not a nin F2()
then consider I, J being Element of F1(), e, b being Element of F2() such that
A150: [x,a] = [(while (I,J)),F6(e,b)] and
I in (ElementaryInstructions F1()) |^ i and
J in (ElementaryInstructions F1()) |^ i and
[I,e] in g and
[J,b] in g ;
a = F6(e,b) by A150, XTUPLE_0:1;
hence not a nin F2() ; ::_thesis: verum
end;
end;
end;
then reconsider h = h as Function of ((ElementaryInstructions F1()) |^ (i + 1)),F2() by A120, FUNCT_2:2;
h = ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ (H2(i,g) \/ H3(i,g)) by A24, XBOOLE_1:4
.= (g \/ {[(EmptyIns F1()),F3()]}) \/ (H1(i,g) \/ (H2(i,g) \/ H3(i,g))) by XBOOLE_1:4
.= g \/ ({[(EmptyIns F1()),F3()]} \/ (H1(i,g) \/ (H2(i,g) \/ H3(i,g)))) by XBOOLE_1:4 ;
then A151: g c= h by XBOOLE_1:7;
take h ; ::_thesis: ( h = FF . (i + 1) & ( EmptyIns F1() in (ElementaryInstructions F1()) |^ (i + 1) implies h . (EmptyIns F1()) = F3() ) & ( for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (I1 \; I2) = F5((h . I1),(h . I2)) ) & ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (if-then-else (C,I1,I2)) = F7((h . C),(h . I1),(h . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (while (C,I)) = F6((h . C),(h . I)) ) )
thus h = FF . (i + 1) ; ::_thesis: ( ( EmptyIns F1() in (ElementaryInstructions F1()) |^ (i + 1) implies h . (EmptyIns F1()) = F3() ) & ( for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (I1 \; I2) = F5((h . I1),(h . I2)) ) & ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (if-then-else (C,I1,I2)) = F7((h . C),(h . I1),(h . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (while (C,I)) = F6((h . C),(h . I)) ) )
hereby ::_thesis: ( ( for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (I1 \; I2) = F5((h . I1),(h . I2)) ) & ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (if-then-else (C,I1,I2)) = F7((h . C),(h . I1),(h . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (while (C,I)) = F6((h . C),(h . I)) ) )
set x = EmptyIns F1();
assume EmptyIns F1() in (ElementaryInstructions F1()) |^ (i + 1) ; ::_thesis: h . (EmptyIns F1()) = F3()
[(EmptyIns F1()),F3()] in {[(EmptyIns F1()),F3()]} by TARSKI:def_1;
then [(EmptyIns F1()),F3()] in g \/ {[(EmptyIns F1()),F3()]} by XBOOLE_0:def_3;
then [(EmptyIns F1()),F3()] in (g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g) by XBOOLE_0:def_3;
then [(EmptyIns F1()),F3()] in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) by XBOOLE_0:def_3;
then [(EmptyIns F1()),F3()] in h by A24, XBOOLE_0:def_3;
hence h . (EmptyIns F1()) = F3() by FUNCT_1:1; ::_thesis: verum
end;
hereby ::_thesis: ( ( for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (if-then-else (C,I1,I2)) = F7((h . C),(h . I1),(h . I2)) ) & ( for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (while (C,I)) = F6((h . C),(h . I)) ) )
let I1, I2 be Element of F1(); ::_thesis: ( I1 \; I2 in (ElementaryInstructions F1()) |^ (i + 1) implies h . (I1 \; I2) = F5((h . I1),(h . I2)) )
set x = I1 \; I2;
set y = F5((h . I1),(h . I2));
assume I1 \; I2 in (ElementaryInstructions F1()) |^ (i + 1) ; ::_thesis: h . (I1 \; I2) = F5((h . I1),(h . I2))
then A152: ex i0 being Nat st
( i + 1 = i0 + 1 & I1 in (ElementaryInstructions F1()) |^ i0 & I2 in (ElementaryInstructions F1()) |^ i0 ) by Th88;
then reconsider gI1 = g . I1, gI2 = g . I2 as Element of F2() by FUNCT_2:5;
A153: [I1,gI1] in g by A25, A152, FUNCT_1:def_2;
A154: [I2,gI2] in g by A25, A152, FUNCT_1:def_2;
A155: g . I1 = h . I1 by A151, A153, FUNCT_1:1;
g . I2 = h . I2 by A151, A154, FUNCT_1:1;
then [(I1 \; I2),F5((h . I1),(h . I2))] in H1(i,g) by A152, A153, A154, A155;
then [(I1 \; I2),F5((h . I1),(h . I2))] in (g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g) by XBOOLE_0:def_3;
then [(I1 \; I2),F5((h . I1),(h . I2))] in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) by XBOOLE_0:def_3;
then [(I1 \; I2),F5((h . I1),(h . I2))] in h by A24, XBOOLE_0:def_3;
hence h . (I1 \; I2) = F5((h . I1),(h . I2)) by FUNCT_1:1; ::_thesis: verum
end;
hereby ::_thesis: for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ (i + 1) holds
h . (while (C,I)) = F6((h . C),(h . I))
let C, I1, I2 be Element of F1(); ::_thesis: ( if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ (i + 1) implies h . (if-then-else (C,I1,I2)) = F7((h . C),(h . I1),(h . I2)) )
set x = if-then-else (C,I1,I2);
set y = F7((h . C),(h . I1),(h . I2));
assume if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ (i + 1) ; ::_thesis: h . (if-then-else (C,I1,I2)) = F7((h . C),(h . I1),(h . I2))
then A156: ex i0 being Nat st
( i + 1 = i0 + 1 & C in (ElementaryInstructions F1()) |^ i0 & I1 in (ElementaryInstructions F1()) |^ i0 & I2 in (ElementaryInstructions F1()) |^ i0 ) by Th89;
then reconsider gC = g . C, gI1 = g . I1, gI2 = g . I2 as Element of F2() by FUNCT_2:5;
A157: [C,gC] in g by A25, A156, FUNCT_1:def_2;
A158: [I1,gI1] in g by A25, A156, FUNCT_1:def_2;
A159: [I2,gI2] in g by A25, A156, FUNCT_1:def_2;
A160: g . C = h . C by A151, A157, FUNCT_1:1;
A161: g . I1 = h . I1 by A151, A158, FUNCT_1:1;
g . I2 = h . I2 by A151, A159, FUNCT_1:1;
then [(if-then-else (C,I1,I2)),F7((h . C),(h . I1),(h . I2))] in H2(i,g) by A156, A157, A158, A159, A160, A161;
then [(if-then-else (C,I1,I2)),F7((h . C),(h . I1),(h . I2))] in ((g \/ {[(EmptyIns F1()),F3()]}) \/ H1(i,g)) \/ H2(i,g) by XBOOLE_0:def_3;
then [(if-then-else (C,I1,I2)),F7((h . C),(h . I1),(h . I2))] in h by A24, XBOOLE_0:def_3;
hence h . (if-then-else (C,I1,I2)) = F7((h . C),(h . I1),(h . I2)) by FUNCT_1:1; ::_thesis: verum
end;
let C, I be Element of F1(); ::_thesis: ( while (C,I) in (ElementaryInstructions F1()) |^ (i + 1) implies h . (while (C,I)) = F6((h . C),(h . I)) )
set x = while (C,I);
set y = F6((h . C),(h . I));
assume while (C,I) in (ElementaryInstructions F1()) |^ (i + 1) ; ::_thesis: h . (while (C,I)) = F6((h . C),(h . I))
then A162: ex i0 being Nat st
( i + 1 = i0 + 1 & C in (ElementaryInstructions F1()) |^ i0 & I in (ElementaryInstructions F1()) |^ i0 ) by Th90;
then reconsider gC = g . C, gI = g . I as Element of F2() by FUNCT_2:5;
A163: [C,gC] in g by A25, A162, FUNCT_1:def_2;
A164: [I,gI] in g by A25, A162, FUNCT_1:def_2;
A165: g . C = h . C by A151, A163, FUNCT_1:1;
g . I = h . I by A151, A164, FUNCT_1:1;
then [(while (C,I)),F6((h . C),(h . I))] in H3(i,g) by A162, A163, A164, A165;
then [(while (C,I)),F6((h . C),(h . I))] in h by A24, XBOOLE_0:def_3;
hence h . (while (C,I)) = F6((h . C),(h . I)) by FUNCT_1:1; ::_thesis: verum
end;
A166: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A15, A17);
( Union FF is Relation-like & Union FF is Function-like )
proof
hereby :: according to RELAT_1:def_1 ::_thesis: Union FF is Function-like
let x be set ; ::_thesis: ( x in Union FF implies ex a, b being set st x = [a,b] )
assume x in Union FF ; ::_thesis: ex a, b being set st x = [a,b]
then consider n being set such that
A167: n in dom FF and
A168: x in FF . n by CARD_5:2;
reconsider n = n as Element of NAT by A3, A167;
S1[n] by A166;
hence ex a, b being set st x = [a,b] by A168, RELAT_1:def_1; ::_thesis: verum
end;
let x, y1, y2 be set ; :: according to FUNCT_1:def_1 ::_thesis: ( [x,y1] nin Union FF or [x,y2] nin Union FF or y1 = y2 )
assume [x,y1] in Union FF ; ::_thesis: ( [x,y2] nin Union FF or y1 = y2 )
then consider n1 being set such that
A169: n1 in dom FF and
A170: [x,y1] in FF . n1 by CARD_5:2;
assume [x,y2] in Union FF ; ::_thesis: y1 = y2
then consider n2 being set such that
A171: n2 in dom FF and
A172: [x,y2] in FF . n2 by CARD_5:2;
reconsider n1 = n1, n2 = n2 as Element of NAT by A3, A169, A171;
( n1 <= n2 or n2 <= n1 ) ;
then ( FF . n1 c= FF . n2 or FF . n2 c= FF . n1 ) by A5;
then ( ( [x,y1] in FF . n2 & S1[n2] ) or ( [x,y2] in FF . n1 & S1[n1] ) ) by A166, A170, A172;
hence y1 = y2 by A170, A172, FUNCT_1:def_1; ::_thesis: verum
end;
then reconsider f = Union FF as Function ;
A173: dom f = the carrier of F1()
proof
thus dom f c= the carrier of F1() :: according to XBOOLE_0:def_10 ::_thesis: the carrier of F1() c= dom f
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin dom f or not x nin the carrier of F1() )
assume x in dom f ; ::_thesis: not x nin the carrier of F1()
then [x,(f . x)] in f by FUNCT_1:def_2;
then consider n being set such that
A174: n in dom FF and
A175: [x,(f . x)] in FF . n by CARD_5:2;
reconsider n = n as Element of NAT by A3, A174;
S1[n] by A166;
then x in (ElementaryInstructions F1()) |^ n by A175, ZFMISC_1:87;
hence not x nin the carrier of F1() ; ::_thesis: verum
end;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( x nin the carrier of F1() or not x nin dom f )
assume x in the carrier of F1() ; ::_thesis: not x nin dom f
then reconsider I = x as Element of F1() ;
consider n being Nat such that
A176: I in (ElementaryInstructions F1()) |^ n by Th79;
reconsider n = n as Element of NAT by ORDINAL1:def_12;
S1[n] by A166;
then reconsider g = FF . n as Function of ((ElementaryInstructions F1()) |^ n),F2() ;
dom g = (ElementaryInstructions F1()) |^ n by FUNCT_2:def_1;
then [I,(g . I)] in g by A176, FUNCT_1:def_2;
then [I,(g . I)] in f by A3, CARD_5:2;
hence not x nin dom f by XTUPLE_0:def_12; ::_thesis: verum
end;
rng f c= F2()
proof
let b be set ; :: according to TARSKI:def_3 ::_thesis: ( b nin rng f or not b nin F2() )
assume b in rng f ; ::_thesis: not b nin F2()
then consider a being set such that
A177: a in dom f and
A178: b = f . a by FUNCT_1:def_3;
reconsider a = a as Element of F1() by A173, A177;
consider n being Nat such that
A179: a in (ElementaryInstructions F1()) |^ n by Th79;
reconsider n = n as Element of NAT by ORDINAL1:def_12;
S1[n] by A166;
then reconsider g = FF . n as Function of ((ElementaryInstructions F1()) |^ n),F2() ;
A180: dom g = (ElementaryInstructions F1()) |^ n by FUNCT_2:def_1;
then [a,(g . a)] in g by A179, FUNCT_1:def_2;
then [a,(g . a)] in f by A3, CARD_5:2;
then A181: b = g . a by A178, FUNCT_1:1;
g . a in rng g by A179, A180, FUNCT_1:3;
hence not b nin F2() by A181; ::_thesis: verum
end;
then reconsider f = f as Function of the carrier of F1(),F2() by A173, FUNCT_2:2;
take f ; ::_thesis: ( ( for I being Element of F1() st I in ElementaryInstructions F1() holds
f . I = F4(I) ) & f . (EmptyIns F1()) = F3() & ( for I1, I2 being Element of F1() holds f . (I1 \; I2) = F5((f . I1),(f . I2)) ) & ( for C, I1, I2 being Element of F1() holds f . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2)) ) & ( for C, I being Element of F1() holds f . (while (C,I)) = F6((f . C),(f . I)) ) )
hereby ::_thesis: ( f . (EmptyIns F1()) = F3() & ( for I1, I2 being Element of F1() holds f . (I1 \; I2) = F5((f . I1),(f . I2)) ) & ( for C, I1, I2 being Element of F1() holds f . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2)) ) & ( for C, I being Element of F1() holds f . (while (C,I)) = F6((f . C),(f . I)) ) )
let I be Element of F1(); ::_thesis: ( I in ElementaryInstructions F1() implies f . I = F4(I) )
assume I in ElementaryInstructions F1() ; ::_thesis: f . I = F4(I)
then [I,F4(I)] in FF . 0 by A3;
then [I,F4(I)] in f by A3, CARD_5:2;
hence f . I = F4(I) by FUNCT_1:1; ::_thesis: verum
end;
A182: now__::_thesis:_for_n_being_Nat
for_I_being_Element_of_F1()
for_g_being_Function_of_((ElementaryInstructions_F1())_|^_n),F2()_st_I_in_(ElementaryInstructions_F1())_|^_n_&_g_=_FF_._n_holds_
g_._I_=_f_._I
let n be Nat; ::_thesis: for I being Element of F1()
for g being Function of ((ElementaryInstructions F1()) |^ n),F2() st I in (ElementaryInstructions F1()) |^ n & g = FF . n holds
g . I = f . I
let I be Element of F1(); ::_thesis: for g being Function of ((ElementaryInstructions F1()) |^ n),F2() st I in (ElementaryInstructions F1()) |^ n & g = FF . n holds
g . I = f . I
let g be Function of ((ElementaryInstructions F1()) |^ n),F2(); ::_thesis: ( I in (ElementaryInstructions F1()) |^ n & g = FF . n implies g . I = f . I )
assume that
A183: I in (ElementaryInstructions F1()) |^ n and
A184: g = FF . n ; ::_thesis: g . I = f . I
dom g = (ElementaryInstructions F1()) |^ n by FUNCT_2:def_1;
then A185: [I,(g . I)] in g by A183, FUNCT_1:def_2;
n in NAT by ORDINAL1:def_12;
then [I,(g . I)] in f by A3, A184, A185, CARD_5:2;
hence g . I = f . I by FUNCT_1:1; ::_thesis: verum
end;
consider n0 being Nat such that
A186: EmptyIns F1() in (ElementaryInstructions F1()) |^ n0 by Th79;
reconsider n0 = n0 as Element of NAT by ORDINAL1:def_12;
consider g0 being Function of ((ElementaryInstructions F1()) |^ n0),F2() such that
A187: g0 = FF . n0 and
A188: ( EmptyIns F1() in (ElementaryInstructions F1()) |^ n0 implies g0 . (EmptyIns F1()) = F3() ) and
for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ n0 holds
g0 . (I1 \; I2) = F5((g0 . I1),(g0 . I2)) and
for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (if-then-else (C,I1,I2)) = F7((g0 . C),(g0 . I1),(g0 . I2)) and
for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (while (C,I)) = F6((g0 . C),(g0 . I)) by A166;
dom g0 = (ElementaryInstructions F1()) |^ n0 by FUNCT_2:def_1;
then [(EmptyIns F1()),F3()] in g0 by A186, A188, FUNCT_1:def_2;
then [(EmptyIns F1()),F3()] in f by A3, A187, CARD_5:2;
hence f . (EmptyIns F1()) = F3() by FUNCT_1:1; ::_thesis: ( ( for I1, I2 being Element of F1() holds f . (I1 \; I2) = F5((f . I1),(f . I2)) ) & ( for C, I1, I2 being Element of F1() holds f . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2)) ) & ( for C, I being Element of F1() holds f . (while (C,I)) = F6((f . C),(f . I)) ) )
hereby ::_thesis: ( ( for C, I1, I2 being Element of F1() holds f . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2)) ) & ( for C, I being Element of F1() holds f . (while (C,I)) = F6((f . C),(f . I)) ) )
let I1, I2 be Element of F1(); ::_thesis: f . (I1 \; I2) = F5((f . I1),(f . I2))
consider n0 being Nat such that
A189: I1 \; I2 in (ElementaryInstructions F1()) |^ n0 by Th79;
reconsider n0 = n0 as Element of NAT by ORDINAL1:def_12;
consider g0 being Function of ((ElementaryInstructions F1()) |^ n0),F2() such that
A190: g0 = FF . n0 and
( EmptyIns F1() in (ElementaryInstructions F1()) |^ n0 implies g0 . (EmptyIns F1()) = F3() ) and
A191: for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ n0 holds
g0 . (I1 \; I2) = F5((g0 . I1),(g0 . I2)) and
for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (if-then-else (C,I1,I2)) = F7((g0 . C),(g0 . I1),(g0 . I2)) and
for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (while (C,I)) = F6((g0 . C),(g0 . I)) by A166;
consider i0 being Nat such that
A192: n0 = i0 + 1 and
A193: I1 in (ElementaryInstructions F1()) |^ i0 and
A194: I2 in (ElementaryInstructions F1()) |^ i0 by A189, Th88;
n0 > i0 by A192, NAT_1:13;
then A195: (ElementaryInstructions F1()) |^ i0 c= (ElementaryInstructions F1()) |^ n0 by Th21;
A196: dom g0 = (ElementaryInstructions F1()) |^ n0 by FUNCT_2:def_1;
A197: g0 . I1 = f . I1 by A182, A190, A193, A195;
A198: g0 . I2 = f . I2 by A182, A190, A194, A195;
A199: [(I1 \; I2),(g0 . (I1 \; I2))] in g0 by A189, A196, FUNCT_1:1;
g0 . (I1 \; I2) = F5((f . I1),(f . I2)) by A189, A191, A197, A198;
then [(I1 \; I2),F5((f . I1),(f . I2))] in f by A3, A190, A199, CARD_5:2;
hence f . (I1 \; I2) = F5((f . I1),(f . I2)) by FUNCT_1:1; ::_thesis: verum
end;
hereby ::_thesis: for C, I being Element of F1() holds f . (while (C,I)) = F6((f . C),(f . I))
let C, I1, I2 be Element of F1(); ::_thesis: f . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2))
set IF = if-then-else (C,I1,I2);
consider n0 being Nat such that
A200: if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ n0 by Th79;
reconsider n0 = n0 as Element of NAT by ORDINAL1:def_12;
consider g0 being Function of ((ElementaryInstructions F1()) |^ n0),F2() such that
A201: g0 = FF . n0 and
( EmptyIns F1() in (ElementaryInstructions F1()) |^ n0 implies g0 . (EmptyIns F1()) = F3() ) and
for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ n0 holds
g0 . (I1 \; I2) = F5((g0 . I1),(g0 . I2)) and
A202: for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (if-then-else (C,I1,I2)) = F7((g0 . C),(g0 . I1),(g0 . I2)) and
for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (while (C,I)) = F6((g0 . C),(g0 . I)) by A166;
consider i0 being Nat such that
A203: n0 = i0 + 1 and
A204: C in (ElementaryInstructions F1()) |^ i0 and
A205: I1 in (ElementaryInstructions F1()) |^ i0 and
A206: I2 in (ElementaryInstructions F1()) |^ i0 by A200, Th89;
n0 > i0 by A203, NAT_1:13;
then A207: (ElementaryInstructions F1()) |^ i0 c= (ElementaryInstructions F1()) |^ n0 by Th21;
A208: dom g0 = (ElementaryInstructions F1()) |^ n0 by FUNCT_2:def_1;
A209: g0 . C = f . C by A182, A201, A204, A207;
A210: g0 . I1 = f . I1 by A182, A201, A205, A207;
A211: g0 . I2 = f . I2 by A182, A201, A206, A207;
A212: [(if-then-else (C,I1,I2)),(g0 . (if-then-else (C,I1,I2)))] in g0 by A200, A208, FUNCT_1:1;
g0 . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2)) by A200, A202, A209, A210, A211;
then [(if-then-else (C,I1,I2)),F7((f . C),(f . I1),(f . I2))] in f by A3, A201, A212, CARD_5:2;
hence f . (if-then-else (C,I1,I2)) = F7((f . C),(f . I1),(f . I2)) by FUNCT_1:1; ::_thesis: verum
end;
let C, I be Element of F1(); ::_thesis: f . (while (C,I)) = F6((f . C),(f . I))
set WH = while (C,I);
consider n0 being Nat such that
A213: while (C,I) in (ElementaryInstructions F1()) |^ n0 by Th79;
reconsider n0 = n0 as Element of NAT by ORDINAL1:def_12;
consider g0 being Function of ((ElementaryInstructions F1()) |^ n0),F2() such that
A214: g0 = FF . n0 and
( EmptyIns F1() in (ElementaryInstructions F1()) |^ n0 implies g0 . (EmptyIns F1()) = F3() ) and
for I1, I2 being Element of F1() st I1 \; I2 in (ElementaryInstructions F1()) |^ n0 holds
g0 . (I1 \; I2) = F5((g0 . I1),(g0 . I2)) and
for C, I1, I2 being Element of F1() st if-then-else (C,I1,I2) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (if-then-else (C,I1,I2)) = F7((g0 . C),(g0 . I1),(g0 . I2)) and
A215: for C, I being Element of F1() st while (C,I) in (ElementaryInstructions F1()) |^ n0 holds
g0 . (while (C,I)) = F6((g0 . C),(g0 . I)) by A166;
consider i0 being Nat such that
A216: n0 = i0 + 1 and
A217: C in (ElementaryInstructions F1()) |^ i0 and
A218: I in (ElementaryInstructions F1()) |^ i0 by A213, Th90;
n0 > i0 by A216, NAT_1:13;
then A219: (ElementaryInstructions F1()) |^ i0 c= (ElementaryInstructions F1()) |^ n0 by Th21;
A220: dom g0 = (ElementaryInstructions F1()) |^ n0 by FUNCT_2:def_1;
A221: g0 . C = f . C by A182, A214, A217, A219;
A222: g0 . I = f . I by A182, A214, A218, A219;
A223: [(while (C,I)),(g0 . (while (C,I)))] in g0 by A213, A220, FUNCT_1:1;
g0 . (while (C,I)) = F6((f . C),(f . I)) by A213, A215, A221, A222;
then [(while (C,I)),F6((f . C),(f . I))] in f by A3, A214, A223, CARD_5:2;
hence f . (while (C,I)) = F6((f . C),(f . I)) by FUNCT_1:1; ::_thesis: verum
end;
theorem :: AOFA_000:91
for S being non empty set
for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for g being Function of [:S,(ElementaryInstructions A):],S
for s0 being Element of S ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0 ) )
proof
let S be non empty set ; ::_thesis: for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for g being Function of [:S,(ElementaryInstructions A):],S
for s0 being Element of S ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0 ) )
let T be Subset of S; ::_thesis: for A being free ECIW-strict preIfWhileAlgebra
for g being Function of [:S,(ElementaryInstructions A):],S
for s0 being Element of S ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0 ) )
let A be free ECIW-strict preIfWhileAlgebra; ::_thesis: for g being Function of [:S,(ElementaryInstructions A):],S
for s0 being Element of S ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0 ) )
let g be Function of [:S,(ElementaryInstructions A):],S; ::_thesis: for s0 being Element of S ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0 ) )
let s0 be Element of S; ::_thesis: ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0 ) )
reconsider Ss0 = S --> s0 as Element of Funcs (S,S) by FUNCT_2:9;
set Z = Funcs (S,S);
deffunc H1( Element of A) -> set = (curry' g) . $1;
A1: for I being Element of A st I in ElementaryInstructions A holds
H1(I) in Funcs (S,S)
proof
let I be Element of A; ::_thesis: ( I in ElementaryInstructions A implies H1(I) in Funcs (S,S) )
assume A2: I in ElementaryInstructions A ; ::_thesis: H1(I) in Funcs (S,S)
then reconsider B = ElementaryInstructions A as non empty set ;
reconsider I = I as Element of B by A2;
reconsider g = g as Function of [:S,B:],S ;
(curry' g) . I is Element of Funcs (S,S) ;
hence H1(I) in Funcs (S,S) ; ::_thesis: verum
end;
reconsider idS = id S as Element of Funcs (S,S) by ALTCAT_1:1;
deffunc H2( Element of Funcs (S,S), Element of Funcs (S,S)) -> Element of Funcs (S,S) = $2 * $1;
deffunc H3( Element of Funcs (S,S), Element of Funcs (S,S), Element of Funcs (S,S)) -> Element of Funcs (S,S) = (($2,T) +* $3) * $1;
deffunc H4( Element of Funcs (S,S), Element of Funcs (S,S)) -> Element of Funcs (S,S) = ((T,Ss0) iter ($1 * $2)) * $1;
consider h being Function of the carrier of A,(Funcs (S,S)) such that
A3: for I being Element of A st I in ElementaryInstructions A holds
h . I = H1(I) and
A4: h . (EmptyIns A) = idS and
A5: for I1, I2 being Element of A holds h . (I1 \; I2) = H2(h . I1,h . I2) and
A6: for C, I1, I2 being Element of A holds h . (if-then-else (C,I1,I2)) = H3(h . C,h . I1,h . I2) and
A7: for C, I being Element of A holds h . (while (C,I)) = H4(h . C,h . I) from AOFA_000:sch_7(A1);
h in Funcs ( the carrier of A,(Funcs (S,S))) by FUNCT_2:8;
then uncurry' h in Funcs ([:S, the carrier of A:],S) by FUNCT_6:11;
then reconsider f = uncurry' h as Function of [:S, the carrier of A:],S by FUNCT_2:66;
A8: dom h = the carrier of A by FUNCT_2:def_1;
A9: dom idS = S by FUNCT_2:def_1;
A10: f is complying_with_empty-instruction
proof
let s be Element of S; :: according to AOFA_000:def_28 ::_thesis: f . (s,(EmptyIns A)) = s
idS . s = s by FUNCT_1:18;
hence f . (s,(EmptyIns A)) = s by A4, A8, A9, FUNCT_5:39; ::_thesis: verum
end;
A11: f is complying_with_catenation
proof
let s be Element of S; :: according to AOFA_000:def_29 ::_thesis: for I1, I2 being Element of A holds f . (s,(I1 \; I2)) = f . ((f . (s,I1)),I2)
let I1, I2 be Element of A; ::_thesis: f . (s,(I1 \; I2)) = f . ((f . (s,I1)),I2)
A12: dom (h . (I1 \; I2)) = S by FUNCT_2:def_1;
A13: dom (h . I1) = S by FUNCT_2:def_1;
A14: dom (h . I2) = S by FUNCT_2:def_1;
thus f . (s,(I1 \; I2)) = (h . (I1 \; I2)) . s by A8, A12, FUNCT_5:39
.= ((h . I2) * (h . I1)) . s by A5
.= (h . I2) . ((h . I1) . s) by FUNCT_2:15
.= (h . I2) . (f . (s,I1)) by A8, A13, FUNCT_5:39
.= f . ((f . (s,I1)),I2) by A8, A14, FUNCT_5:39 ; ::_thesis: verum
end;
A15: f complies_with_if_wrt T
proof
let s be Element of S; :: according to AOFA_000:def_30 ::_thesis: for C, I1, I2 being Element of A holds
( ( f . (s,C) in T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1) ) & ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) ) )
let C, I1, I2 be Element of A; ::_thesis: ( ( f . (s,C) in T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1) ) & ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) ) )
A16: dom (h . (if-then-else (C,I1,I2))) = S by FUNCT_2:def_1;
A17: dom (h . C) = S by FUNCT_2:def_1;
A18: dom (h . I1) = S by FUNCT_2:def_1;
A19: dom (h . I2) = S by FUNCT_2:def_1;
A20: f . (s,(if-then-else (C,I1,I2))) = (h . (if-then-else (C,I1,I2))) . s by A8, A16, FUNCT_5:39
.= H3(h . C,h . I1,h . I2) . s by A6
.= (((h . I1),T) +* (h . I2)) . ((h . C) . s) by FUNCT_2:15 ;
A21: f . (s,C) = (h . C) . s by A8, A17, FUNCT_5:39;
hereby ::_thesis: ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) )
assume f . (s,C) in T ; ::_thesis: f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1)
hence f . (s,(if-then-else (C,I1,I2))) = (h . I1) . (f . (s,C)) by A18, A20, A21, Th4
.= f . ((f . (s,C)),I1) by A8, A18, FUNCT_5:39 ;
::_thesis: verum
end;
assume f . (s,C) nin T ; ::_thesis: f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2)
hence f . (s,(if-then-else (C,I1,I2))) = (h . I2) . (f . (s,C)) by A19, A20, A21, Th5
.= f . ((f . (s,C)),I2) by A8, A19, FUNCT_5:39 ;
::_thesis: verum
end;
f complies_with_while_wrt T
proof
let s be Element of S; :: according to AOFA_000:def_31 ::_thesis: for C, I being Element of A holds
( ( f . (s,C) in T implies f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I))) ) & ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) )
let C, I be Element of A; ::_thesis: ( ( f . (s,C) in T implies f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I))) ) & ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) )
A22: dom (h . (while (C,I))) = S by FUNCT_2:def_1;
A23: dom (h . C) = S by FUNCT_2:def_1;
A24: dom (h . I) = S by FUNCT_2:def_1;
A25: dom ((h . C) * (h . I)) = S by FUNCT_2:def_1;
A26: f . (s,(while (C,I))) = (h . (while (C,I))) . s by A8, A22, FUNCT_5:39
.= H4(h . C,h . I) . s by A7
.= ((T,Ss0) iter ((h . C) * (h . I))) . ((h . C) . s) by FUNCT_2:15 ;
A27: f . (s,C) = (h . C) . s by A8, A23, FUNCT_5:39;
A28: rng ((h . C) * (h . I)) c= S ;
A29: now__::_thesis:_for_z_being_Element_of_S_holds_(Ss0_*_((h_._C)_*_(h_._I)))_._z_=_Ss0_._z
let z be Element of S; ::_thesis: (Ss0 * ((h . C) * (h . I))) . z = Ss0 . z
thus (Ss0 * ((h . C) * (h . I))) . z = Ss0 . (((h . C) * (h . I)) . z) by FUNCT_2:15
.= s0 by FUNCOP_1:7
.= Ss0 . z by FUNCOP_1:7 ; ::_thesis: verum
end;
hereby ::_thesis: ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) )
assume f . (s,C) in T ; ::_thesis: f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I)))
hence f . (s,(while (C,I))) = ((T,Ss0) iter ((h . C) * (h . I))) . (((h . C) * (h . I)) . (f . (s,C))) by A25, A26, A27, A28, A29, Th11, FUNCT_2:63
.= ((T,Ss0) iter ((h . C) * (h . I))) . ((h . C) . ((h . I) . (f . (s,C)))) by FUNCT_2:15
.= (((T,Ss0) iter ((h . C) * (h . I))) * (h . C)) . ((h . I) . (f . (s,C))) by FUNCT_2:15
.= (((T,Ss0) iter ((h . C) * (h . I))) * (h . C)) . (f . ((f . (s,C)),I)) by A8, A24, FUNCT_5:39
.= (h . (while (C,I))) . (f . ((f . (s,C)),I)) by A7
.= f . ((f . ((f . (s,C)),I)),(while (C,I))) by A8, A22, FUNCT_5:39 ;
::_thesis: verum
end;
thus ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) by A25, A26, A27, A28, Th12; ::_thesis: verum
end;
then reconsider f = f as ExecutionFunction of A,S,T by A10, A11, A15, Def32;
take f ; ::_thesis: ( f | [:S,(ElementaryInstructions A):] = g & ( for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0 ) )
dom f = [:S, the carrier of A:] by FUNCT_2:def_1;
then A30: [:S,(ElementaryInstructions A):] c= dom f by ZFMISC_1:95;
A31: dom g = [:S,(ElementaryInstructions A):] by FUNCT_2:def_1;
A32: (dom f) /\ [:S,(ElementaryInstructions A):] = [:S,(ElementaryInstructions A):] by A30, XBOOLE_1:28;
now__::_thesis:_for_a_being_set_st_a_in_dom_g_holds_
g_._a_=_f_._a
let a be set ; ::_thesis: ( a in dom g implies g . a = f . a )
assume A33: a in dom g ; ::_thesis: g . a = f . a
then consider s, I being set such that
A34: s in S and
A35: I in ElementaryInstructions A and
A36: a = [s,I] by ZFMISC_1:def_2;
reconsider s = s as Element of S by A34;
reconsider I = I as Element of A by A35;
reconsider EI = (curry' g) . I as Element of Funcs (S,S) by A1, A35;
g in Funcs ([:S,(ElementaryInstructions A):],S) by FUNCT_2:8;
then curry' g in Funcs ((ElementaryInstructions A),(Funcs (S,S))) by A33, FUNCT_6:10;
then A37: dom (curry' g) = ElementaryInstructions A by FUNCT_2:92;
A38: dom EI = S by FUNCT_2:92;
A39: dom (h . I) = S by FUNCT_2:92;
thus g . a = g . (s,I) by A36
.= EI . s by A35, A37, A38, FUNCT_5:34
.= (h . I) . s by A3, A35
.= f . (s,I) by A8, A39, FUNCT_5:39
.= f . a by A36 ; ::_thesis: verum
end;
hence f | [:S,(ElementaryInstructions A):] = g by A31, A32, FUNCT_1:46; ::_thesis: for s being Element of S
for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0
let s be Element of S; ::_thesis: for C, I being Element of A st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = s0
let C, I be Element of A; ::_thesis: ( not f iteration_terminates_for I \; C,f . (s,C) implies f . (s,(while (C,I))) = s0 )
assume A40: not f iteration_terminates_for I \; C,f . (s,C) ; ::_thesis: f . (s,(while (C,I))) = s0
A41: dom (h . (while (C,I))) = S by FUNCT_2:def_1;
A42: dom (h . C) = S by FUNCT_2:def_1;
A43: dom ((h . C) * (h . I)) = S by FUNCT_2:def_1;
A44: f . (s,(while (C,I))) = (h . (while (C,I))) . s by A8, A41, FUNCT_5:39
.= H4(h . C,h . I) . s by A7
.= ((T,Ss0) iter ((h . C) * (h . I))) . ((h . C) . s) by FUNCT_2:15 ;
A45: f . (s,C) = (h . C) . s by A8, A42, FUNCT_5:39;
A46: rng ((h . C) * (h . I)) c= S ;
rng h c= Funcs (S,S) ;
then h = curry' f by FUNCT_5:48;
then (curry' f) . (I \; C) = (h . C) * (h . I) by A5;
then ((h . C) * (h . I)) orbit (f . (s,C)) c= T by A40, Th87;
hence f . (s,(while (C,I))) = Ss0 . (f . (s,C)) by A43, A44, A45, A46, Def7
.= s0 by FUNCOP_1:7 ;
::_thesis: verum
end;
theorem :: AOFA_000:92
for S being non empty set
for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for g being Function of [:S,(ElementaryInstructions A):],S
for F being Function of (Funcs (S,S)),(Funcs (S,S)) st ( for h being Element of Funcs (S,S) holds (F . h) * h = F . h ) holds
ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) )
proof
let S be non empty set ; ::_thesis: for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for g being Function of [:S,(ElementaryInstructions A):],S
for F being Function of (Funcs (S,S)),(Funcs (S,S)) st ( for h being Element of Funcs (S,S) holds (F . h) * h = F . h ) holds
ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) )
let T be Subset of S; ::_thesis: for A being free ECIW-strict preIfWhileAlgebra
for g being Function of [:S,(ElementaryInstructions A):],S
for F being Function of (Funcs (S,S)),(Funcs (S,S)) st ( for h being Element of Funcs (S,S) holds (F . h) * h = F . h ) holds
ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) )
let A be free ECIW-strict preIfWhileAlgebra; ::_thesis: for g being Function of [:S,(ElementaryInstructions A):],S
for F being Function of (Funcs (S,S)),(Funcs (S,S)) st ( for h being Element of Funcs (S,S) holds (F . h) * h = F . h ) holds
ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) )
let g be Function of [:S,(ElementaryInstructions A):],S; ::_thesis: for F being Function of (Funcs (S,S)),(Funcs (S,S)) st ( for h being Element of Funcs (S,S) holds (F . h) * h = F . h ) holds
ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) )
let F be Function of (Funcs (S,S)),(Funcs (S,S)); ::_thesis: ( ( for h being Element of Funcs (S,S) holds (F . h) * h = F . h ) implies ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) ) )
assume A1: for h being Element of Funcs (S,S) holds (F . h) * h = F . h ; ::_thesis: ex f being ExecutionFunction of A,S,T st
( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) )
set Z = Funcs (S,S);
deffunc H1( Element of A) -> set = (curry' g) . $1;
A2: for I being Element of A st I in ElementaryInstructions A holds
H1(I) in Funcs (S,S)
proof
let I be Element of A; ::_thesis: ( I in ElementaryInstructions A implies H1(I) in Funcs (S,S) )
assume A3: I in ElementaryInstructions A ; ::_thesis: H1(I) in Funcs (S,S)
then reconsider B = ElementaryInstructions A as non empty set ;
reconsider I = I as Element of B by A3;
reconsider g = g as Function of [:S,B:],S ;
(curry' g) . I is Element of Funcs (S,S) ;
hence H1(I) in Funcs (S,S) ; ::_thesis: verum
end;
reconsider idS = id S as Element of Funcs (S,S) by ALTCAT_1:1;
deffunc H2( Element of Funcs (S,S), Element of Funcs (S,S)) -> Element of Funcs (S,S) = $2 * $1;
deffunc H3( Element of Funcs (S,S), Element of Funcs (S,S), Element of Funcs (S,S)) -> Element of Funcs (S,S) = (($2,T) +* $3) * $1;
deffunc H4( Element of Funcs (S,S), Element of Funcs (S,S)) -> Element of Funcs (S,S) = ((T,(F . ($1 * $2))) iter ($1 * $2)) * $1;
consider h being Function of the carrier of A,(Funcs (S,S)) such that
A4: for I being Element of A st I in ElementaryInstructions A holds
h . I = H1(I) and
A5: h . (EmptyIns A) = idS and
A6: for I1, I2 being Element of A holds h . (I1 \; I2) = H2(h . I1,h . I2) and
A7: for C, I1, I2 being Element of A holds h . (if-then-else (C,I1,I2)) = H3(h . C,h . I1,h . I2) and
A8: for C, I being Element of A holds h . (while (C,I)) = H4(h . C,h . I) from AOFA_000:sch_7(A2);
h in Funcs ( the carrier of A,(Funcs (S,S))) by FUNCT_2:8;
then uncurry' h in Funcs ([:S, the carrier of A:],S) by FUNCT_6:11;
then reconsider f = uncurry' h as Function of [:S, the carrier of A:],S by FUNCT_2:66;
A9: dom h = the carrier of A by FUNCT_2:def_1;
A10: dom idS = S by FUNCT_2:def_1;
A11: f is complying_with_empty-instruction
proof
let s be Element of S; :: according to AOFA_000:def_28 ::_thesis: f . (s,(EmptyIns A)) = s
idS . s = s by FUNCT_1:18;
hence f . (s,(EmptyIns A)) = s by A5, A9, A10, FUNCT_5:39; ::_thesis: verum
end;
A12: f is complying_with_catenation
proof
let s be Element of S; :: according to AOFA_000:def_29 ::_thesis: for I1, I2 being Element of A holds f . (s,(I1 \; I2)) = f . ((f . (s,I1)),I2)
let I1, I2 be Element of A; ::_thesis: f . (s,(I1 \; I2)) = f . ((f . (s,I1)),I2)
A13: dom (h . (I1 \; I2)) = S by FUNCT_2:def_1;
A14: dom (h . I1) = S by FUNCT_2:def_1;
A15: dom (h . I2) = S by FUNCT_2:def_1;
thus f . (s,(I1 \; I2)) = (h . (I1 \; I2)) . s by A9, A13, FUNCT_5:39
.= ((h . I2) * (h . I1)) . s by A6
.= (h . I2) . ((h . I1) . s) by FUNCT_2:15
.= (h . I2) . (f . (s,I1)) by A9, A14, FUNCT_5:39
.= f . ((f . (s,I1)),I2) by A9, A15, FUNCT_5:39 ; ::_thesis: verum
end;
A16: f complies_with_if_wrt T
proof
let s be Element of S; :: according to AOFA_000:def_30 ::_thesis: for C, I1, I2 being Element of A holds
( ( f . (s,C) in T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1) ) & ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) ) )
let C, I1, I2 be Element of A; ::_thesis: ( ( f . (s,C) in T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1) ) & ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) ) )
A17: dom (h . (if-then-else (C,I1,I2))) = S by FUNCT_2:def_1;
A18: dom (h . C) = S by FUNCT_2:def_1;
A19: dom (h . I1) = S by FUNCT_2:def_1;
A20: dom (h . I2) = S by FUNCT_2:def_1;
A21: f . (s,(if-then-else (C,I1,I2))) = (h . (if-then-else (C,I1,I2))) . s by A9, A17, FUNCT_5:39
.= H3(h . C,h . I1,h . I2) . s by A7
.= (((h . I1),T) +* (h . I2)) . ((h . C) . s) by FUNCT_2:15 ;
A22: f . (s,C) = (h . C) . s by A9, A18, FUNCT_5:39;
hereby ::_thesis: ( f . (s,C) nin T implies f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2) )
assume f . (s,C) in T ; ::_thesis: f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I1)
hence f . (s,(if-then-else (C,I1,I2))) = (h . I1) . (f . (s,C)) by A19, A21, A22, Th4
.= f . ((f . (s,C)),I1) by A9, A19, FUNCT_5:39 ;
::_thesis: verum
end;
assume f . (s,C) nin T ; ::_thesis: f . (s,(if-then-else (C,I1,I2))) = f . ((f . (s,C)),I2)
hence f . (s,(if-then-else (C,I1,I2))) = (h . I2) . (f . (s,C)) by A20, A21, A22, Th5
.= f . ((f . (s,C)),I2) by A9, A20, FUNCT_5:39 ;
::_thesis: verum
end;
f complies_with_while_wrt T
proof
let s be Element of S; :: according to AOFA_000:def_31 ::_thesis: for C, I being Element of A holds
( ( f . (s,C) in T implies f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I))) ) & ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) )
let C, I be Element of A; ::_thesis: ( ( f . (s,C) in T implies f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I))) ) & ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) )
A23: dom (h . (while (C,I))) = S by FUNCT_2:def_1;
A24: dom (h . C) = S by FUNCT_2:def_1;
A25: dom (h . I) = S by FUNCT_2:def_1;
A26: dom ((h . C) * (h . I)) = S by FUNCT_2:def_1;
A27: f . (s,(while (C,I))) = (h . (while (C,I))) . s by A9, A23, FUNCT_5:39
.= H4(h . C,h . I) . s by A8
.= ((T,(F . ((h . C) * (h . I)))) iter ((h . C) * (h . I))) . ((h . C) . s) by FUNCT_2:15 ;
A28: f . (s,C) = (h . C) . s by A9, A24, FUNCT_5:39;
A29: rng ((h . C) * (h . I)) c= S ;
A30: (F . ((h . C) * (h . I))) * ((h . C) * (h . I)) = F . ((h . C) * (h . I)) by A1;
hereby ::_thesis: ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) )
assume f . (s,C) in T ; ::_thesis: f . (s,(while (C,I))) = f . ((f . ((f . (s,C)),I)),(while (C,I)))
hence f . (s,(while (C,I))) = ((T,(F . ((h . C) * (h . I)))) iter ((h . C) * (h . I))) . (((h . C) * (h . I)) . (f . (s,C))) by A26, A27, A28, A29, A30, Th11
.= ((T,(F . ((h . C) * (h . I)))) iter ((h . C) * (h . I))) . ((h . C) . ((h . I) . (f . (s,C)))) by FUNCT_2:15
.= (((T,(F . ((h . C) * (h . I)))) iter ((h . C) * (h . I))) * (h . C)) . ((h . I) . (f . (s,C))) by FUNCT_2:15
.= (((T,(F . ((h . C) * (h . I)))) iter ((h . C) * (h . I))) * (h . C)) . (f . ((f . (s,C)),I)) by A9, A25, FUNCT_5:39
.= (h . (while (C,I))) . (f . ((f . (s,C)),I)) by A8
.= f . ((f . ((f . (s,C)),I)),(while (C,I))) by A9, A23, FUNCT_5:39 ;
::_thesis: verum
end;
thus ( f . (s,C) nin T implies f . (s,(while (C,I))) = f . (s,C) ) by A26, A27, A28, A29, Th12; ::_thesis: verum
end;
then reconsider f = f as ExecutionFunction of A,S,T by A11, A12, A16, Def32;
take f ; ::_thesis: ( f | [:S,(ElementaryInstructions A):] = g & ( for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) ) )
dom f = [:S, the carrier of A:] by FUNCT_2:def_1;
then A31: [:S,(ElementaryInstructions A):] c= dom f by ZFMISC_1:95;
A32: dom g = [:S,(ElementaryInstructions A):] by FUNCT_2:def_1;
A33: (dom f) /\ [:S,(ElementaryInstructions A):] = [:S,(ElementaryInstructions A):] by A31, XBOOLE_1:28;
now__::_thesis:_for_a_being_set_st_a_in_dom_g_holds_
g_._a_=_f_._a
let a be set ; ::_thesis: ( a in dom g implies g . a = f . a )
assume A34: a in dom g ; ::_thesis: g . a = f . a
then consider s, I being set such that
A35: s in S and
A36: I in ElementaryInstructions A and
A37: a = [s,I] by ZFMISC_1:def_2;
reconsider s = s as Element of S by A35;
reconsider I = I as Element of A by A36;
reconsider EI = (curry' g) . I as Element of Funcs (S,S) by A2, A36;
g in Funcs ([:S,(ElementaryInstructions A):],S) by FUNCT_2:8;
then curry' g in Funcs ((ElementaryInstructions A),(Funcs (S,S))) by A34, FUNCT_6:10;
then A38: dom (curry' g) = ElementaryInstructions A by FUNCT_2:92;
A39: dom EI = S by FUNCT_2:92;
A40: dom (h . I) = S by FUNCT_2:92;
thus g . a = g . (s,I) by A37
.= EI . s by A36, A38, A39, FUNCT_5:34
.= (h . I) . s by A4, A36
.= f . (s,I) by A9, A40, FUNCT_5:39
.= f . a by A37 ; ::_thesis: verum
end;
hence f | [:S,(ElementaryInstructions A):] = g by A32, A33, FUNCT_1:46; ::_thesis: for C, I being Element of A
for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C))
let C, I be Element of A; ::_thesis: for s being Element of S st not f iteration_terminates_for I \; C,f . (s,C) holds
f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C))
let s be Element of S; ::_thesis: ( not f iteration_terminates_for I \; C,f . (s,C) implies f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) )
assume A41: not f iteration_terminates_for I \; C,f . (s,C) ; ::_thesis: f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C))
A42: dom (h . (while (C,I))) = S by FUNCT_2:def_1;
A43: dom (h . C) = S by FUNCT_2:def_1;
A44: dom ((h . C) * (h . I)) = S by FUNCT_2:def_1;
A45: f . (s,(while (C,I))) = (h . (while (C,I))) . s by A9, A42, FUNCT_5:39
.= H4(h . C,h . I) . s by A8
.= ((T,(F . ((h . C) * (h . I)))) iter ((h . C) * (h . I))) . ((h . C) . s) by FUNCT_2:15 ;
A46: f . (s,C) = (h . C) . s by A9, A43, FUNCT_5:39;
A47: rng ((h . C) * (h . I)) c= S ;
rng h c= Funcs (S,S) ;
then h = curry' f by FUNCT_5:48;
then A48: (curry' f) . (I \; C) = (h . C) * (h . I) by A6;
then ((h . C) * (h . I)) orbit (f . (s,C)) c= T by A41, Th87;
hence f . (s,(while (C,I))) = (F . ((curry' f) . (I \; C))) . (f . (s,C)) by A44, A45, A46, A47, A48, Def7; ::_thesis: verum
end;
theorem :: AOFA_000:93
for S being non empty set
for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] & ( for s being Element of S
for C, I being Element of A st not f1 iteration_terminates_for I \; C,f1 . (s,C) holds
f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) holds
f1 = f2
proof
let S be non empty set ; ::_thesis: for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] & ( for s being Element of S
for C, I being Element of A st not f1 iteration_terminates_for I \; C,f1 . (s,C) holds
f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) holds
f1 = f2
let T be Subset of S; ::_thesis: for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] & ( for s being Element of S
for C, I being Element of A st not f1 iteration_terminates_for I \; C,f1 . (s,C) holds
f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) holds
f1 = f2
let A be free ECIW-strict preIfWhileAlgebra; ::_thesis: for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] & ( for s being Element of S
for C, I being Element of A st not f1 iteration_terminates_for I \; C,f1 . (s,C) holds
f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) holds
f1 = f2
let f1, f2 be ExecutionFunction of A,S,T; ::_thesis: ( f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] & ( for s being Element of S
for C, I being Element of A st not f1 iteration_terminates_for I \; C,f1 . (s,C) holds
f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) implies f1 = f2 )
assume A1: f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] ; ::_thesis: ( ex s being Element of S ex C, I being Element of A st
( not f1 iteration_terminates_for I \; C,f1 . (s,C) & not f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) or f1 = f2 )
set g = f1 | [:S,(ElementaryInstructions A):];
assume A2: for s being Element of S
for C, I being Element of A st not f1 iteration_terminates_for I \; C,f1 . (s,C) holds
f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ; ::_thesis: f1 = f2
defpred S1[ set ] means for s being Element of S holds f1 . (s,$1) = f2 . (s,$1);
A3: for I being Element of A st I in ElementaryInstructions A holds
S1[I]
proof
let I be Element of A; ::_thesis: ( I in ElementaryInstructions A implies S1[I] )
assume A4: I in ElementaryInstructions A ; ::_thesis: S1[I]
let s be Element of S; ::_thesis: f1 . (s,I) = f2 . (s,I)
A5: [s,I] in [:S,(ElementaryInstructions A):] by A4, ZFMISC_1:87;
hence f1 . (s,I) = (f1 | [:S,(ElementaryInstructions A):]) . [s,I] by FUNCT_1:49
.= f2 . (s,I) by A1, A5, FUNCT_1:49 ;
::_thesis: verum
end;
A6: S1[ EmptyIns A]
proof
let s be Element of S; ::_thesis: f1 . (s,(EmptyIns A)) = f2 . (s,(EmptyIns A))
thus f1 . (s,(EmptyIns A)) = s by Def28
.= f2 . (s,(EmptyIns A)) by Def28 ; ::_thesis: verum
end;
A7: for I1, I2 being Element of A st S1[I1] & S1[I2] holds
S1[I1 \; I2]
proof
let I1, I2 be Element of A; ::_thesis: ( S1[I1] & S1[I2] implies S1[I1 \; I2] )
assume that
A8: S1[I1] and
A9: S1[I2] ; ::_thesis: S1[I1 \; I2]
let s be Element of S; ::_thesis: f1 . (s,(I1 \; I2)) = f2 . (s,(I1 \; I2))
thus f1 . (s,(I1 \; I2)) = f1 . ((f1 . (s,I1)),I2) by Def29
.= f1 . ((f2 . (s,I1)),I2) by A8
.= f2 . ((f2 . (s,I1)),I2) by A9
.= f2 . (s,(I1 \; I2)) by Def29 ; ::_thesis: verum
end;
A10: for C, I1, I2 being Element of A st S1[C] & S1[I1] & S1[I2] holds
S1[ if-then-else (C,I1,I2)]
proof
let C, I1, I2 be Element of A; ::_thesis: ( S1[C] & S1[I1] & S1[I2] implies S1[ if-then-else (C,I1,I2)] )
assume that
A11: S1[C] and
A12: S1[I1] and
A13: S1[I2] ; ::_thesis: S1[ if-then-else (C,I1,I2)]
let s be Element of S; ::_thesis: f1 . (s,(if-then-else (C,I1,I2))) = f2 . (s,(if-then-else (C,I1,I2)))
A14: f1 complies_with_if_wrt T by Def32;
A15: f2 complies_with_if_wrt T by Def32;
A16: f1 . (s,C) = f2 . (s,C) by A11;
percases ( f1 . (s,C) in T or f1 . (s,C) nin T ) ;
supposeA17: f1 . (s,C) in T ; ::_thesis: f1 . (s,(if-then-else (C,I1,I2))) = f2 . (s,(if-then-else (C,I1,I2)))
hence f1 . (s,(if-then-else (C,I1,I2))) = f1 . ((f1 . (s,C)),I1) by A14, Def30
.= f2 . ((f1 . (s,C)),I1) by A12
.= f2 . (s,(if-then-else (C,I1,I2))) by A15, A16, A17, Def30 ;
::_thesis: verum
end;
supposeA18: f1 . (s,C) nin T ; ::_thesis: f1 . (s,(if-then-else (C,I1,I2))) = f2 . (s,(if-then-else (C,I1,I2)))
hence f1 . (s,(if-then-else (C,I1,I2))) = f1 . ((f1 . (s,C)),I2) by A14, Def30
.= f2 . ((f1 . (s,C)),I2) by A13
.= f2 . (s,(if-then-else (C,I1,I2))) by A15, A16, A18, Def30 ;
::_thesis: verum
end;
end;
end;
A19: for C, I being Element of A st S1[C] & S1[I] holds
S1[ while (C,I)]
proof
let C, I be Element of A; ::_thesis: ( S1[C] & S1[I] implies S1[ while (C,I)] )
assume that
A20: S1[C] and
A21: S1[I] ; ::_thesis: S1[ while (C,I)]
let s be Element of S; ::_thesis: f1 . (s,(while (C,I))) = f2 . (s,(while (C,I)))
now__::_thesis:_(_f1_iteration_terminates_for_I_\;_C,f1_._(s,C)_implies_f1_._(s,(while_(C,I)))_=_f2_._(s,(while_(C,I)))_)
assume f1 iteration_terminates_for I \; C,f1 . (s,C) ; ::_thesis: f1 . (s,(while (C,I))) = f2 . (s,(while (C,I)))
then consider r being non empty FinSequence of S such that
A22: r . 1 = f1 . (s,C) and
A23: r . (len r) nin T and
A24: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f1 . ((r . i),(I \; C)) ) by Def33;
A25: f1 . (s,C) = f2 . (s,C) by A20;
A26: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_r_._(i_+_1)_=_f2_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & r . (i + 1) = f2 . ((r . i),(I \; C)) ) )
assume that
A27: 1 <= i and
A28: i < len r ; ::_thesis: ( r . i in T & r . (i + 1) = f2 . ((r . i),(I \; C)) )
thus r . i in T by A24, A27, A28; ::_thesis: r . (i + 1) = f2 . ((r . i),(I \; C))
then reconsider si = r . i as Element of S ;
thus r . (i + 1) = f1 . (si,(I \; C)) by A24, A27, A28
.= f1 . ((f1 . (si,I)),C) by Def29
.= f1 . ((f2 . (si,I)),C) by A21
.= f2 . ((f2 . (si,I)),C) by A20
.= f2 . ((r . i),(I \; C)) by Def29 ; ::_thesis: verum
end;
thus f1 . (s,(while (C,I))) = r . (len r) by A22, A23, A24, Th86
.= f2 . (s,(while (C,I))) by A22, A23, A25, A26, Th86 ; ::_thesis: verum
end;
hence f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) by A2; ::_thesis: verum
end;
now__::_thesis:_for_sI_being_Element_of_[:S,_the_carrier_of_A:]_holds_f1_._sI_=_f2_._sI
let sI be Element of [:S, the carrier of A:]; ::_thesis: f1 . sI = f2 . sI
consider s, I being set such that
A29: s in S and
A30: I in the carrier of A and
A31: sI = [s,I] by ZFMISC_1:def_2;
reconsider I = I as Element of A by A30;
reconsider s = s as Element of S by A29;
S1[I] from AOFA_000:sch_2(A3, A6, A7, A10, A19);
then f1 . (s,I) = f2 . (s,I) ;
hence f1 . sI = f2 . sI by A31; ::_thesis: verum
end;
hence f1 = f2 by FUNCT_2:63; ::_thesis: verum
end;
definition
let A be preIfWhileAlgebra;
let S be non empty set ;
let T be Subset of S;
let f be ExecutionFunction of A,S,T;
defpred S1[ set ] means ( [:S,(ElementaryInstructions A):] c= $1 & [:S,{(EmptyIns A)}:] c= $1 & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in $1 & [(f . (s,I)),J] in $1 implies [s,(I \; J)] in $1 ) & ( [s,C] in $1 & [(f . (s,C)),I] in $1 & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in $1 ) & ( [s,C] in $1 & [(f . (s,C)),J] in $1 & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in $1 ) & ( [s,C] in $1 & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in $1 & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in $1 ) ) ) );
func TerminatingPrograms (A,S,T,f) -> Subset of [:S, the carrier of A:] means :Def35: :: AOFA_000:def 35
( [:S,(ElementaryInstructions A):] c= it & [:S,{(EmptyIns A)}:] c= it & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in it & [(f . (s,I)),J] in it implies [s,(I \; J)] in it ) & ( [s,C] in it & [(f . (s,C)),I] in it & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in it ) & ( [s,C] in it & [(f . (s,C)),J] in it & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in it ) & ( [s,C] in it & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in it & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in it ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
it c= P ) );
existence
ex b1 being Subset of [:S, the carrier of A:] st
( [:S,(ElementaryInstructions A):] c= b1 & [:S,{(EmptyIns A)}:] c= b1 & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in b1 & [(f . (s,I)),J] in b1 implies [s,(I \; J)] in b1 ) & ( [s,C] in b1 & [(f . (s,C)),I] in b1 & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in b1 ) & ( [s,C] in b1 & [(f . (s,C)),J] in b1 & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in b1 ) & ( [s,C] in b1 & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in b1 & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in b1 ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
b1 c= P ) )
proof
set QQ = { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ;
set IT = meet { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ;
S1[ [#] [:S, the carrier of A:]]
proof
set Y = [#] [:S, the carrier of A:];
{(EmptyIns A)} c= the carrier of A by ZFMISC_1:31;
hence ( [:S,(ElementaryInstructions A):] c= [#] [:S, the carrier of A:] & [:S,{(EmptyIns A)}:] c= [#] [:S, the carrier of A:] ) by ZFMISC_1:95; ::_thesis: for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in [#] [:S, the carrier of A:] & [(f . (s,I)),J] in [#] [:S, the carrier of A:] implies [s,(I \; J)] in [#] [:S, the carrier of A:] ) & ( [s,C] in [#] [:S, the carrier of A:] & [(f . (s,C)),I] in [#] [:S, the carrier of A:] & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in [#] [:S, the carrier of A:] ) & ( [s,C] in [#] [:S, the carrier of A:] & [(f . (s,C)),J] in [#] [:S, the carrier of A:] & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in [#] [:S, the carrier of A:] ) & ( [s,C] in [#] [:S, the carrier of A:] & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in [#] [:S, the carrier of A:] & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in [#] [:S, the carrier of A:] ) )
thus for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in [#] [:S, the carrier of A:] & [(f . (s,I)),J] in [#] [:S, the carrier of A:] implies [s,(I \; J)] in [#] [:S, the carrier of A:] ) & ( [s,C] in [#] [:S, the carrier of A:] & [(f . (s,C)),I] in [#] [:S, the carrier of A:] & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in [#] [:S, the carrier of A:] ) & ( [s,C] in [#] [:S, the carrier of A:] & [(f . (s,C)),J] in [#] [:S, the carrier of A:] & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in [#] [:S, the carrier of A:] ) & ( [s,C] in [#] [:S, the carrier of A:] & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in [#] [:S, the carrier of A:] & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in [#] [:S, the carrier of A:] ) ) by ZFMISC_1:87; ::_thesis: verum
end;
then A1: [:S, the carrier of A:] in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ;
then reconsider IT = meet { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } as Subset of [:S, the carrier of A:] by SETFAM_1:3;
take IT ; ::_thesis: ( [:S,(ElementaryInstructions A):] c= IT & [:S,{(EmptyIns A)}:] c= IT & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in IT & [(f . (s,I)),J] in IT implies [s,(I \; J)] in IT ) & ( [s,C] in IT & [(f . (s,C)),I] in IT & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & [(f . (s,C)),J] in IT & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
IT c= P ) )
now__::_thesis:_for_a_being_set_st_a_in__{__Z_where_Z_is_Subset_of_[:S,_the_carrier_of_A:]_:_S1[Z]__}__holds_
[:S,(ElementaryInstructions_A):]_c=_a
let a be set ; ::_thesis: ( a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } implies [:S,(ElementaryInstructions A):] c= a )
assume a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ; ::_thesis: [:S,(ElementaryInstructions A):] c= a
then ex Z being Subset of [:S, the carrier of A:] st
( a = Z & S1[Z] ) ;
hence [:S,(ElementaryInstructions A):] c= a ; ::_thesis: verum
end;
hence [:S,(ElementaryInstructions A):] c= IT by A1, SETFAM_1:5; ::_thesis: ( [:S,{(EmptyIns A)}:] c= IT & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in IT & [(f . (s,I)),J] in IT implies [s,(I \; J)] in IT ) & ( [s,C] in IT & [(f . (s,C)),I] in IT & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & [(f . (s,C)),J] in IT & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
IT c= P ) )
now__::_thesis:_for_a_being_set_st_a_in__{__Z_where_Z_is_Subset_of_[:S,_the_carrier_of_A:]_:_S1[Z]__}__holds_
[:S,{(EmptyIns_A)}:]_c=_a
let a be set ; ::_thesis: ( a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } implies [:S,{(EmptyIns A)}:] c= a )
assume a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ; ::_thesis: [:S,{(EmptyIns A)}:] c= a
then ex Z being Subset of [:S, the carrier of A:] st
( a = Z & S1[Z] ) ;
hence [:S,{(EmptyIns A)}:] c= a ; ::_thesis: verum
end;
hence [:S,{(EmptyIns A)}:] c= IT by A1, SETFAM_1:5; ::_thesis: ( ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in IT & [(f . (s,I)),J] in IT implies [s,(I \; J)] in IT ) & ( [s,C] in IT & [(f . (s,C)),I] in IT & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & [(f . (s,C)),J] in IT & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
IT c= P ) )
hereby ::_thesis: for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
IT c= P
let s be Element of S; ::_thesis: for C, I, J being Element of A holds
( ( [s,I] in IT & [(f . (s,I)),J] in IT implies [s,(I \; J)] in IT ) & ( [s,C] in IT & [(f . (s,C)),I] in IT & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & [(f . (s,C)),J] in IT & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT ) )
let C, I, J be Element of A; ::_thesis: ( ( [s,I] in IT & [(f . (s,I)),J] in IT implies [s,(I \; J)] in IT ) & ( [s,C] in IT & [(f . (s,C)),I] in IT & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & [(f . (s,C)),J] in IT & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT ) )
hereby ::_thesis: ( ( [s,C] in IT & [(f . (s,C)),I] in IT & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & [(f . (s,C)),J] in IT & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT ) )
assume that
A2: [s,I] in IT and
A3: [(f . (s,I)),J] in IT ; ::_thesis: [s,(I \; J)] in IT
now__::_thesis:_for_a_being_set_st_a_in__{__Z_where_Z_is_Subset_of_[:S,_the_carrier_of_A:]_:_S1[Z]__}__holds_
[s,(I_\;_J)]_in_a
let a be set ; ::_thesis: ( a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } implies [s,(I \; J)] in a )
assume A4: a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ; ::_thesis: [s,(I \; J)] in a
then A5: [s,I] in a by A2, SETFAM_1:def_1;
A6: [(f . (s,I)),J] in a by A3, A4, SETFAM_1:def_1;
ex Z being Subset of [:S, the carrier of A:] st
( a = Z & S1[Z] ) by A4;
hence [s,(I \; J)] in a by A5, A6; ::_thesis: verum
end;
hence [s,(I \; J)] in IT by A1, SETFAM_1:def_1; ::_thesis: verum
end;
hereby ::_thesis: ( ( [s,C] in IT & [(f . (s,C)),J] in IT & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in IT ) & ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT ) )
assume that
A7: [s,C] in IT and
A8: [(f . (s,C)),I] in IT and
A9: f . (s,C) in T ; ::_thesis: [s,(if-then-else (C,I,J))] in IT
now__::_thesis:_for_a_being_set_st_a_in__{__Z_where_Z_is_Subset_of_[:S,_the_carrier_of_A:]_:_S1[Z]__}__holds_
[s,(if-then-else_(C,I,J))]_in_a
let a be set ; ::_thesis: ( a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } implies [s,(if-then-else (C,I,J))] in a )
assume A10: a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ; ::_thesis: [s,(if-then-else (C,I,J))] in a
then A11: [s,C] in a by A7, SETFAM_1:def_1;
A12: [(f . (s,C)),I] in a by A8, A10, SETFAM_1:def_1;
ex Z being Subset of [:S, the carrier of A:] st
( a = Z & S1[Z] ) by A10;
hence [s,(if-then-else (C,I,J))] in a by A9, A11, A12; ::_thesis: verum
end;
hence [s,(if-then-else (C,I,J))] in IT by A1, SETFAM_1:def_1; ::_thesis: verum
end;
hereby ::_thesis: ( [s,C] in IT & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT )
assume that
A13: [s,C] in IT and
A14: [(f . (s,C)),J] in IT and
A15: f . (s,C) nin T ; ::_thesis: [s,(if-then-else (C,I,J))] in IT
now__::_thesis:_for_a_being_set_st_a_in__{__Z_where_Z_is_Subset_of_[:S,_the_carrier_of_A:]_:_S1[Z]__}__holds_
[s,(if-then-else_(C,I,J))]_in_a
let a be set ; ::_thesis: ( a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } implies [s,(if-then-else (C,I,J))] in a )
assume A16: a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ; ::_thesis: [s,(if-then-else (C,I,J))] in a
then A17: [s,C] in a by A13, SETFAM_1:def_1;
A18: [(f . (s,C)),J] in a by A14, A16, SETFAM_1:def_1;
ex Z being Subset of [:S, the carrier of A:] st
( a = Z & S1[Z] ) by A16;
hence [s,(if-then-else (C,I,J))] in a by A15, A17, A18; ::_thesis: verum
end;
hence [s,(if-then-else (C,I,J))] in IT by A1, SETFAM_1:def_1; ::_thesis: verum
end;
assume A19: [s,C] in IT ; ::_thesis: ( ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in IT )
given r being non empty FinSequence of S such that A20: r . 1 = f . (s,C) and
A21: r . (len r) nin T and
A22: for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in IT & r . (i + 1) = f . ((r . i),(I \; C)) ) ; ::_thesis: [s,(while (C,I))] in IT
now__::_thesis:_for_a_being_set_st_a_in__{__Z_where_Z_is_Subset_of_[:S,_the_carrier_of_A:]_:_S1[Z]__}__holds_
[s,(while_(C,I))]_in_a
let a be set ; ::_thesis: ( a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } implies [s,(while (C,I))] in a )
assume A23: a in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ; ::_thesis: [s,(while (C,I))] in a
A24: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_a_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I \; C)] in a & r . (i + 1) = f . ((r . i),(I \; C)) ) )
assume that
A25: 1 <= i and
A26: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in a & r . (i + 1) = f . ((r . i),(I \; C)) )
[(r . i),(I \; C)] in IT by A22, A25, A26;
hence ( r . i in T & [(r . i),(I \; C)] in a & r . (i + 1) = f . ((r . i),(I \; C)) ) by A22, A23, A25, A26, SETFAM_1:def_1; ::_thesis: verum
end;
A27: [s,C] in a by A19, A23, SETFAM_1:def_1;
ex Z being Subset of [:S, the carrier of A:] st
( a = Z & S1[Z] ) by A23;
hence [s,(while (C,I))] in a by A20, A21, A24, A27; ::_thesis: verum
end;
hence [s,(while (C,I))] in IT by A1, SETFAM_1:def_1; ::_thesis: verum
end;
let Y be Subset of [:S, the carrier of A:]; ::_thesis: ( [:S,(ElementaryInstructions A):] c= Y & [:S,{(EmptyIns A)}:] c= Y & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in Y & [(f . (s,I)),J] in Y implies [s,(I \; J)] in Y ) & ( [s,C] in Y & [(f . (s,C)),I] in Y & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in Y ) & ( [s,C] in Y & [(f . (s,C)),J] in Y & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in Y ) & ( [s,C] in Y & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in Y & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in Y ) ) ) implies IT c= Y )
assume S1[Y] ; ::_thesis: IT c= Y
then Y in { Z where Z is Subset of [:S, the carrier of A:] : S1[Z] } ;
hence IT c= Y by SETFAM_1:3; ::_thesis: verum
end;
uniqueness
for b1, b2 being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= b1 & [:S,{(EmptyIns A)}:] c= b1 & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in b1 & [(f . (s,I)),J] in b1 implies [s,(I \; J)] in b1 ) & ( [s,C] in b1 & [(f . (s,C)),I] in b1 & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in b1 ) & ( [s,C] in b1 & [(f . (s,C)),J] in b1 & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in b1 ) & ( [s,C] in b1 & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in b1 & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in b1 ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
b1 c= P ) & [:S,(ElementaryInstructions A):] c= b2 & [:S,{(EmptyIns A)}:] c= b2 & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in b2 & [(f . (s,I)),J] in b2 implies [s,(I \; J)] in b2 ) & ( [s,C] in b2 & [(f . (s,C)),I] in b2 & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in b2 ) & ( [s,C] in b2 & [(f . (s,C)),J] in b2 & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in b2 ) & ( [s,C] in b2 & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in b2 & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in b2 ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
b2 c= P ) holds
b1 = b2
proof
let Y1, Y2 be Subset of [:S, the carrier of A:]; ::_thesis: ( [:S,(ElementaryInstructions A):] c= Y1 & [:S,{(EmptyIns A)}:] c= Y1 & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in Y1 & [(f . (s,I)),J] in Y1 implies [s,(I \; J)] in Y1 ) & ( [s,C] in Y1 & [(f . (s,C)),I] in Y1 & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in Y1 ) & ( [s,C] in Y1 & [(f . (s,C)),J] in Y1 & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in Y1 ) & ( [s,C] in Y1 & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in Y1 & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in Y1 ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
Y1 c= P ) & [:S,(ElementaryInstructions A):] c= Y2 & [:S,{(EmptyIns A)}:] c= Y2 & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in Y2 & [(f . (s,I)),J] in Y2 implies [s,(I \; J)] in Y2 ) & ( [s,C] in Y2 & [(f . (s,C)),I] in Y2 & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in Y2 ) & ( [s,C] in Y2 & [(f . (s,C)),J] in Y2 & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in Y2 ) & ( [s,C] in Y2 & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in Y2 & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in Y2 ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
Y2 c= P ) implies Y1 = Y2 )
assume that
A28: S1[Y1] and
A29: for Y being Subset of [:S, the carrier of A:] st S1[Y] holds
Y1 c= Y and
A30: S1[Y2] and
A31: for Y being Subset of [:S, the carrier of A:] st S1[Y] holds
Y2 c= Y ; ::_thesis: Y1 = Y2
thus Y1 c= Y2 by A29, A30; :: according to XBOOLE_0:def_10 ::_thesis: Y2 c= Y1
thus Y2 c= Y1 by A28, A31; ::_thesis: verum
end;
end;
:: deftheorem Def35 defines TerminatingPrograms AOFA_000:def_35_:_
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for b5 being Subset of [:S, the carrier of A:] holds
( b5 = TerminatingPrograms (A,S,T,f) iff ( [:S,(ElementaryInstructions A):] c= b5 & [:S,{(EmptyIns A)}:] c= b5 & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in b5 & [(f . (s,I)),J] in b5 implies [s,(I \; J)] in b5 ) & ( [s,C] in b5 & [(f . (s,C)),I] in b5 & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in b5 ) & ( [s,C] in b5 & [(f . (s,C)),J] in b5 & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in b5 ) & ( [s,C] in b5 & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in b5 & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in b5 ) ) ) & ( for P being Subset of [:S, the carrier of A:] st [:S,(ElementaryInstructions A):] c= P & [:S,{(EmptyIns A)}:] c= P & ( for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) ) holds
b5 c= P ) ) );
definition
let A be preIfWhileAlgebra;
let I be Element of A;
attrI is absolutely-terminating means :Def36: :: AOFA_000:def 36
for S being non empty set
for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,I] in TerminatingPrograms (A,S,T,f);
end;
:: deftheorem Def36 defines absolutely-terminating AOFA_000:def_36_:_
for A being preIfWhileAlgebra
for I being Element of A holds
( I is absolutely-terminating iff for S being non empty set
for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,I] in TerminatingPrograms (A,S,T,f) );
definition
let A be preIfWhileAlgebra;
let S be non empty set ;
let T be Subset of S;
let I be Element of A;
let f be ExecutionFunction of A,S,T;
predI is_terminating_wrt f means :Def37: :: AOFA_000:def 37
for s being Element of S holds [s,I] in TerminatingPrograms (A,S,T,f);
end;
:: deftheorem Def37 defines is_terminating_wrt AOFA_000:def_37_:_
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for I being Element of A
for f being ExecutionFunction of A,S,T holds
( I is_terminating_wrt f iff for s being Element of S holds [s,I] in TerminatingPrograms (A,S,T,f) );
definition
let A be preIfWhileAlgebra;
let S be non empty set ;
let T be Subset of S;
let I be Element of A;
let f be ExecutionFunction of A,S,T;
let Z be set ;
predI is_terminating_wrt f,Z means :Def38: :: AOFA_000:def 38
for s being Element of S st s in Z holds
[s,I] in TerminatingPrograms (A,S,T,f);
predZ is_invariant_wrt I,f means :Def39: :: AOFA_000:def 39
for s being Element of S st s in Z holds
f . (s,I) in Z;
end;
:: deftheorem Def38 defines is_terminating_wrt AOFA_000:def_38_:_
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for I being Element of A
for f being ExecutionFunction of A,S,T
for Z being set holds
( I is_terminating_wrt f,Z iff for s being Element of S st s in Z holds
[s,I] in TerminatingPrograms (A,S,T,f) );
:: deftheorem Def39 defines is_invariant_wrt AOFA_000:def_39_:_
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for I being Element of A
for f being ExecutionFunction of A,S,T
for Z being set holds
( Z is_invariant_wrt I,f iff for s being Element of S st s in Z holds
f . (s,I) in Z );
theorem Th94: :: AOFA_000:94
for A being preIfWhileAlgebra
for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st I in ElementaryInstructions A holds
[s,I] in TerminatingPrograms (A,S,T,f)
proof
let A be preIfWhileAlgebra; ::_thesis: for I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st I in ElementaryInstructions A holds
[s,I] in TerminatingPrograms (A,S,T,f)
let I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st I in ElementaryInstructions A holds
[s,I] in TerminatingPrograms (A,S,T,f)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st I in ElementaryInstructions A holds
[s,I] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T st I in ElementaryInstructions A holds
[s,I] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T st I in ElementaryInstructions A holds
[s,I] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: ( I in ElementaryInstructions A implies [s,I] in TerminatingPrograms (A,S,T,f) )
assume I in ElementaryInstructions A ; ::_thesis: [s,I] in TerminatingPrograms (A,S,T,f)
then A1: [s,I] in [:S,(ElementaryInstructions A):] by ZFMISC_1:87;
[:S,(ElementaryInstructions A):] c= TerminatingPrograms (A,S,T,f) by Def35;
hence [s,I] in TerminatingPrograms (A,S,T,f) by A1; ::_thesis: verum
end;
theorem :: AOFA_000:95
for A being preIfWhileAlgebra
for I being Element of A st I in ElementaryInstructions A holds
I is absolutely-terminating
proof
let A be preIfWhileAlgebra; ::_thesis: for I being Element of A st I in ElementaryInstructions A holds
I is absolutely-terminating
let I be Element of A; ::_thesis: ( I in ElementaryInstructions A implies I is absolutely-terminating )
assume A1: I in ElementaryInstructions A ; ::_thesis: I is absolutely-terminating
let S be non empty set ; :: according to AOFA_000:def_36 ::_thesis: for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,I] in TerminatingPrograms (A,S,T,f)
thus for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,I] in TerminatingPrograms (A,S,T,f) by A1, Th94; ::_thesis: verum
end;
theorem Th96: :: AOFA_000:96
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f)
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T holds [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T holds [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T holds [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f)
set I = EmptyIns A;
EmptyIns A in {(EmptyIns A)} by TARSKI:def_1;
then A1: [s,(EmptyIns A)] in [:S,{(EmptyIns A)}:] by ZFMISC_1:87;
[:S,{(EmptyIns A)}:] c= TerminatingPrograms (A,S,T,f) by Def35;
hence [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f) by A1; ::_thesis: verum
end;
registration
let A be preIfWhileAlgebra;
cluster EmptyIns A -> absolutely-terminating ;
coherence
EmptyIns A is absolutely-terminating
proof
let S be non empty set ; :: according to AOFA_000:def_36 ::_thesis: for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f)
thus for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f) by Th96; ::_thesis: verum
end;
end;
registration
let A be preIfWhileAlgebra;
cluster absolutely-terminating for Element of the carrier of A;
existence
ex b1 being Element of A st b1 is absolutely-terminating
proof
take EmptyIns A ; ::_thesis: EmptyIns A is absolutely-terminating
thus EmptyIns A is absolutely-terminating ; ::_thesis: verum
end;
end;
theorem Th97: :: AOFA_000:97
for A being preIfWhileAlgebra
for I, J being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(I \; J)] in TerminatingPrograms (A,S,T,f) holds
( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) )
proof
let A be preIfWhileAlgebra; ::_thesis: for I, J being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(I \; J)] in TerminatingPrograms (A,S,T,f) holds
( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) )
let I, J be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(I \; J)] in TerminatingPrograms (A,S,T,f) holds
( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) )
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(I \; J)] in TerminatingPrograms (A,S,T,f) holds
( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) )
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(I \; J)] in TerminatingPrograms (A,S,T,f) holds
( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) )
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T st A is free & [s,(I \; J)] in TerminatingPrograms (A,S,T,f) holds
( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) )
let f be ExecutionFunction of A,S,T; ::_thesis: ( A is free & [s,(I \; J)] in TerminatingPrograms (A,S,T,f) implies ( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) ) )
set TP = TerminatingPrograms (A,S,T,f);
assume that
A1: A is free and
A2: [s,(I \; J)] in TerminatingPrograms (A,S,T,f) ; ::_thesis: ( [s,I] in TerminatingPrograms (A,S,T,f) & [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) )
reconsider P = (TerminatingPrograms (A,S,T,f)) \ {[s,(I \; J)]} as Subset of [:S, the carrier of A:] ;
A3: [:S,(ElementaryInstructions A):] c= P
proof
let x, y be set ; :: according to RELAT_1:def_3 ::_thesis: ( [x,y] nin [:S,(ElementaryInstructions A):] or not [x,y] nin P )
assume A4: [x,y] in [:S,(ElementaryInstructions A):] ; ::_thesis: not [x,y] nin P
A5: I <> I \; J by A1, Th73;
A6: J <> I \; J by A1, Th73;
y in ElementaryInstructions A by A4, ZFMISC_1:87;
then A7: y <> I \; J by A5, A6, Th50;
A8: [:S,(ElementaryInstructions A):] c= TerminatingPrograms (A,S,T,f) by Def35;
[x,y] <> [s,(I \; J)] by A7, XTUPLE_0:1;
then [x,y] nin {[s,(I \; J)]} by TARSKI:def_1;
hence not [x,y] nin P by A4, A8, XBOOLE_0:def_5; ::_thesis: verum
end;
A9: [:S,{(EmptyIns A)}:] c= P
proof
let x, y be set ; :: according to RELAT_1:def_3 ::_thesis: ( [x,y] nin [:S,{(EmptyIns A)}:] or not [x,y] nin P )
assume A10: [x,y] in [:S,{(EmptyIns A)}:] ; ::_thesis: not [x,y] nin P
then y in {(EmptyIns A)} by ZFMISC_1:87;
then y = EmptyIns A by TARSKI:def_1;
then A11: y <> I \; J by A1, Th72;
A12: [:S,{(EmptyIns A)}:] c= TerminatingPrograms (A,S,T,f) by Def35;
[x,y] <> [s,(I \; J)] by A11, XTUPLE_0:1;
then [x,y] nin {[s,(I \; J)]} by TARSKI:def_1;
hence not [x,y] nin P by A10, A12, XBOOLE_0:def_5; ::_thesis: verum
end;
set rr = s;
set IJ = I \; J;
A13: now__::_thesis:_for_s_being_Element_of_S
for_C,_I,_J_being_Element_of_A_holds_
(_(_[s,C]_in_P_&_[(f_._(s,C)),I]_in_P_&_f_._(s,C)_in_T_implies_[s,(if-then-else_(C,I,J))]_in_P_)_&_(_[s,C]_in_P_&_[(f_._(s,C)),J]_in_P_&_f_._(s,C)_nin_T_implies_[s,(if-then-else_(C,I,J))]_in_P_)_&_(_[s,C]_in_P_&_ex_r_being_non_empty_FinSequence_of_S_st_
(_r_._1_=_f_._(s,C)_&_r_._(len_r)_nin_T_&_(_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_P_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)_)_)_implies_[s,(while_(C,I))]_in_P_)_)
let s be Element of S; ::_thesis: for C, I, J being Element of A holds
( ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) )
let C, I, J be Element of A; ::_thesis: ( ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) )
hereby ::_thesis: ( ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) )
assume that
A14: [s,C] in P and
A15: [(f . (s,C)),I] in P and
A16: f . (s,C) in T ; ::_thesis: [s,(if-then-else (C,I,J))] in P
A17: [s,C] in TerminatingPrograms (A,S,T,f) by A14, ZFMISC_1:56;
A18: [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) by A15, ZFMISC_1:56;
A19: I \; J <> if-then-else (C,I,J) by A1, Th73;
A20: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) by A16, A17, A18, Def35;
[s,(I \; J)] <> [s,(if-then-else (C,I,J))] by A19, XTUPLE_0:1;
hence [s,(if-then-else (C,I,J))] in P by A20, ZFMISC_1:56; ::_thesis: verum
end;
hereby ::_thesis: ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P )
assume that
A21: [s,C] in P and
A22: [(f . (s,C)),J] in P and
A23: f . (s,C) nin T ; ::_thesis: [s,(if-then-else (C,I,J))] in P
A24: [s,C] in TerminatingPrograms (A,S,T,f) by A21, ZFMISC_1:56;
A25: [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) by A22, ZFMISC_1:56;
A26: I \; J <> if-then-else (C,I,J) by A1, Th73;
A27: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) by A23, A24, A25, Def35;
[s,(I \; J)] <> [s,(if-then-else (C,I,J))] by A26, XTUPLE_0:1;
hence [s,(if-then-else (C,I,J))] in P by A27, ZFMISC_1:56; ::_thesis: verum
end;
assume A28: [s,C] in P ; ::_thesis: ( ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P )
given r being non empty FinSequence of S such that A29: r . 1 = f . (s,C) and
A30: r . (len r) nin T and
A31: for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ; ::_thesis: [s,(while (C,I))] in P
A32: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) )
assume that
A33: 1 <= i and
A34: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
[(r . i),(I \; C)] in P by A31, A33, A34;
hence ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) by A31, A33, A34, ZFMISC_1:56; ::_thesis: verum
end;
A35: [s,C] in TerminatingPrograms (A,S,T,f) by A28, ZFMISC_1:56;
A36: while (C,I) <> I \; J by A1, Th73;
A37: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A29, A30, A32, A35, Def35;
[s,(while (C,I))] <> [s,(I \; J)] by A36, XTUPLE_0:1;
hence [s,(while (C,I))] in P by A37, ZFMISC_1:56; ::_thesis: verum
end;
hereby ::_thesis: [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f)
assume A38: [s,I] nin TerminatingPrograms (A,S,T,f) ; ::_thesis: contradiction
now__::_thesis:_for_q_being_Element_of_S
for_C,_I9,_J9_being_Element_of_A_st_[q,I9]_in_P_&_[(f_._(q,I9)),J9]_in_P_holds_
[q,(I9_\;_J9)]_in_P
let q be Element of S; ::_thesis: for C, I9, J9 being Element of A st [q,I9] in P & [(f . (q,I9)),J9] in P holds
[q,(I9 \; J9)] in P
let C, I9, J9 be Element of A; ::_thesis: ( [q,I9] in P & [(f . (q,I9)),J9] in P implies [q,(I9 \; J9)] in P )
assume that
A39: [q,I9] in P and
A40: [(f . (q,I9)),J9] in P ; ::_thesis: [q,(I9 \; J9)] in P
A41: [q,I9] in TerminatingPrograms (A,S,T,f) by A39, ZFMISC_1:56;
A42: [(f . (q,I9)),J9] in TerminatingPrograms (A,S,T,f) by A40, ZFMISC_1:56;
A43: ( q <> s or I9 \; J9 <> I \; J ) by A1, A38, A41, Th73;
A44: [q,(I9 \; J9)] in TerminatingPrograms (A,S,T,f) by A41, A42, Def35;
[q,(I9 \; J9)] <> [s,(I \; J)] by A43, XTUPLE_0:1;
hence [q,(I9 \; J9)] in P by A44, ZFMISC_1:56; ::_thesis: verum
end;
then for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) by A13;
then TerminatingPrograms (A,S,T,f) c= P by A3, A9, Def35;
hence contradiction by A2, ZFMISC_1:56; ::_thesis: verum
end;
assume A45: [(f . (s,I)),J] nin TerminatingPrograms (A,S,T,f) ; ::_thesis: contradiction
now__::_thesis:_for_q_being_Element_of_S
for_C,_I9,_J9_being_Element_of_A_st_[q,I9]_in_P_&_[(f_._(q,I9)),J9]_in_P_holds_
[q,(I9_\;_J9)]_in_P
let q be Element of S; ::_thesis: for C, I9, J9 being Element of A st [q,I9] in P & [(f . (q,I9)),J9] in P holds
[q,(I9 \; J9)] in P
let C, I9, J9 be Element of A; ::_thesis: ( [q,I9] in P & [(f . (q,I9)),J9] in P implies [q,(I9 \; J9)] in P )
assume that
A46: [q,I9] in P and
A47: [(f . (q,I9)),J9] in P ; ::_thesis: [q,(I9 \; J9)] in P
A48: [q,I9] in TerminatingPrograms (A,S,T,f) by A46, ZFMISC_1:56;
A49: [(f . (q,I9)),J9] in TerminatingPrograms (A,S,T,f) by A47, ZFMISC_1:56;
( f . (q,I9) <> f . (s,I) or J9 <> J ) by A45, A47, ZFMISC_1:56;
then A50: ( q <> s or I9 \; J9 <> I \; J ) by A1, Th73;
A51: [q,(I9 \; J9)] in TerminatingPrograms (A,S,T,f) by A48, A49, Def35;
[q,(I9 \; J9)] <> [s,(I \; J)] by A50, XTUPLE_0:1;
hence [q,(I9 \; J9)] in P by A51, ZFMISC_1:56; ::_thesis: verum
end;
then for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) by A13;
then TerminatingPrograms (A,S,T,f) c= P by A3, A9, Def35;
hence contradiction by A2, ZFMISC_1:56; ::_thesis: verum
end;
registration
let A be preIfWhileAlgebra;
let I, J be absolutely-terminating Element of A;
clusterI \; J -> absolutely-terminating ;
coherence
I \; J is absolutely-terminating
proof
let S be non empty set ; :: according to AOFA_000:def_36 ::_thesis: for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,(I \; J)] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,(I \; J)] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T holds [s,(I \; J)] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: [s,(I \; J)] in TerminatingPrograms (A,S,T,f)
A1: [s,I] in TerminatingPrograms (A,S,T,f) by Def36;
[(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) by Def36;
hence [s,(I \; J)] in TerminatingPrograms (A,S,T,f) by A1, Def35; ::_thesis: verum
end;
end;
theorem Th98: :: AOFA_000:98
for A being preIfWhileAlgebra
for C, I, J being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
proof
let A be preIfWhileAlgebra; ::_thesis: for C, I, J being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
let C, I, J be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T st A is free & [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
let f be ExecutionFunction of A,S,T; ::_thesis: ( A is free & [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) implies ( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) ) )
set TP = TerminatingPrograms (A,S,T,f);
set rr = s;
set IJ = if-then-else (C,I,J);
assume that
A1: A is free and
A2: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) ; ::_thesis: ( [s,C] in TerminatingPrograms (A,S,T,f) & ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
reconsider P = (TerminatingPrograms (A,S,T,f)) \ {[s,(if-then-else (C,I,J))]} as Subset of [:S, the carrier of A:] ;
A3: [:S,(ElementaryInstructions A):] c= P
proof
let x, y be set ; :: according to RELAT_1:def_3 ::_thesis: ( [x,y] nin [:S,(ElementaryInstructions A):] or not [x,y] nin P )
assume A4: [x,y] in [:S,(ElementaryInstructions A):] ; ::_thesis: not [x,y] nin P
then y in ElementaryInstructions A by ZFMISC_1:87;
then A5: y <> if-then-else (C,I,J) by Th51;
A6: [:S,(ElementaryInstructions A):] c= TerminatingPrograms (A,S,T,f) by Def35;
[x,y] <> [s,(if-then-else (C,I,J))] by A5, XTUPLE_0:1;
then [x,y] nin {[s,(if-then-else (C,I,J))]} by TARSKI:def_1;
hence not [x,y] nin P by A4, A6, XBOOLE_0:def_5; ::_thesis: verum
end;
A7: [:S,{(EmptyIns A)}:] c= P
proof
let x, y be set ; :: according to RELAT_1:def_3 ::_thesis: ( [x,y] nin [:S,{(EmptyIns A)}:] or not [x,y] nin P )
assume A8: [x,y] in [:S,{(EmptyIns A)}:] ; ::_thesis: not [x,y] nin P
then y in {(EmptyIns A)} by ZFMISC_1:87;
then y = EmptyIns A by TARSKI:def_1;
then A9: y <> if-then-else (C,I,J) by A1, Th72;
A10: [:S,{(EmptyIns A)}:] c= TerminatingPrograms (A,S,T,f) by Def35;
[x,y] <> [s,(if-then-else (C,I,J))] by A9, XTUPLE_0:1;
then [x,y] nin {[s,(if-then-else (C,I,J))]} by TARSKI:def_1;
hence not [x,y] nin P by A8, A10, XBOOLE_0:def_5; ::_thesis: verum
end;
A11: now__::_thesis:_for_s_being_Element_of_S
for_C,_I,_J_being_Element_of_A_holds_
(_(_[s,I]_in_P_&_[(f_._(s,I)),J]_in_P_implies_[s,(I_\;_J)]_in_P_)_&_(_[s,C]_in_P_&_ex_r_being_non_empty_FinSequence_of_S_st_
(_r_._1_=_f_._(s,C)_&_r_._(len_r)_nin_T_&_(_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_P_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)_)_)_implies_[s,(while_(C,I))]_in_P_)_)
let s be Element of S; ::_thesis: for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) )
let C, I, J be Element of A; ::_thesis: ( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) )
hereby ::_thesis: ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P )
assume that
A12: [s,I] in P and
A13: [(f . (s,I)),J] in P ; ::_thesis: [s,(I \; J)] in P
A14: [s,I] in TerminatingPrograms (A,S,T,f) by A12, ZFMISC_1:56;
A15: [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) by A13, ZFMISC_1:56;
A16: if-then-else (C,I,J) <> I \; J by A1, Th73;
A17: [s,(I \; J)] in TerminatingPrograms (A,S,T,f) by A14, A15, Def35;
[s,(if-then-else (C,I,J))] <> [s,(I \; J)] by A16, XTUPLE_0:1;
hence [s,(I \; J)] in P by A17, ZFMISC_1:56; ::_thesis: verum
end;
assume A18: [s,C] in P ; ::_thesis: ( ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P )
given r being non empty FinSequence of S such that A19: r . 1 = f . (s,C) and
A20: r . (len r) nin T and
A21: for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ; ::_thesis: [s,(while (C,I))] in P
A22: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) )
assume that
A23: 1 <= i and
A24: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
[(r . i),(I \; C)] in P by A21, A23, A24;
hence ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) by A21, A23, A24, ZFMISC_1:56; ::_thesis: verum
end;
A25: [s,C] in TerminatingPrograms (A,S,T,f) by A18, ZFMISC_1:56;
A26: while (C,I) <> if-then-else (C,I,J) by A1, Th74;
A27: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A19, A20, A22, A25, Def35;
[s,(while (C,I))] <> [s,(if-then-else (C,I,J))] by A26, XTUPLE_0:1;
hence [s,(while (C,I))] in P by A27, ZFMISC_1:56; ::_thesis: verum
end;
hereby ::_thesis: ( ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) & ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) ) )
assume A28: [s,C] nin TerminatingPrograms (A,S,T,f) ; ::_thesis: contradiction
A29: now__::_thesis:_for_s_being_Element_of_S
for_C9,_I,_J_being_Element_of_A_st_[s,C9]_in_P_&_[(f_._(s,C9)),I]_in_P_&_f_._(s,C9)_in_T_holds_
[s,(if-then-else_(C9,I,J))]_in_P
let s be Element of S; ::_thesis: for C9, I, J being Element of A st [s,C9] in P & [(f . (s,C9)),I] in P & f . (s,C9) in T holds
[s,(if-then-else (C9,I,J))] in P
let C9, I, J be Element of A; ::_thesis: ( [s,C9] in P & [(f . (s,C9)),I] in P & f . (s,C9) in T implies [s,(if-then-else (C9,I,J))] in P )
assume that
A30: [s,C9] in P and
A31: [(f . (s,C9)),I] in P and
A32: f . (s,C9) in T ; ::_thesis: [s,(if-then-else (C9,I,J))] in P
A33: [s,C9] in TerminatingPrograms (A,S,T,f) by A30, ZFMISC_1:56;
A34: [(f . (s,C9)),I] in TerminatingPrograms (A,S,T,f) by A31, ZFMISC_1:56;
A35: ( if-then-else (C,I,J) <> if-then-else (C9,I,J) or s <> s ) by A1, A28, A33, Th74;
A36: [s,(if-then-else (C9,I,J))] in TerminatingPrograms (A,S,T,f) by A32, A33, A34, Def35;
[s,(if-then-else (C,I,J))] <> [s,(if-then-else (C9,I,J))] by A35, XTUPLE_0:1;
hence [s,(if-then-else (C9,I,J))] in P by A36, ZFMISC_1:56; ::_thesis: verum
end;
now__::_thesis:_for_s_being_Element_of_S
for_C9,_I,_J_being_Element_of_A_st_[s,C9]_in_P_&_[(f_._(s,C9)),J]_in_P_&_f_._(s,C9)_nin_T_holds_
[s,(if-then-else_(C9,I,J))]_in_P
let s be Element of S; ::_thesis: for C9, I, J being Element of A st [s,C9] in P & [(f . (s,C9)),J] in P & f . (s,C9) nin T holds
[s,(if-then-else (C9,I,J))] in P
let C9, I, J be Element of A; ::_thesis: ( [s,C9] in P & [(f . (s,C9)),J] in P & f . (s,C9) nin T implies [s,(if-then-else (C9,I,J))] in P )
assume that
A37: [s,C9] in P and
A38: [(f . (s,C9)),J] in P and
A39: f . (s,C9) nin T ; ::_thesis: [s,(if-then-else (C9,I,J))] in P
A40: [s,C9] in TerminatingPrograms (A,S,T,f) by A37, ZFMISC_1:56;
A41: [(f . (s,C9)),J] in TerminatingPrograms (A,S,T,f) by A38, ZFMISC_1:56;
A42: ( if-then-else (C,I,J) <> if-then-else (C9,I,J) or s <> s ) by A1, A28, A40, Th74;
A43: [s,(if-then-else (C9,I,J))] in TerminatingPrograms (A,S,T,f) by A39, A40, A41, Def35;
[s,(if-then-else (C,I,J))] <> [s,(if-then-else (C9,I,J))] by A42, XTUPLE_0:1;
hence [s,(if-then-else (C9,I,J))] in P by A43, ZFMISC_1:56; ::_thesis: verum
end;
then TerminatingPrograms (A,S,T,f) c= P by A3, A7, A11, A29, Def35;
hence contradiction by A2, ZFMISC_1:56; ::_thesis: verum
end;
thus ( f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) ) ::_thesis: ( f . (s,C) nin T implies [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) )
proof
assume that
A44: f . (s,C) in T and
A45: [(f . (s,C)),I] nin TerminatingPrograms (A,S,T,f) ; ::_thesis: contradiction
A46: now__::_thesis:_for_s_being_Element_of_S
for_C9,_I9,_J_being_Element_of_A_st_[s,C9]_in_P_&_[(f_._(s,C9)),I9]_in_P_&_f_._(s,C9)_in_T_holds_
[s,(if-then-else_(C9,I9,J))]_in_P
let s be Element of S; ::_thesis: for C9, I9, J being Element of A st [s,C9] in P & [(f . (s,C9)),I9] in P & f . (s,C9) in T holds
[s,(if-then-else (C9,I9,J))] in P
let C9, I9, J be Element of A; ::_thesis: ( [s,C9] in P & [(f . (s,C9)),I9] in P & f . (s,C9) in T implies [s,(if-then-else (C9,I9,J))] in P )
assume that
A47: [s,C9] in P and
A48: [(f . (s,C9)),I9] in P and
A49: f . (s,C9) in T ; ::_thesis: [s,(if-then-else (C9,I9,J))] in P
A50: [s,C9] in TerminatingPrograms (A,S,T,f) by A47, ZFMISC_1:56;
A51: [(f . (s,C9)),I9] in TerminatingPrograms (A,S,T,f) by A48, ZFMISC_1:56;
( f . (s,C9) <> f . (s,C) or I <> I9 ) by A45, A48, ZFMISC_1:56;
then A52: ( if-then-else (C,I,J) <> if-then-else (C9,I9,J) or s <> s ) by A1, Th74;
A53: [s,(if-then-else (C9,I9,J))] in TerminatingPrograms (A,S,T,f) by A49, A50, A51, Def35;
[s,(if-then-else (C,I,J))] <> [s,(if-then-else (C9,I9,J))] by A52, XTUPLE_0:1;
hence [s,(if-then-else (C9,I9,J))] in P by A53, ZFMISC_1:56; ::_thesis: verum
end;
now__::_thesis:_for_s_being_Element_of_S
for_C9,_I,_J9_being_Element_of_A_st_[s,C9]_in_P_&_[(f_._(s,C9)),J9]_in_P_&_f_._(s,C9)_nin_T_holds_
[s,(if-then-else_(C9,I,J9))]_in_P
let s be Element of S; ::_thesis: for C9, I, J9 being Element of A st [s,C9] in P & [(f . (s,C9)),J9] in P & f . (s,C9) nin T holds
[s,(if-then-else (C9,I,J9))] in P
let C9, I, J9 be Element of A; ::_thesis: ( [s,C9] in P & [(f . (s,C9)),J9] in P & f . (s,C9) nin T implies [s,(if-then-else (C9,I,J9))] in P )
assume that
A54: [s,C9] in P and
A55: [(f . (s,C9)),J9] in P and
A56: f . (s,C9) nin T ; ::_thesis: [s,(if-then-else (C9,I,J9))] in P
A57: [s,C9] in TerminatingPrograms (A,S,T,f) by A54, ZFMISC_1:56;
A58: [(f . (s,C9)),J9] in TerminatingPrograms (A,S,T,f) by A55, ZFMISC_1:56;
A59: ( if-then-else (C,I,J) <> if-then-else (C9,I,J9) or s <> s ) by A1, A44, A56, Th74;
A60: [s,(if-then-else (C9,I,J9))] in TerminatingPrograms (A,S,T,f) by A56, A57, A58, Def35;
[s,(if-then-else (C,I,J))] <> [s,(if-then-else (C9,I,J9))] by A59, XTUPLE_0:1;
hence [s,(if-then-else (C9,I,J9))] in P by A60, ZFMISC_1:56; ::_thesis: verum
end;
then TerminatingPrograms (A,S,T,f) c= P by A3, A7, A11, A46, Def35;
hence contradiction by A2, ZFMISC_1:56; ::_thesis: verum
end;
assume that
A61: f . (s,C) nin T and
A62: [(f . (s,C)),J] nin TerminatingPrograms (A,S,T,f) ; ::_thesis: contradiction
A63: now__::_thesis:_for_s_being_Element_of_S
for_C9,_I9,_J_being_Element_of_A_st_[s,C9]_in_P_&_[(f_._(s,C9)),I9]_in_P_&_f_._(s,C9)_in_T_holds_
[s,(if-then-else_(C9,I9,J))]_in_P
let s be Element of S; ::_thesis: for C9, I9, J being Element of A st [s,C9] in P & [(f . (s,C9)),I9] in P & f . (s,C9) in T holds
[s,(if-then-else (C9,I9,J))] in P
let C9, I9, J be Element of A; ::_thesis: ( [s,C9] in P & [(f . (s,C9)),I9] in P & f . (s,C9) in T implies [s,(if-then-else (C9,I9,J))] in P )
assume that
A64: [s,C9] in P and
A65: [(f . (s,C9)),I9] in P and
A66: f . (s,C9) in T ; ::_thesis: [s,(if-then-else (C9,I9,J))] in P
A67: [s,C9] in TerminatingPrograms (A,S,T,f) by A64, ZFMISC_1:56;
A68: [(f . (s,C9)),I9] in TerminatingPrograms (A,S,T,f) by A65, ZFMISC_1:56;
A69: ( if-then-else (C,I,J) <> if-then-else (C9,I9,J) or s <> s ) by A1, A61, A66, Th74;
A70: [s,(if-then-else (C9,I9,J))] in TerminatingPrograms (A,S,T,f) by A66, A67, A68, Def35;
[s,(if-then-else (C,I,J))] <> [s,(if-then-else (C9,I9,J))] by A69, XTUPLE_0:1;
hence [s,(if-then-else (C9,I9,J))] in P by A70, ZFMISC_1:56; ::_thesis: verum
end;
now__::_thesis:_for_s_being_Element_of_S
for_C9,_I,_J9_being_Element_of_A_st_[s,C9]_in_P_&_[(f_._(s,C9)),J9]_in_P_&_f_._(s,C9)_nin_T_holds_
[s,(if-then-else_(C9,I,J9))]_in_P
let s be Element of S; ::_thesis: for C9, I, J9 being Element of A st [s,C9] in P & [(f . (s,C9)),J9] in P & f . (s,C9) nin T holds
[s,(if-then-else (C9,I,J9))] in P
let C9, I, J9 be Element of A; ::_thesis: ( [s,C9] in P & [(f . (s,C9)),J9] in P & f . (s,C9) nin T implies [s,(if-then-else (C9,I,J9))] in P )
assume that
A71: [s,C9] in P and
A72: [(f . (s,C9)),J9] in P and
A73: f . (s,C9) nin T ; ::_thesis: [s,(if-then-else (C9,I,J9))] in P
A74: [s,C9] in TerminatingPrograms (A,S,T,f) by A71, ZFMISC_1:56;
A75: [(f . (s,C9)),J9] in TerminatingPrograms (A,S,T,f) by A72, ZFMISC_1:56;
( f . (s,C9) <> f . (s,C) or J <> J9 ) by A62, A72, ZFMISC_1:56;
then A76: ( if-then-else (C,I,J) <> if-then-else (C9,I,J9) or s <> s ) by A1, Th74;
A77: [s,(if-then-else (C9,I,J9))] in TerminatingPrograms (A,S,T,f) by A73, A74, A75, Def35;
[s,(if-then-else (C,I,J))] <> [s,(if-then-else (C9,I,J9))] by A76, XTUPLE_0:1;
hence [s,(if-then-else (C9,I,J9))] in P by A77, ZFMISC_1:56; ::_thesis: verum
end;
then TerminatingPrograms (A,S,T,f) c= P by A3, A7, A11, A63, Def35;
hence contradiction by A2, ZFMISC_1:56; ::_thesis: verum
end;
registration
let A be preIfWhileAlgebra;
let C, I, J be absolutely-terminating Element of A;
cluster if-then-else (C,I,J) -> absolutely-terminating ;
coherence
if-then-else (C,I,J) is absolutely-terminating
proof
let S be non empty set ; :: according to AOFA_000:def_36 ::_thesis: for s being Element of S
for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T holds [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T holds [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f)
A1: [s,C] in TerminatingPrograms (A,S,T,f) by Def36;
A2: ( f . (s,C) in T or f . (s,C) nin T ) ;
A3: [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) by Def36;
[(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) by Def36;
hence [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) by A1, A2, A3, Def35; ::_thesis: verum
end;
end;
registration
let A be preIfWhileAlgebra;
let C, I be absolutely-terminating Element of A;
cluster if-then (C,I) -> absolutely-terminating ;
coherence
if-then (C,I) is absolutely-terminating ;
end;
theorem Th99: :: AOFA_000:99
for A being preIfWhileAlgebra
for C, I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) )
proof
let A be preIfWhileAlgebra; ::_thesis: for C, I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) )
let C, I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) )
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) )
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) )
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) holds
( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) )
let f be ExecutionFunction of A,S,T; ::_thesis: ( A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) implies ( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) ) )
set TP = TerminatingPrograms (A,S,T,f);
set rr = s;
set IJ = while (C,I);
assume that
A1: A is free and
A2: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) ; ::_thesis: ( [s,C] in TerminatingPrograms (A,S,T,f) & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) )
reconsider P = (TerminatingPrograms (A,S,T,f)) \ {[s,(while (C,I))]} as Subset of [:S, the carrier of A:] ;
A3: [:S,(ElementaryInstructions A):] c= P
proof
let x, y be set ; :: according to RELAT_1:def_3 ::_thesis: ( [x,y] nin [:S,(ElementaryInstructions A):] or not [x,y] nin P )
assume A4: [x,y] in [:S,(ElementaryInstructions A):] ; ::_thesis: not [x,y] nin P
then y in ElementaryInstructions A by ZFMISC_1:87;
then A5: y <> while (C,I) by Th52;
A6: [:S,(ElementaryInstructions A):] c= TerminatingPrograms (A,S,T,f) by Def35;
[x,y] <> [s,(while (C,I))] by A5, XTUPLE_0:1;
then [x,y] nin {[s,(while (C,I))]} by TARSKI:def_1;
hence not [x,y] nin P by A4, A6, XBOOLE_0:def_5; ::_thesis: verum
end;
A7: [:S,{(EmptyIns A)}:] c= P
proof
let x, y be set ; :: according to RELAT_1:def_3 ::_thesis: ( [x,y] nin [:S,{(EmptyIns A)}:] or not [x,y] nin P )
assume A8: [x,y] in [:S,{(EmptyIns A)}:] ; ::_thesis: not [x,y] nin P
then y in {(EmptyIns A)} by ZFMISC_1:87;
then y = EmptyIns A by TARSKI:def_1;
then A9: y <> while (C,I) by A1, Th72;
A10: [:S,{(EmptyIns A)}:] c= TerminatingPrograms (A,S,T,f) by Def35;
[x,y] <> [s,(while (C,I))] by A9, XTUPLE_0:1;
then [x,y] nin {[s,(while (C,I))]} by TARSKI:def_1;
hence not [x,y] nin P by A8, A10, XBOOLE_0:def_5; ::_thesis: verum
end;
A11: now__::_thesis:_for_s_being_Element_of_S
for_C,_I,_J_being_Element_of_A_holds_
(_(_[s,I]_in_P_&_[(f_._(s,I)),J]_in_P_implies_[s,(I_\;_J)]_in_P_)_&_(_[s,C]_in_P_&_[(f_._(s,C)),I]_in_P_&_f_._(s,C)_in_T_implies_[s,(if-then-else_(C,I,J))]_in_P_)_&_(_[s,C]_in_P_&_[(f_._(s,C)),J]_in_P_&_f_._(s,C)_nin_T_implies_[s,(if-then-else_(C,I,J))]_in_P_)_)
let s be Element of S; ::_thesis: for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) )
let C, I, J be Element of A; ::_thesis: ( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) )
hereby ::_thesis: ( ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) )
assume that
A12: [s,I] in P and
A13: [(f . (s,I)),J] in P ; ::_thesis: [s,(I \; J)] in P
A14: [s,I] in TerminatingPrograms (A,S,T,f) by A12, ZFMISC_1:56;
A15: [(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) by A13, ZFMISC_1:56;
A16: while (C,I) <> I \; J by A1, Th73;
A17: [s,(I \; J)] in TerminatingPrograms (A,S,T,f) by A14, A15, Def35;
[s,(while (C,I))] <> [s,(I \; J)] by A16, XTUPLE_0:1;
hence [s,(I \; J)] in P by A17, ZFMISC_1:56; ::_thesis: verum
end;
hereby ::_thesis: ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P )
assume that
A18: [s,C] in P and
A19: [(f . (s,C)),I] in P and
A20: f . (s,C) in T ; ::_thesis: [s,(if-then-else (C,I,J))] in P
A21: [s,C] in TerminatingPrograms (A,S,T,f) by A18, ZFMISC_1:56;
A22: [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) by A19, ZFMISC_1:56;
A23: while (C,I) <> if-then-else (C,I,J) by A1, Th74;
A24: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) by A20, A21, A22, Def35;
[s,(while (C,I))] <> [s,(if-then-else (C,I,J))] by A23, XTUPLE_0:1;
hence [s,(if-then-else (C,I,J))] in P by A24, ZFMISC_1:56; ::_thesis: verum
end;
hereby ::_thesis: verum
assume that
A25: [s,C] in P and
A26: [(f . (s,C)),J] in P and
A27: f . (s,C) nin T ; ::_thesis: [s,(if-then-else (C,I,J))] in P
A28: [s,C] in TerminatingPrograms (A,S,T,f) by A25, ZFMISC_1:56;
A29: [(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) by A26, ZFMISC_1:56;
A30: while (C,I) <> if-then-else (C,I,J) by A1, Th74;
A31: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) by A27, A28, A29, Def35;
[s,(while (C,I))] <> [s,(if-then-else (C,I,J))] by A30, XTUPLE_0:1;
hence [s,(if-then-else (C,I,J))] in P by A31, ZFMISC_1:56; ::_thesis: verum
end;
end;
hereby ::_thesis: ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) )
assume A32: [s,C] nin TerminatingPrograms (A,S,T,f) ; ::_thesis: contradiction
now__::_thesis:_for_s_being_Element_of_S
for_C9,_I9,_J_being_Element_of_A_st_[s,C9]_in_P_&_ex_r_being_non_empty_FinSequence_of_S_st_
(_r_._1_=_f_._(s,C9)_&_r_._(len_r)_nin_T_&_(_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I9_\;_C9)]_in_P_&_r_._(i_+_1)_=_f_._((r_._i),(I9_\;_C9))_)_)_)_holds_
[s,(while_(C9,I9))]_in_P
let s be Element of S; ::_thesis: for C9, I9, J being Element of A st [s,C9] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C9) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ) ) holds
[s,(while (C9,I9))] in P
let C9, I9, J be Element of A; ::_thesis: ( [s,C9] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C9) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ) ) implies [s,(while (C9,I9))] in P )
assume A33: [s,C9] in P ; ::_thesis: ( ex r being non empty FinSequence of S st
( r . 1 = f . (s,C9) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ) ) implies [s,(while (C9,I9))] in P )
given r being non empty FinSequence of S such that A34: r . 1 = f . (s,C9) and
A35: r . (len r) nin T and
A36: for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ; ::_thesis: [s,(while (C9,I9))] in P
A37: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I9_\;_C9)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I9_\;_C9))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I9 \; C9)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) )
assume that
A38: 1 <= i and
A39: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I9 \; C9)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I9 \; C9)) )
[(r . i),(I9 \; C9)] in P by A36, A38, A39;
hence ( r . i in T & [(r . i),(I9 \; C9)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) by A36, A38, A39, ZFMISC_1:56; ::_thesis: verum
end;
A40: [s,C9] in TerminatingPrograms (A,S,T,f) by A33, ZFMISC_1:56;
then A41: ( while (C9,I9) <> while (C,I) or s <> s ) by A1, A32, Th75;
A42: [s,(while (C9,I9))] in TerminatingPrograms (A,S,T,f) by A34, A35, A37, A40, Def35;
[s,(while (C9,I9))] <> [s,(while (C,I))] by A41, XTUPLE_0:1;
hence [s,(while (C9,I9))] in P by A42, ZFMISC_1:56; ::_thesis: verum
end;
then for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) by A11;
then TerminatingPrograms (A,S,T,f) c= P by A3, A7, Def35;
hence contradiction by A2, ZFMISC_1:56; ::_thesis: verum
end;
assume A43: for r being non empty FinSequence of S holds
( not r . 1 = f . (s,C) or not r . (len r) nin T or ex i being Nat st
( 1 <= i & i < len r & not ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) ; ::_thesis: contradiction
now__::_thesis:_for_s_being_Element_of_S
for_C9,_I9,_J_being_Element_of_A_st_[s,C9]_in_P_&_ex_r_being_non_empty_FinSequence_of_S_st_
(_r_._1_=_f_._(s,C9)_&_r_._(len_r)_nin_T_&_(_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I9_\;_C9)]_in_P_&_r_._(i_+_1)_=_f_._((r_._i),(I9_\;_C9))_)_)_)_holds_
[s,(while_(C9,I9))]_in_P
let s be Element of S; ::_thesis: for C9, I9, J being Element of A st [s,C9] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C9) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ) ) holds
[s,(while (C9,I9))] in P
let C9, I9, J be Element of A; ::_thesis: ( [s,C9] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C9) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ) ) implies [s,(while (C9,I9))] in P )
assume A44: [s,C9] in P ; ::_thesis: ( ex r being non empty FinSequence of S st
( r . 1 = f . (s,C9) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ) ) implies [s,(while (C9,I9))] in P )
given r being non empty FinSequence of S such that A45: r . 1 = f . (s,C9) and
A46: r . (len r) nin T and
A47: for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I9 \; C9)] in P & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) ; ::_thesis: [s,(while (C9,I9))] in P
A48: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I9_\;_C9)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I9_\;_C9))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I9 \; C9)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) )
assume that
A49: 1 <= i and
A50: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I9 \; C9)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I9 \; C9)) )
[(r . i),(I9 \; C9)] in P by A47, A49, A50;
hence ( r . i in T & [(r . i),(I9 \; C9)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I9 \; C9)) ) by A47, A49, A50, ZFMISC_1:56; ::_thesis: verum
end;
A51: [s,C9] in TerminatingPrograms (A,S,T,f) by A44, ZFMISC_1:56;
( I <> I9 or C <> C9 or s <> s ) by A43, A45, A46, A48;
then A52: ( while (C9,I9) <> while (C,I) or s <> s ) by A1, Th75;
A53: [s,(while (C9,I9))] in TerminatingPrograms (A,S,T,f) by A45, A46, A48, A51, Def35;
[s,(while (C9,I9))] <> [s,(while (C,I))] by A52, XTUPLE_0:1;
hence [s,(while (C9,I9))] in P by A53, ZFMISC_1:56; ::_thesis: verum
end;
then for s being Element of S
for C, I, J being Element of A holds
( ( [s,I] in P & [(f . (s,I)),J] in P implies [s,(I \; J)] in P ) & ( [s,C] in P & [(f . (s,C)),I] in P & f . (s,C) in T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & [(f . (s,C)),J] in P & f . (s,C) nin T implies [s,(if-then-else (C,I,J))] in P ) & ( [s,C] in P & ex r being non empty FinSequence of S st
( r . 1 = f . (s,C) & r . (len r) nin T & ( for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in P & r . (i + 1) = f . ((r . i),(I \; C)) ) ) ) implies [s,(while (C,I))] in P ) ) by A11;
then TerminatingPrograms (A,S,T,f) c= P by A3, A7, Def35;
hence contradiction by A2, ZFMISC_1:56; ::_thesis: verum
end;
theorem :: AOFA_000:100
for A being preIfWhileAlgebra
for C, I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) & f . (s,C) in T holds
[(f . (s,C)),I] in TerminatingPrograms (A,S,T,f)
proof
let A be preIfWhileAlgebra; ::_thesis: for C, I being Element of A
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) & f . (s,C) in T holds
[(f . (s,C)),I] in TerminatingPrograms (A,S,T,f)
let C, I be Element of A; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) & f . (s,C) in T holds
[(f . (s,C)),I] in TerminatingPrograms (A,S,T,f)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) & f . (s,C) in T holds
[(f . (s,C)),I] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) & f . (s,C) in T holds
[(f . (s,C)),I] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T st A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) & f . (s,C) in T holds
[(f . (s,C)),I] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: ( A is free & [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) & f . (s,C) in T implies [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) )
set TP = TerminatingPrograms (A,S,T,f);
set IJ = while (C,I);
assume that
A1: A is free and
A2: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) and
A3: f . (s,C) in T ; ::_thesis: [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f)
consider r being non empty FinSequence of S such that
A4: r . 1 = f . (s,C) and
A5: r . (len r) nin T and
A6: for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) by A1, A2, Th99;
len r >= 1 by NAT_1:14;
then 1 < len r by A3, A4, A5, XXREAL_0:1;
then [(r . 1),(I \; C)] in TerminatingPrograms (A,S,T,f) by A6;
hence [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) by A1, A4, Th97; ::_thesis: verum
end;
theorem :: AOFA_000:101
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being absolutely-terminating Element of A st f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being absolutely-terminating Element of A st f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being absolutely-terminating Element of A st f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being absolutely-terminating Element of A st f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T
for C, I being absolutely-terminating Element of A st f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: for C, I being absolutely-terminating Element of A st f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let C, I be absolutely-terminating Element of A; ::_thesis: ( f iteration_terminates_for I \; C,f . (s,C) implies [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
given r being non empty FinSequence of S such that A1: r . 1 = f . (s,C) and
A2: r . (len r) nin T and
A3: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ; :: according to AOFA_000:def_33 ::_thesis: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
A4: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) )
assume that
A5: 1 <= i and
A6: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
thus r . i in T by A3, A5, A6; ::_thesis: ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
hence ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) by A3, A5, A6, Def36; ::_thesis: verum
end;
[s,C] in TerminatingPrograms (A,S,T,f) by Def36;
hence [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A1, A2, A4, Def35; ::_thesis: verum
end;
Lm3: for S being non empty set
for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
for I being Element of A
for s being Element of S st [s,I] in TerminatingPrograms (A,S,T,f1) holds
( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) )
proof
let S be non empty set ; ::_thesis: for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
for I being Element of A
for s being Element of S st [s,I] in TerminatingPrograms (A,S,T,f1) holds
( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) )
let T be Subset of S; ::_thesis: for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
for I being Element of A
for s being Element of S st [s,I] in TerminatingPrograms (A,S,T,f1) holds
( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) )
let A be free ECIW-strict preIfWhileAlgebra; ::_thesis: for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
for I being Element of A
for s being Element of S st [s,I] in TerminatingPrograms (A,S,T,f1) holds
( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) )
let f1, f2 be ExecutionFunction of A,S,T; ::_thesis: ( f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] implies for I being Element of A
for s being Element of S st [s,I] in TerminatingPrograms (A,S,T,f1) holds
( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) ) )
assume A1: f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] ; ::_thesis: for I being Element of A
for s being Element of S st [s,I] in TerminatingPrograms (A,S,T,f1) holds
( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) )
set g = f1 | [:S,(ElementaryInstructions A):];
set TP1 = TerminatingPrograms (A,S,T,f1);
set TP2 = TerminatingPrograms (A,S,T,f2);
defpred S1[ Element of A] means for s being Element of S st [s,$1] in TerminatingPrograms (A,S,T,f1) holds
( [s,$1] in TerminatingPrograms (A,S,T,f2) & f1 . (s,$1) = f2 . (s,$1) );
A2: for I being Element of A st I in ElementaryInstructions A holds
S1[I]
proof
let I be Element of A; ::_thesis: ( I in ElementaryInstructions A implies S1[I] )
assume A3: I in ElementaryInstructions A ; ::_thesis: S1[I]
let s be Element of S; ::_thesis: ( [s,I] in TerminatingPrograms (A,S,T,f1) implies ( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) ) )
assume [s,I] in TerminatingPrograms (A,S,T,f1) ; ::_thesis: ( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) )
thus [s,I] in TerminatingPrograms (A,S,T,f2) by A3, Th94; ::_thesis: f1 . (s,I) = f2 . (s,I)
A4: [s,I] in [:S,(ElementaryInstructions A):] by A3, ZFMISC_1:87;
hence f1 . (s,I) = (f1 | [:S,(ElementaryInstructions A):]) . [s,I] by FUNCT_1:49
.= f2 . (s,I) by A1, A4, FUNCT_1:49 ;
::_thesis: verum
end;
A5: S1[ EmptyIns A]
proof
let s be Element of S; ::_thesis: ( [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f1) implies ( [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(EmptyIns A)) = f2 . (s,(EmptyIns A)) ) )
f1 . (s,(EmptyIns A)) = s by Def28;
hence ( [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f1) implies ( [s,(EmptyIns A)] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(EmptyIns A)) = f2 . (s,(EmptyIns A)) ) ) by Def28, Th96; ::_thesis: verum
end;
A6: for I1, I2 being Element of A st S1[I1] & S1[I2] holds
S1[I1 \; I2]
proof
let I1, I2 be Element of A; ::_thesis: ( S1[I1] & S1[I2] implies S1[I1 \; I2] )
assume that
A7: S1[I1] and
A8: S1[I2] ; ::_thesis: S1[I1 \; I2]
let s be Element of S; ::_thesis: ( [s,(I1 \; I2)] in TerminatingPrograms (A,S,T,f1) implies ( [s,(I1 \; I2)] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(I1 \; I2)) = f2 . (s,(I1 \; I2)) ) )
assume A9: [s,(I1 \; I2)] in TerminatingPrograms (A,S,T,f1) ; ::_thesis: ( [s,(I1 \; I2)] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(I1 \; I2)) = f2 . (s,(I1 \; I2)) )
then A10: [s,I1] in TerminatingPrograms (A,S,T,f1) by Th97;
A11: [(f1 . (s,I1)),I2] in TerminatingPrograms (A,S,T,f1) by A9, Th97;
A12: [s,I1] in TerminatingPrograms (A,S,T,f2) by A7, A10;
A13: [(f1 . (s,I1)),I2] in TerminatingPrograms (A,S,T,f2) by A8, A11;
A14: f1 . (s,I1) = f2 . (s,I1) by A7, A10;
A15: f1 . ((f1 . (s,I1)),I2) = f2 . ((f1 . (s,I1)),I2) by A8, A11;
f1 . ((f1 . (s,I1)),I2) = f1 . (s,(I1 \; I2)) by Def29;
hence ( [s,(I1 \; I2)] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(I1 \; I2)) = f2 . (s,(I1 \; I2)) ) by A12, A13, A14, A15, Def29, Def35; ::_thesis: verum
end;
A16: for C, I1, I2 being Element of A st S1[C] & S1[I1] & S1[I2] holds
S1[ if-then-else (C,I1,I2)]
proof
let C, I1, I2 be Element of A; ::_thesis: ( S1[C] & S1[I1] & S1[I2] implies S1[ if-then-else (C,I1,I2)] )
assume that
A17: S1[C] and
A18: S1[I1] and
A19: S1[I2] ; ::_thesis: S1[ if-then-else (C,I1,I2)]
A20: f1 complies_with_if_wrt T by Def32;
A21: f2 complies_with_if_wrt T by Def32;
set J = if-then-else (C,I1,I2);
let s be Element of S; ::_thesis: ( [s,(if-then-else (C,I1,I2))] in TerminatingPrograms (A,S,T,f1) implies ( [s,(if-then-else (C,I1,I2))] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(if-then-else (C,I1,I2))) = f2 . (s,(if-then-else (C,I1,I2))) ) )
assume A22: [s,(if-then-else (C,I1,I2))] in TerminatingPrograms (A,S,T,f1) ; ::_thesis: ( [s,(if-then-else (C,I1,I2))] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(if-then-else (C,I1,I2))) = f2 . (s,(if-then-else (C,I1,I2))) )
then A23: [s,C] in TerminatingPrograms (A,S,T,f1) by Th98;
A24: ( f1 . (s,C) in T implies [(f1 . (s,C)),I1] in TerminatingPrograms (A,S,T,f1) ) by A22, Th98;
A25: ( f1 . (s,C) nin T implies [(f1 . (s,C)),I2] in TerminatingPrograms (A,S,T,f1) ) by A22, Th98;
A26: [s,C] in TerminatingPrograms (A,S,T,f2) by A17, A23;
A27: f1 . (s,C) = f2 . (s,C) by A17, A23;
A28: ( f1 . (s,C) in T implies ( [(f1 . (s,C)),I1] in TerminatingPrograms (A,S,T,f2) & f1 . ((f1 . (s,C)),I1) = f2 . ((f1 . (s,C)),I1) & f1 . (s,(if-then-else (C,I1,I2))) = f1 . ((f1 . (s,C)),I1) ) ) by A18, A20, A24, Def30;
A29: ( f1 . (s,C) nin T implies ( [(f1 . (s,C)),I2] in TerminatingPrograms (A,S,T,f2) & f1 . ((f1 . (s,C)),I2) = f2 . ((f1 . (s,C)),I2) & f1 . (s,(if-then-else (C,I1,I2))) = f1 . ((f1 . (s,C)),I2) ) ) by A19, A20, A25, Def30;
( f1 . (s,C) in T or f1 . (s,C) nin T ) ;
hence ( [s,(if-then-else (C,I1,I2))] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(if-then-else (C,I1,I2))) = f2 . (s,(if-then-else (C,I1,I2))) ) by A21, A26, A27, A28, A29, Def30, Def35; ::_thesis: verum
end;
A30: for C, I being Element of A st S1[C] & S1[I] holds
S1[ while (C,I)]
proof
let C, I be Element of A; ::_thesis: ( S1[C] & S1[I] implies S1[ while (C,I)] )
assume that
A31: S1[C] and
A32: S1[I] ; ::_thesis: S1[ while (C,I)]
set J = while (C,I);
let s be Element of S; ::_thesis: ( [s,(while (C,I))] in TerminatingPrograms (A,S,T,f1) implies ( [s,(while (C,I))] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) )
assume A33: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f1) ; ::_thesis: ( [s,(while (C,I))] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) )
then A34: [s,C] in TerminatingPrograms (A,S,T,f1) by Th99;
then A35: [s,C] in TerminatingPrograms (A,S,T,f2) by A31;
A36: f1 . (s,C) = f2 . (s,C) by A31, A34;
consider r being non empty FinSequence of S such that
A37: r . 1 = f1 . (s,C) and
A38: r . (len r) nin T and
A39: for i being Nat st 1 <= i & i < len r holds
( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f1) & r . (i + 1) = f1 . ((r . i),(I \; C)) ) by A33, Th99;
for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f1 . ((r . i),(I \; C)) ) by A39;
then A40: f1 . (s,(while (C,I))) = r . (len r) by A37, A38, Th86;
defpred S2[ Nat] means ( 1 <= $1 & $1 < len r implies ( r . $1 in T & [(r . $1),(I \; C)] in TerminatingPrograms (A,S,T,f2) & r . ($1 + 1) = f2 . ((r . $1),(I \; C)) ) );
A41: for i being Nat holds S2[i]
proof
let i be Nat; ::_thesis: S2[i]
assume that
A42: 1 <= i and
A43: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f2) & r . (i + 1) = f2 . ((r . i),(I \; C)) )
thus A44: r . i in T by A39, A42, A43; ::_thesis: ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f2) & r . (i + 1) = f2 . ((r . i),(I \; C)) )
then reconsider ri = r . i as Element of S ;
A45: [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f1) by A39, A42, A43;
hence [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f2) by A6, A31, A32, A44; ::_thesis: r . (i + 1) = f2 . ((r . i),(I \; C))
A46: [ri,I] in TerminatingPrograms (A,S,T,f1) by A45, Th97;
A47: [(f1 . (ri,I)),C] in TerminatingPrograms (A,S,T,f1) by A45, Th97;
thus r . (i + 1) = f1 . ((r . i),(I \; C)) by A39, A42, A43
.= f1 . ((f1 . (ri,I)),C) by Def29
.= f2 . ((f1 . (ri,I)),C) by A31, A47
.= f2 . ((f2 . (ri,I)),C) by A32, A46
.= f2 . ((r . i),(I \; C)) by Def29 ; ::_thesis: verum
end;
then for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f2 . ((r . i),(I \; C)) ) ;
hence ( [s,(while (C,I))] in TerminatingPrograms (A,S,T,f2) & f1 . (s,(while (C,I))) = f2 . (s,(while (C,I))) ) by A35, A36, A37, A38, A40, A41, Def35, Th86; ::_thesis: verum
end;
let I be Element of A; ::_thesis: for s being Element of S st [s,I] in TerminatingPrograms (A,S,T,f1) holds
( [s,I] in TerminatingPrograms (A,S,T,f2) & f1 . (s,I) = f2 . (s,I) )
thus S1[I] from AOFA_000:sch_2(A2, A5, A6, A16, A30); ::_thesis: verum
end;
theorem :: AOFA_000:102
for S being non empty set
for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
TerminatingPrograms (A,S,T,f1) = TerminatingPrograms (A,S,T,f2)
proof
let S be non empty set ; ::_thesis: for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
TerminatingPrograms (A,S,T,f1) = TerminatingPrograms (A,S,T,f2)
let T be Subset of S; ::_thesis: for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
TerminatingPrograms (A,S,T,f1) = TerminatingPrograms (A,S,T,f2)
let A be free ECIW-strict preIfWhileAlgebra; ::_thesis: for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
TerminatingPrograms (A,S,T,f1) = TerminatingPrograms (A,S,T,f2)
let f1, f2 be ExecutionFunction of A,S,T; ::_thesis: ( f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] implies TerminatingPrograms (A,S,T,f1) = TerminatingPrograms (A,S,T,f2) )
assume A1: f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] ; ::_thesis: TerminatingPrograms (A,S,T,f1) = TerminatingPrograms (A,S,T,f2)
set TP1 = TerminatingPrograms (A,S,T,f1);
set TP2 = TerminatingPrograms (A,S,T,f2);
thus TerminatingPrograms (A,S,T,f1) c= TerminatingPrograms (A,S,T,f2) :: according to XBOOLE_0:def_10 ::_thesis: TerminatingPrograms (A,S,T,f2) c= TerminatingPrograms (A,S,T,f1)
proof
let q, I be set ; :: according to RELAT_1:def_3 ::_thesis: ( [q,I] nin TerminatingPrograms (A,S,T,f1) or not [q,I] nin TerminatingPrograms (A,S,T,f2) )
assume A2: [q,I] in TerminatingPrograms (A,S,T,f1) ; ::_thesis: not [q,I] nin TerminatingPrograms (A,S,T,f2)
then A3: q is Element of S by ZFMISC_1:87;
I is Element of A by A2, ZFMISC_1:87;
hence not [q,I] nin TerminatingPrograms (A,S,T,f2) by A1, A2, A3, Lm3; ::_thesis: verum
end;
let q, I be set ; :: according to RELAT_1:def_3 ::_thesis: ( [q,I] nin TerminatingPrograms (A,S,T,f2) or not [q,I] nin TerminatingPrograms (A,S,T,f1) )
assume A4: [q,I] in TerminatingPrograms (A,S,T,f2) ; ::_thesis: not [q,I] nin TerminatingPrograms (A,S,T,f1)
then A5: q is Element of S by ZFMISC_1:87;
I is Element of A by A4, ZFMISC_1:87;
hence not [q,I] nin TerminatingPrograms (A,S,T,f1) by A1, A4, A5, Lm3; ::_thesis: verum
end;
theorem :: AOFA_000:103
for S being non empty set
for T being Subset of S
for A being free ECIW-strict preIfWhileAlgebra
for f1, f2 being ExecutionFunction of A,S,T st f1 | [:S,(ElementaryInstructions A):] = f2 | [:S,(ElementaryInstructions A):] holds
for s being Element of S
for I being Element of A st [s,I] in TerminatingPrograms (A,S,T,f1) holds
f1 . (s,I) = f2 . (s,I) by Lm3;
theorem Th104: :: AOFA_000:104
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being absolutely-terminating Element of A holds I is_terminating_wrt f
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being absolutely-terminating Element of A holds I is_terminating_wrt f
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being absolutely-terminating Element of A holds I is_terminating_wrt f
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for I being absolutely-terminating Element of A holds I is_terminating_wrt f
let f be ExecutionFunction of A,S,T; ::_thesis: for I being absolutely-terminating Element of A holds I is_terminating_wrt f
let I be absolutely-terminating Element of A; ::_thesis: I is_terminating_wrt f
let s be Element of S; :: according to AOFA_000:def_37 ::_thesis: [s,I] in TerminatingPrograms (A,S,T,f)
thus [s,I] in TerminatingPrograms (A,S,T,f) by Def36; ::_thesis: verum
end;
theorem :: AOFA_000:105
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A holds
( I is_terminating_wrt f iff I is_terminating_wrt f,S )
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A holds
( I is_terminating_wrt f iff I is_terminating_wrt f,S )
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A holds
( I is_terminating_wrt f iff I is_terminating_wrt f,S )
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for I being Element of A holds
( I is_terminating_wrt f iff I is_terminating_wrt f,S )
let f be ExecutionFunction of A,S,T; ::_thesis: for I being Element of A holds
( I is_terminating_wrt f iff I is_terminating_wrt f,S )
let I be Element of A; ::_thesis: ( I is_terminating_wrt f iff I is_terminating_wrt f,S )
thus ( I is_terminating_wrt f implies I is_terminating_wrt f,S ) ::_thesis: ( I is_terminating_wrt f,S implies I is_terminating_wrt f )
proof
assume A1: for s being Element of S holds [s,I] in TerminatingPrograms (A,S,T,f) ; :: according to AOFA_000:def_37 ::_thesis: I is_terminating_wrt f,S
let s be Element of S; :: according to AOFA_000:def_38 ::_thesis: ( s in S implies [s,I] in TerminatingPrograms (A,S,T,f) )
thus ( s in S implies [s,I] in TerminatingPrograms (A,S,T,f) ) by A1; ::_thesis: verum
end;
assume A2: for s being Element of S st s in S holds
[s,I] in TerminatingPrograms (A,S,T,f) ; :: according to AOFA_000:def_38 ::_thesis: I is_terminating_wrt f
let s be Element of S; :: according to AOFA_000:def_37 ::_thesis: [s,I] in TerminatingPrograms (A,S,T,f)
thus [s,I] in TerminatingPrograms (A,S,T,f) by A2; ::_thesis: verum
end;
theorem Th106: :: AOFA_000:106
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A st I is_terminating_wrt f holds
for P being set holds I is_terminating_wrt f,P
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A st I is_terminating_wrt f holds
for P being set holds I is_terminating_wrt f,P
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A st I is_terminating_wrt f holds
for P being set holds I is_terminating_wrt f,P
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for I being Element of A st I is_terminating_wrt f holds
for P being set holds I is_terminating_wrt f,P
let f be ExecutionFunction of A,S,T; ::_thesis: for I being Element of A st I is_terminating_wrt f holds
for P being set holds I is_terminating_wrt f,P
let I be Element of A; ::_thesis: ( I is_terminating_wrt f implies for P being set holds I is_terminating_wrt f,P )
assume A1: for s being Element of S holds [s,I] in TerminatingPrograms (A,S,T,f) ; :: according to AOFA_000:def_37 ::_thesis: for P being set holds I is_terminating_wrt f,P
let P be set ; ::_thesis: I is_terminating_wrt f,P
let s be Element of S; :: according to AOFA_000:def_38 ::_thesis: ( s in P implies [s,I] in TerminatingPrograms (A,S,T,f) )
thus ( s in P implies [s,I] in TerminatingPrograms (A,S,T,f) ) by A1; ::_thesis: verum
end;
theorem :: AOFA_000:107
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being absolutely-terminating Element of A
for P being set holds I is_terminating_wrt f,P by Th104, Th106;
theorem :: AOFA_000:108
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A holds S is_invariant_wrt I,f
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A holds S is_invariant_wrt I,f
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for I being Element of A holds S is_invariant_wrt I,f
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for I being Element of A holds S is_invariant_wrt I,f
let f be ExecutionFunction of A,S,T; ::_thesis: for I being Element of A holds S is_invariant_wrt I,f
let I be Element of A; ::_thesis: S is_invariant_wrt I,f
let s be Element of S; :: according to AOFA_000:def_39 ::_thesis: ( s in S implies f . (s,I) in S )
thus ( s in S implies f . (s,I) in S ) ; ::_thesis: verum
end;
theorem :: AOFA_000:109
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st P is_invariant_wrt I,f & P is_invariant_wrt J,f holds
P is_invariant_wrt I \; J,f
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st P is_invariant_wrt I,f & P is_invariant_wrt J,f holds
P is_invariant_wrt I \; J,f
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st P is_invariant_wrt I,f & P is_invariant_wrt J,f holds
P is_invariant_wrt I \; J,f
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st P is_invariant_wrt I,f & P is_invariant_wrt J,f holds
P is_invariant_wrt I \; J,f
let f be ExecutionFunction of A,S,T; ::_thesis: for P being set
for I, J being Element of A st P is_invariant_wrt I,f & P is_invariant_wrt J,f holds
P is_invariant_wrt I \; J,f
let P be set ; ::_thesis: for I, J being Element of A st P is_invariant_wrt I,f & P is_invariant_wrt J,f holds
P is_invariant_wrt I \; J,f
let I, J be Element of A; ::_thesis: ( P is_invariant_wrt I,f & P is_invariant_wrt J,f implies P is_invariant_wrt I \; J,f )
assume that
A1: for s being Element of S st s in P holds
f . (s,I) in P and
A2: for s being Element of S st s in P holds
f . (s,J) in P ; :: according to AOFA_000:def_39 ::_thesis: P is_invariant_wrt I \; J,f
let s be Element of S; :: according to AOFA_000:def_39 ::_thesis: ( s in P implies f . (s,(I \; J)) in P )
assume s in P ; ::_thesis: f . (s,(I \; J)) in P
then A3: f . (s,I) in P by A1;
f . (s,(I \; J)) = f . ((f . (s,I)),J) by Def29;
hence f . (s,(I \; J)) in P by A2, A3; ::_thesis: verum
end;
theorem :: AOFA_000:110
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I, J being Element of A st I is_terminating_wrt f & J is_terminating_wrt f holds
I \; J is_terminating_wrt f
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for I, J being Element of A st I is_terminating_wrt f & J is_terminating_wrt f holds
I \; J is_terminating_wrt f
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for I, J being Element of A st I is_terminating_wrt f & J is_terminating_wrt f holds
I \; J is_terminating_wrt f
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for I, J being Element of A st I is_terminating_wrt f & J is_terminating_wrt f holds
I \; J is_terminating_wrt f
let f be ExecutionFunction of A,S,T; ::_thesis: for I, J being Element of A st I is_terminating_wrt f & J is_terminating_wrt f holds
I \; J is_terminating_wrt f
let I, J be Element of A; ::_thesis: ( I is_terminating_wrt f & J is_terminating_wrt f implies I \; J is_terminating_wrt f )
assume that
A1: for s being Element of S holds [s,I] in TerminatingPrograms (A,S,T,f) and
A2: for s being Element of S holds [s,J] in TerminatingPrograms (A,S,T,f) ; :: according to AOFA_000:def_37 ::_thesis: I \; J is_terminating_wrt f
let s be Element of S; :: according to AOFA_000:def_37 ::_thesis: [s,(I \; J)] in TerminatingPrograms (A,S,T,f)
A3: [s,I] in TerminatingPrograms (A,S,T,f) by A1;
[(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) by A2;
hence [s,(I \; J)] in TerminatingPrograms (A,S,T,f) by A3, Def35; ::_thesis: verum
end;
theorem :: AOFA_000:111
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt I,f holds
I \; J is_terminating_wrt f,P
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt I,f holds
I \; J is_terminating_wrt f,P
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt I,f holds
I \; J is_terminating_wrt f,P
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for P being set
for I, J being Element of A st I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt I,f holds
I \; J is_terminating_wrt f,P
let f be ExecutionFunction of A,S,T; ::_thesis: for P being set
for I, J being Element of A st I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt I,f holds
I \; J is_terminating_wrt f,P
let P be set ; ::_thesis: for I, J being Element of A st I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt I,f holds
I \; J is_terminating_wrt f,P
let I, J be Element of A; ::_thesis: ( I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt I,f implies I \; J is_terminating_wrt f,P )
assume that
A1: for s being Element of S st s in P holds
[s,I] in TerminatingPrograms (A,S,T,f) and
A2: for s being Element of S st s in P holds
[s,J] in TerminatingPrograms (A,S,T,f) and
A3: for s being Element of S st s in P holds
f . (s,I) in P ; :: according to AOFA_000:def_38,AOFA_000:def_39 ::_thesis: I \; J is_terminating_wrt f,P
let s be Element of S; :: according to AOFA_000:def_38 ::_thesis: ( s in P implies [s,(I \; J)] in TerminatingPrograms (A,S,T,f) )
assume A4: s in P ; ::_thesis: [s,(I \; J)] in TerminatingPrograms (A,S,T,f)
then A5: [s,I] in TerminatingPrograms (A,S,T,f) by A1;
[(f . (s,I)),J] in TerminatingPrograms (A,S,T,f) by A2, A3, A4;
hence [s,(I \; J)] in TerminatingPrograms (A,S,T,f) by A5, Def35; ::_thesis: verum
end;
theorem :: AOFA_000:112
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for C, I, J being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & J is_terminating_wrt f holds
if-then-else (C,I,J) is_terminating_wrt f
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for C, I, J being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & J is_terminating_wrt f holds
if-then-else (C,I,J) is_terminating_wrt f
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for C, I, J being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & J is_terminating_wrt f holds
if-then-else (C,I,J) is_terminating_wrt f
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for C, I, J being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & J is_terminating_wrt f holds
if-then-else (C,I,J) is_terminating_wrt f
let f be ExecutionFunction of A,S,T; ::_thesis: for C, I, J being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & J is_terminating_wrt f holds
if-then-else (C,I,J) is_terminating_wrt f
let C, I, J be Element of A; ::_thesis: ( C is_terminating_wrt f & I is_terminating_wrt f & J is_terminating_wrt f implies if-then-else (C,I,J) is_terminating_wrt f )
assume that
A1: for s being Element of S holds [s,C] in TerminatingPrograms (A,S,T,f) and
A2: for s being Element of S holds [s,I] in TerminatingPrograms (A,S,T,f) and
A3: for s being Element of S holds [s,J] in TerminatingPrograms (A,S,T,f) ; :: according to AOFA_000:def_37 ::_thesis: if-then-else (C,I,J) is_terminating_wrt f
let s be Element of S; :: according to AOFA_000:def_37 ::_thesis: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f)
A4: ( f . (s,C) in T or f . (s,C) nin T ) ;
A5: [s,C] in TerminatingPrograms (A,S,T,f) by A1;
A6: [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) by A2;
[(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) by A3;
hence [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) by A4, A5, A6, Def35; ::_thesis: verum
end;
theorem :: AOFA_000:113
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I, J being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt C,f holds
if-then-else (C,I,J) is_terminating_wrt f,P
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I, J being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt C,f holds
if-then-else (C,I,J) is_terminating_wrt f,P
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I, J being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt C,f holds
if-then-else (C,I,J) is_terminating_wrt f,P
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for P being set
for C, I, J being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt C,f holds
if-then-else (C,I,J) is_terminating_wrt f,P
let f be ExecutionFunction of A,S,T; ::_thesis: for P being set
for C, I, J being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt C,f holds
if-then-else (C,I,J) is_terminating_wrt f,P
let P be set ; ::_thesis: for C, I, J being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt C,f holds
if-then-else (C,I,J) is_terminating_wrt f,P
let C, I, J be Element of A; ::_thesis: ( C is_terminating_wrt f,P & I is_terminating_wrt f,P & J is_terminating_wrt f,P & P is_invariant_wrt C,f implies if-then-else (C,I,J) is_terminating_wrt f,P )
assume that
A1: for s being Element of S st s in P holds
[s,C] in TerminatingPrograms (A,S,T,f) and
A2: for s being Element of S st s in P holds
[s,I] in TerminatingPrograms (A,S,T,f) and
A3: for s being Element of S st s in P holds
[s,J] in TerminatingPrograms (A,S,T,f) and
A4: for s being Element of S st s in P holds
f . (s,C) in P ; :: according to AOFA_000:def_38,AOFA_000:def_39 ::_thesis: if-then-else (C,I,J) is_terminating_wrt f,P
let s be Element of S; :: according to AOFA_000:def_38 ::_thesis: ( s in P implies [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) )
assume A5: s in P ; ::_thesis: [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f)
A6: ( f . (s,C) in T or f . (s,C) nin T ) ;
A7: [s,C] in TerminatingPrograms (A,S,T,f) by A1, A5;
A8: [(f . (s,C)),I] in TerminatingPrograms (A,S,T,f) by A2, A4, A5;
[(f . (s,C)),J] in TerminatingPrograms (A,S,T,f) by A3, A4, A5;
hence [s,(if-then-else (C,I,J))] in TerminatingPrograms (A,S,T,f) by A6, A7, A8, Def35; ::_thesis: verum
end;
theorem Th114: :: AOFA_000:114
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & f iteration_terminates_for I \; C,f . (s,C) holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let C, I be Element of A; ::_thesis: ( C is_terminating_wrt f & I is_terminating_wrt f & f iteration_terminates_for I \; C,f . (s,C) implies [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
assume that
A1: C is_terminating_wrt f and
A2: I is_terminating_wrt f ; ::_thesis: ( not f iteration_terminates_for I \; C,f . (s,C) or [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
given r being non empty FinSequence of S such that A3: r . 1 = f . (s,C) and
A4: r . (len r) nin T and
A5: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ; :: according to AOFA_000:def_33 ::_thesis: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
A6: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) )
assume that
A7: 1 <= i and
A8: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
thus r . i in T by A5, A7, A8; ::_thesis: ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
then reconsider s = r . i as Element of S ;
A9: [s,I] in TerminatingPrograms (A,S,T,f) by A2, Def37;
[(f . (s,I)),C] in TerminatingPrograms (A,S,T,f) by A1, Def37;
hence ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) by A5, A7, A8, A9, Def35; ::_thesis: verum
end;
[s,C] in TerminatingPrograms (A,S,T,f) by A1, Def37;
hence [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A3, A4, A6, Def35; ::_thesis: verum
end;
theorem :: AOFA_000:115
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: for P being set
for C, I being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let P be set ; ::_thesis: for C, I being Element of A st C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let C, I be Element of A; ::_thesis: ( C is_terminating_wrt f,P & I is_terminating_wrt f,P & P is_invariant_wrt C,f & P is_invariant_wrt I,f & f iteration_terminates_for I \; C,f . (s,C) & s in P implies [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
assume that
A1: C is_terminating_wrt f,P and
A2: I is_terminating_wrt f,P and
A3: P is_invariant_wrt C,f and
A4: P is_invariant_wrt I,f ; ::_thesis: ( not f iteration_terminates_for I \; C,f . (s,C) or not s in P or [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
given r being non empty FinSequence of S such that A5: r . 1 = f . (s,C) and
A6: r . (len r) nin T and
A7: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ; :: according to AOFA_000:def_33 ::_thesis: ( not s in P or [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
assume A8: s in P ; ::_thesis: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
defpred S1[ Nat] means ( $1 < len r implies r . ($1 + 1) in P );
A9: S1[ 0 ] by A3, A5, A8, Def39;
A10: for i being Nat st S1[i] holds
S1[i + 1]
proof
let i be Nat; ::_thesis: ( S1[i] implies S1[i + 1] )
assume that
A11: S1[i] and
A12: i + 1 < len r ; ::_thesis: r . ((i + 1) + 1) in P
A13: i + 1 >= 1 by NAT_1:11;
then A14: r . (i + 1) in T by A7, A12;
A15: r . ((i + 1) + 1) = f . ((r . (i + 1)),(I \; C)) by A7, A12, A13;
reconsider s = r . (i + 1) as Element of S by A14;
f . (s,I) in P by A4, A11, A12, Def39, NAT_1:13;
then f . ((f . (s,I)),C) in P by A3, Def39;
hence r . ((i + 1) + 1) in P by A15, Def29; ::_thesis: verum
end;
A16: for i being Nat holds S1[i] from NAT_1:sch_2(A9, A10);
A17: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) )
assume that
A18: 1 <= i and
A19: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
thus r . i in T by A7, A18, A19; ::_thesis: ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
then reconsider s = r . i as Element of S ;
A20: i -' 1 <= i by NAT_D:35;
A21: i = (i -' 1) + 1 by A18, XREAL_1:235;
i -' 1 < len r by A19, A20, XXREAL_0:2;
then A22: s in P by A16, A21;
then A23: [s,I] in TerminatingPrograms (A,S,T,f) by A2, Def38;
f . (s,I) in P by A4, A22, Def39;
then [(f . (s,I)),C] in TerminatingPrograms (A,S,T,f) by A1, Def38;
hence ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) by A7, A18, A19, A23, Def35; ::_thesis: verum
end;
[s,C] in TerminatingPrograms (A,S,T,f) by A1, A8, Def38;
hence [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A5, A6, A17, Def35; ::_thesis: verum
end;
theorem Th116: :: AOFA_000:116
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let S be non empty set ; ::_thesis: for T being Subset of S
for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let T be Subset of S; ::_thesis: for s being Element of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let s be Element of S; ::_thesis: for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let f be ExecutionFunction of A,S,T; ::_thesis: for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let P be set ; ::_thesis: for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P holds
[s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
let C, I be Element of A; ::_thesis: ( C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & f iteration_terminates_for I \; C,f . (s,C) & s in P implies [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
assume that
A1: C is_terminating_wrt f and
A2: I is_terminating_wrt f,P and
A3: P is_invariant_wrt C,f and
A4: for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ; ::_thesis: ( not f iteration_terminates_for I \; C,f . (s,C) or not s in P or [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
given r being non empty FinSequence of S such that A5: r . 1 = f . (s,C) and
A6: r . (len r) nin T and
A7: for i being Nat st 1 <= i & i < len r holds
( r . i in T & r . (i + 1) = f . ((r . i),(I \; C)) ) ; :: according to AOFA_000:def_33 ::_thesis: ( not s in P or [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
assume A8: s in P ; ::_thesis: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
defpred S1[ Nat] means ( $1 + 1 < len r implies r . ($1 + 1) in P );
A9: S1[ 0 ] by A3, A5, A8, Def39;
A10: for i being Nat st S1[i] holds
S1[i + 1]
proof
let i be Nat; ::_thesis: ( S1[i] implies S1[i + 1] )
assume that
A11: S1[i] and
A12: (i + 1) + 1 < len r ; ::_thesis: r . ((i + 1) + 1) in P
A13: i + 1 >= 1 by NAT_1:11;
A14: (i + 1) + 1 >= 1 by NAT_1:11;
A15: i + 1 < len r by A12, NAT_1:13;
then A16: r . (i + 1) in T by A7, A13;
A17: r . ((i + 1) + 1) in T by A7, A12, A14;
A18: r . ((i + 1) + 1) = f . ((r . (i + 1)),(I \; C)) by A7, A13, A15;
reconsider s = r . (i + 1) as Element of S by A16;
f . ((f . (s,I)),C) in T by A17, A18, Def29;
then f . (s,I) in P by A4, A11, A12, NAT_1:13;
then f . ((f . (s,I)),C) in P by A3, Def39;
hence r . ((i + 1) + 1) in P by A18, Def29; ::_thesis: verum
end;
A19: for i being Nat holds S1[i] from NAT_1:sch_2(A9, A10);
A20: now__::_thesis:_for_i_being_Nat_st_1_<=_i_&_i_<_len_r_holds_
(_r_._i_in_T_&_[(r_._i),(I_\;_C)]_in_TerminatingPrograms_(A,S,T,f)_&_r_._(i_+_1)_=_f_._((r_._i),(I_\;_C))_)
let i be Nat; ::_thesis: ( 1 <= i & i < len r implies ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) )
assume that
A21: 1 <= i and
A22: i < len r ; ::_thesis: ( r . i in T & [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
thus r . i in T by A7, A21, A22; ::_thesis: ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) )
then reconsider s = r . i as Element of S ;
i = (i -' 1) + 1 by A21, XREAL_1:235;
then s in P by A19, A22;
then A23: [s,I] in TerminatingPrograms (A,S,T,f) by A2, Def38;
[(f . (s,I)),C] in TerminatingPrograms (A,S,T,f) by A1, Def37;
hence ( [(r . i),(I \; C)] in TerminatingPrograms (A,S,T,f) & r . (i + 1) = f . ((r . i),(I \; C)) ) by A7, A21, A22, A23, Def35; ::_thesis: verum
end;
[s,C] in TerminatingPrograms (A,S,T,f) by A1, Def37;
hence [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A5, A6, A20, Def35; ::_thesis: verum
end;
theorem :: AOFA_000:117
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & ( for s being Element of S holds f iteration_terminates_for I \; C,s ) holds
while (C,I) is_terminating_wrt f
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & ( for s being Element of S holds f iteration_terminates_for I \; C,s ) holds
while (C,I) is_terminating_wrt f
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & ( for s being Element of S holds f iteration_terminates_for I \; C,s ) holds
while (C,I) is_terminating_wrt f
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & ( for s being Element of S holds f iteration_terminates_for I \; C,s ) holds
while (C,I) is_terminating_wrt f
let f be ExecutionFunction of A,S,T; ::_thesis: for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f & ( for s being Element of S holds f iteration_terminates_for I \; C,s ) holds
while (C,I) is_terminating_wrt f
let C, I be Element of A; ::_thesis: ( C is_terminating_wrt f & I is_terminating_wrt f & ( for s being Element of S holds f iteration_terminates_for I \; C,s ) implies while (C,I) is_terminating_wrt f )
assume that
A1: C is_terminating_wrt f and
A2: I is_terminating_wrt f and
A3: for s being Element of S holds f iteration_terminates_for I \; C,s ; ::_thesis: while (C,I) is_terminating_wrt f
let s be Element of S; :: according to AOFA_000:def_37 ::_thesis: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
f iteration_terminates_for I \; C,f . (s,C) by A3;
hence [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A1, A2, Th114; ::_thesis: verum
end;
theorem :: AOFA_000:118
for A being preIfWhileAlgebra
for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & ( for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ) holds
while (C,I) is_terminating_wrt f,P
proof
let A be preIfWhileAlgebra; ::_thesis: for S being non empty set
for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & ( for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ) holds
while (C,I) is_terminating_wrt f,P
let S be non empty set ; ::_thesis: for T being Subset of S
for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & ( for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ) holds
while (C,I) is_terminating_wrt f,P
let T be Subset of S; ::_thesis: for f being ExecutionFunction of A,S,T
for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & ( for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ) holds
while (C,I) is_terminating_wrt f,P
let f be ExecutionFunction of A,S,T; ::_thesis: for P being set
for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & ( for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ) holds
while (C,I) is_terminating_wrt f,P
let P be set ; ::_thesis: for C, I being Element of A st C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & ( for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ) holds
while (C,I) is_terminating_wrt f,P
let C, I be Element of A; ::_thesis: ( C is_terminating_wrt f & I is_terminating_wrt f,P & P is_invariant_wrt C,f & ( for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P ) & ( for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ) implies while (C,I) is_terminating_wrt f,P )
assume that
A1: C is_terminating_wrt f and
A2: I is_terminating_wrt f,P and
A3: P is_invariant_wrt C,f and
A4: for s being Element of S st s in P & f . ((f . (s,I)),C) in T holds
f . (s,I) in P and
A5: for s being Element of S st f . (s,C) in P holds
f iteration_terminates_for I \; C,f . (s,C) ; ::_thesis: while (C,I) is_terminating_wrt f,P
let s be Element of S; :: according to AOFA_000:def_38 ::_thesis: ( s in P implies [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) )
assume A6: s in P ; ::_thesis: [s,(while (C,I))] in TerminatingPrograms (A,S,T,f)
then f . (s,C) in P by A3, Def39;
hence [s,(while (C,I))] in TerminatingPrograms (A,S,T,f) by A1, A2, A3, A4, A5, A6, Th116; ::_thesis: verum
end;