:: AMISTD_2 semantic presentation

E1: for b1 being Relation holds
not ( dom b1 <> {} & not b1 <> {} )
by RELAT_1:60;

registration
let c1 be Function;
let c2 be non empty Function;
cluster a1 +* a2 -> non empty ;
coherence
not c1 +* c2 is empty
proof
dom (c1 +* c2) = (dom c1) \/ (dom c2) by FUNCT_4:def 1;
hence not c1 +* c2 is empty by E1;
end;
cluster a2 +* a1 -> non empty ;
coherence
not c2 +* c1 is empty
proof
dom (c2 +* c1) = (dom c2) \/ (dom c1) by FUNCT_4:def 1;
hence not c2 +* c1 is empty by E1;
end;
end;

registration
let c1, c2 be finite Function;
cluster a1 +* a2 -> finite ;
coherence
c1 +* c2 is finite
proof
dom (c1 +* c2) = (dom c1) \/ (dom c2) by FUNCT_4:def 1;
hence c1 +* c2 is finite by FINSET_1:29;
end;
end;

theorem E2: :: AMISTD_2:1
for b1, b2 being Function holds
( dom b1, dom b2 are_equipotent iff b1,b2 are_equipotent )
proof
let c1, c2 be Function;
E3: ( Card c1 = Card (dom c1) & Card c2 = Card (dom c2) ) by PRE_CIRC:21;
hereby
assume dom c1, dom c2 are_equipotent ;
then Card (dom c1) = Card (dom c2) by CARD_1:21;
hence c1,c2 are_equipotent by E3, CARD_1:21;
end; assume c1,c2 are_equipotent ;
then Card c1 = Card c2 by CARD_1:21;
hence dom c1, dom c2 are_equipotent by E3, CARD_1:21;
end;

theorem E3: :: AMISTD_2:2
for b1, b2 being finite Function holds
( dom b1 misses dom b2 implies card (b1 +* b2) = (card b1) + (card b2) )
proof
let c1, c2 be finite Function;
assume E4: dom c1 misses dom c2 ;
thus card (c1 +* c2) = card (dom (c1 +* c2)) by PRE_CIRC:21
.= card ((dom c1) \/ (dom c2)) by FUNCT_4:def 1
.= (card (dom c1)) + (card (dom c2)) by E4, CARD_2:53
.= (card (dom c1)) + (card c2) by PRE_CIRC:21
.= (card c1) + (card c2) by PRE_CIRC:21 ;
end;

registration
let c1 be Function;
let c2 be set ;
cluster a1 \ a2 -> Relation-like Function-like ;
coherence
( c1 \ c2 is Function-like & c1 \ c2 is Relation-like )
by GRFUNC_1:38;
end;

theorem E4: :: AMISTD_2:3
for b1 being set
for b2, b3 being Function holds
( b1 in (dom b2) \ (dom b3) implies (b2 \ b3) . b1 = b2 . b1 )
proof
let c1 be set ;
let c2, c3 be Function;
assume E5: c1 in (dom c2) \ (dom c3) ;
E6: (dom c2) \ (dom c3) c= dom (c2 \ c3) by RELAT_1:15;
c2 \ c3 c= c2 by XBOOLE_1:36;
hence (c2 \ c3) . c1 = c2 . c1 by E5, E6, GRFUNC_1:8;
end;

theorem E5: :: AMISTD_2:4
for b1 being non empty finite set holds (card b1) - 1 = (card b1) -' 1
proof
let c1 be non empty finite set ;
card c1 <> 0 by CARD_2:59;
then card c1 >= 1 by NAT_1:39;
then (card c1) - 1 >= 0 by XREAL_1:50;
hence (card c1) - 1 = (card c1) -' 1 by BINARITH:def 3;
end;

definition
let c1 be functional set ;
func PA a1 -> Function means :E6: :: AMISTD_2:def 1
( for b1 being set holds
( b1 in dom a2 iff for b2 being Function holds
( b2 in a1 implies b1 in dom b2 ) ) & for b1 being set holds
( b1 in dom a2 implies a2 . b1 = pi a1,b1 ) ) if not a1 is empty
otherwise a2 = {} ;
existence
( not ( not c1 is empty & for b1 being Function holds
not ( for b2 being set holds
( b2 in dom b1 iff for b3 being Function holds
( b3 in c1 implies b2 in dom b3 ) ) & for b2 being set holds
( b2 in dom b1 implies b1 . b2 = pi c1,b2 ) ) ) & not ( c1 is empty & for b1 being Function holds
not b1 = {} ) )
proof
thus not ( not c1 is empty & for b1 being Function holds
not ( for b2 being set holds
( b2 in dom b1 iff for b3 being Function holds
( b3 in c1 implies b2 in dom b3 ) ) & for b2 being set holds
( b2 in dom b1 implies b1 . b2 = pi c1,b2 ) ) )
proof
assume not c1 is empty ;
then reconsider c2 = c1 as non empty functional set ;
set c3 = { (dom b1) where B is Element of c2 : verum } ;
defpred S1[ set , set ] means a2 = pi c1,a1;
E6: for b1 being set holds
not ( b1 in meet { (dom b2) where B is Element of c2 : verum } & for b2 being set holds
not S1[b1,b2] ) ;
consider c4 being Function such that
E7: dom c4 = meet { (dom b1) where B is Element of c2 : verum }
and E8: for b1 being set holds
( b1 in meet { (dom b2) where B is Element of c2 : verum } implies S1[b1,c4 . b1] ) from ZFREFLE1:sch 1(E6);
take c4 ;
hereby
let c5 be set ;
hereby
assume E9: c5 in dom c4 ;
let c6 be Function;
assume c6 in c1 ;
then dom c6 in { (dom b1) where B is Element of c2 : verum } ;
hence c5 in dom c6 by E7, E9, SETFAM_1:def 1;
end;assume E9: for b1 being Function holds
( b1 in c1 implies c5 in dom b1 ) ;
consider c6 being Element of c2;
E10: dom c6 in { (dom b1) where B is Element of c2 : verum } ;
for b1 being set holds
( b1 in { (dom b2) where B is Element of c2 : verum } implies c5 in b1 )
proof
let c7 be set ;
assume c7 in { (dom b1) where B is Element of c2 : verum } ;
then ex b1 being Element of c2 st c7 = dom b1 ;
hence c5 in c7 by E9;
end;
hence c5 in dom c4 by E7, E10, SETFAM_1:def 1;
end; thus for b1 being set holds
( b1 in dom c4 implies c4 . b1 = pi c1,b1 ) by E7, E8;
end;
thus not ( c1 is empty & for b1 being Function holds
not b1 = {} ) ;
end;
uniqueness
for b1, b2 being Function holds
( ( ( for b3 being set holds
( b3 in dom b1 iff for b4 being Function holds
( b4 in c1 implies b3 in dom b4 ) ) & for b3 being set holds
( b3 in dom b1 implies b1 . b3 = pi c1,b3 ) & for b3 being set holds
( b3 in dom b2 iff for b4 being Function holds
( b4 in c1 implies b3 in dom b4 ) ) & for b3 being set holds
( b3 in dom b2 implies b2 . b3 = pi c1,b3 ) ) implies ( c1 is empty or b1 = b2 ) ) & ( ( c1 is empty & b1 = {} & b2 = {} ) implies ( b1 = b2 ) ) )
proof
let c2, c3 be Function;
thus ( ( for b1 being set holds
( b1 in dom c2 iff for b2 being Function holds
( b2 in c1 implies b1 in dom b2 ) ) & for b1 being set holds
( b1 in dom c2 implies c2 . b1 = pi c1,b1 ) & for b1 being set holds
( b1 in dom c3 iff for b2 being Function holds
( b2 in c1 implies b1 in dom b2 ) ) & for b1 being set holds
( b1 in dom c3 implies c3 . b1 = pi c1,b1 ) ) implies ( c1 is empty or c2 = c3 ) )
proof
defpred S1[ set ] means for b1 being Function holds
( b1 in c1 implies a1 in dom b1 );
assume that not c1 is empty
and E6: for b1 being set holds
( b1 in dom c2 iff S1[b1] )
and E7: for b1 being set holds
( b1 in dom c2 implies c2 . b1 = pi c1,b1 )
and E8: for b1 being set holds
( b1 in dom c3 iff S1[b1] )
and E9: for b1 being set holds
( b1 in dom c3 implies c3 . b1 = pi c1,b1 ) ;
E10: dom c2 = dom c3 from XBOOLE_0:sch 2(E6, E8);
now
let c4 be set ;
assume E11: c4 in dom c2 ;
hence c2 . c4 = pi c1,c4 by E7
.= c3 . c4 by E9, E10, E11 ;

end;
hence c2 = c3 by E10, FUNCT_1:9;
end;
thus ( ( c1 is empty & c2 = {} & c3 = {} ) implies ( c2 = c3 ) ) ;
end;
consistency
for b1 being Function holds
verum
;
end;

:: deftheorem E6 defines PA AMISTD_2:def 1 :
for b1 being functional set
for b2 being Function holds
( ( not b1 is empty implies ( b2 = PA b1 iff ( for b3 being set holds
( b3 in dom b2 iff for b4 being Function holds
( b4 in b1 implies b3 in dom b4 ) ) & for b3 being set holds
( b3 in dom b2 implies b2 . b3 = pi b1,b3 ) ) ) ) & ( b1 is empty implies ( b2 = PA b1 iff b2 = {} ) ) );

theorem :: AMISTD_2:5
for b1 being non empty functional set holds dom (PA b1) = meet { (dom b2) where B is Element of b1 : verum }
proof
let c1 be non empty functional set ;
set c2 = { (dom b1) where B is Element of c1 : verum } ;
hereby :: uses TARSKI:def 3,XBOOLE_0:def 10
let c3 be set ;
assume E7: c3 in dom (PA c1) ;
consider c4 being Element of c1;
E8: dom c4 in { (dom b1) where B is Element of c1 : verum } ;
for b1 being set holds
( b1 in { (dom b2) where B is Element of c1 : verum } implies c3 in b1 )
proof
let c5 be set ;
assume c5 in { (dom b1) where B is Element of c1 : verum } ;
then ex b1 being Element of c1 st c5 = dom b1 ;
hence c3 in c5 by E7, E6;
end;
hence c3 in meet { (dom b1) where B is Element of c1 : verum } by E8, SETFAM_1:def 1;
end; let c3 be set ; :: uses TARSKI:def 3
assume E7: c3 in meet { (dom b1) where B is Element of c1 : verum } ;
for b1 being Function holds
( b1 in c1 implies c3 in dom b1 )
proof
let c4 be Function;
assume c4 in c1 ;
then dom c4 in { (dom b1) where B is Element of c1 : verum } ;
hence c3 in dom c4 by E7, SETFAM_1:def 1;
end;
hence c3 in dom (PA c1) by E6;
end;

theorem :: AMISTD_2:6
for b1 being non empty functional set
for b2 being set holds
( b2 in dom (PA b1) implies (PA b1) . b2 = { (b3 . b2) where B is Element of b1 : verum } )
proof
let c1 be non empty functional set ;
let c2 be set ;
assume E7: c2 in dom (PA c1) ;
hereby :: uses TARSKI:def 3,XBOOLE_0:def 10
let c3 be set ;
assume c3 in (PA c1) . c2 ;
then c3 in pi c1,c2 by E7, E6;
then ex b1 being Function st
( b1 in c1 & c3 = b1 . c2 ) by CARD_3:def 6;
hence c3 in { (b1 . c2) where B is Element of c1 : verum } ;
end; let c3 be set ; :: uses TARSKI:def 3
assume c3 in { (b1 . c2) where B is Element of c1 : verum } ;
then ex b1 being Element of c1 st c3 = b1 . c2 ;
then c3 in pi c1,c2 by CARD_3:def 6;
hence c3 in (PA c1) . c2 by E7, E6;
end;

definition
let c1 be set ;
attr a1 is product-like means :E7: :: AMISTD_2:def 2
ex b1 being Function st a1 = product b1;
end;

:: deftheorem E7 defines product-like AMISTD_2:def 2 :
for b1 being set holds
( b1 is product-like iff ex b2 being Function st b1 = product b2 );

registration
let c1 be Function;
cluster product a1 -> product-like ;
coherence
product c1 is product-like
by E7;
end;

registration
cluster product-like -> functional with_common_domain set ;
coherence
for b1 being set holds
( b1 is product-like implies ( b1 is functional & b1 is with_common_domain ) )
proof
let c1 be set ;
given c2 being Function such that E8: c1 = product c2 ; :: uses AMISTD_2:def 2
thus c1 is functional by E8;
let c3, c4 be Function; :: uses PRALG_2:def 1
assume that E9: c3 in c1
and E10: c4 in c1 ;
thus dom c3 = dom c2 by E8, E9, CARD_3:18
.= dom c4 by E8, E10, CARD_3:18 ;
end;
end;

registration
cluster non empty functional with_common_domain product-like set ;
existence
ex b1 being set st
( b1 is product-like & not b1 is empty )
proof
consider c1 being with_non-empty_elements set , c2 being Function of 0,c1;
take product c2 ;
thus ( product c2 is product-like & not product c2 is empty ) ;
end;
end;

theorem E8: :: AMISTD_2:7
for b1 being functional with_common_domain set holds dom (PA b1) = DOM b1
proof
let c1 be functional with_common_domain set ;
per cases not ( not c1 is empty & c1 is empty ) ;
suppose E9: c1 is empty ;
hence dom (PA c1) = {} by E6, RELAT_1:60
.= DOM c1 by E9, PRALG_2:def 2 ;

end;
suppose E9: not c1 is empty ;
consider c2 being Element of c1;
hereby :: uses TARSKI:def 3,XBOOLE_0:def 10
let c3 be set ;
assume c3 in dom (PA c1) ;
then c3 in dom c2 by E9, E6;
hence c3 in DOM c1 by E9, PRALG_2:def 2;
end;let c3 be set ; :: uses TARSKI:def 3
assume c3 in DOM c1 ;
then for b1 being Function holds
( b1 in c1 implies c3 in dom b1 ) by PRALG_2:def 2;
hence c3 in dom (PA c1) by E9, E6;
end;
end;
end;

theorem :: AMISTD_2:8
for b1 being functional set
for b2 being set holds
( b2 in dom (PA b1) implies (PA b1) . b2 = pi b1,b2 )
proof
let c1 be functional set ;
let c2 be set ;
per cases not ( not c1 = {} & not c1 <> {} ) ;
suppose c1 = {} ;
then dom (PA c1) = dom {} by E6;
hence ( c2 in dom (PA c1) implies (PA c1) . c2 = pi c1,c2 ) ;
end;
suppose E9: c1 <> {} ;
assume c2 in dom (PA c1) ;
hence (PA c1) . c2 = pi c1,c2 by E9, E6;
end;
end;
end;

theorem E9: :: AMISTD_2:9
for b1 being functional with_common_domain set holds b1 c= product (PA b1)
proof
let c1 be functional with_common_domain set ;
let c2 be set ; :: uses TARSKI:def 3
assume E10: c2 in c1 ;
then reconsider c3 = c2 as Element of c1 ;
E11: dom c3 = DOM c1 by E10, PRALG_2:def 2
.= dom (PA c1) by E8 ;
for b1 being set holds
( b1 in dom (PA c1) implies c3 . b1 in (PA c1) . b1 )
proof
let c4 be set ;
assume c4 in dom (PA c1) ;
then (PA c1) . c4 = pi c1,c4 by E10, E6;
hence c3 . c4 in (PA c1) . c4 by E10, CARD_3:def 6;
end;
hence c2 in product (PA c1) by E11, CARD_3:18;
end;

theorem E10: :: AMISTD_2:10
for b1 being non empty product-like set holds b1 = product (PA b1)
proof
let c1 be non empty product-like set ;
thus c1 c= product (PA c1) by E9; :: uses XBOOLE_0:def 10
let c2 be set ; :: uses TARSKI:def 3
assume c2 in product (PA c1) ;
then consider c3 being Function such that
E11: c2 = c3
and E12: dom c3 = dom (PA c1)
and E13: for b1 being set holds
( b1 in dom (PA c1) implies c3 . b1 in (PA c1) . b1 ) by CARD_3:def 5;
consider c4 being Function such that
E14: c1 = product c4 by E7;
consider c5 being Element of c1;
E15: dom c3 = DOM c1 by E12, E8
.= dom c5 by PRALG_2:def 2
.= dom c4 by E14, CARD_3:18 ;
for b1 being set holds
( b1 in dom c4 implies c3 . b1 in c4 . b1 )
proof
let c6 be set ;
assume E16: c6 in dom c4 ;
then c3 . c6 in (PA c1) . c6 by E12, E13, E15;
then c3 . c6 in pi c1,c6 by E12, E15, E16, E6;
then ex b1 being Function st
( b1 in c1 & c3 . c6 = b1 . c6 ) by CARD_3:def 6;
hence c3 . c6 in c4 . c6 by E14, E16, CARD_3:18;
end;
hence c2 in c1 by E11, E14, E15, CARD_3:18;
end;

registration
let c1 be set ;
cluster -> functional FinSequenceSet of a1;
coherence
for b1 being FinSequenceSet of c1 holds b1 is functional
proof
let c2 be FinSequenceSet of c1;
let c3 be set ; :: uses FRAENKEL:def 1
thus ( c3 in c2 implies c3 is Function ) by FINSEQ_2:def 3;
end;
end;

registration
let c1 be Nat;
let c2 be set ;
cluster a1 -tuples_on a2 -> functional with_common_domain ;
coherence
c1 -tuples_on c2 is with_common_domain
proof
set c3 = c1 -tuples_on c2;
let c4, c5 be Function; :: uses PRALG_2:def 1
assume E11: ( c4 in c1 -tuples_on c2 & c5 in c1 -tuples_on c2 ) ;
c1 -tuples_on c2 = { b1 where B is Element of c2 * : len b1 = c1 } by FINSEQ_2:def 4;
then ( ex b1 being Element of c2 * st
( c4 = b1 & len b1 = c1 ) & ex b1 being Element of c2 * st
( c5 = b1 & len b1 = c1 ) ) by E11;
hence dom c4 = dom c5 by FINSEQ_3:31;
end;
end;

registration
let c1 be Nat;
let c2 be set ;
cluster a1 -tuples_on a2 -> functional with_common_domain product-like ;
coherence
c1 -tuples_on c2 is product-like
proof
set c3 = c1 -tuples_on c2;
per cases not ( not ( c2 = {} & c1 = 0 ) & not ( c2 = {} & c1 <> 0 ) & not c2 <> {} ) ;
suppose ( c2 = {} & c1 = 0 ) ;
then c1 -tuples_on c2 = {(<*> c2)} by FINSEQ_2:112
.= {{} } ;
hence c1 -tuples_on c2 is product-like by CARD_3:19;
end;
suppose ( c2 = {} & c1 <> 0 ) ;
then E11: c1 -tuples_on c2 = {} by CATALG_1:7;
take c4 = 0 .--> {} ; :: uses AMISTD_2:def 2
rng c4 = {{} } by CQC_LANG:5;
then {} in rng c4 by TARSKI:def 1;
hence c1 -tuples_on c2 = product c4 by E11, CARD_3:37;
end;
suppose c2 <> {} ;
then reconsider c4 = c2 as non empty set ;
set c5 = c1 -tuples_on c4;
take PA (c1 -tuples_on c4) ; :: uses AMISTD_2:def 2
c1 -tuples_on c4 = product (PA (c1 -tuples_on c4))
proof
thus c1 -tuples_on c4 c= product (PA (c1 -tuples_on c4)) by E9; :: uses XBOOLE_0:def 10
let c6 be set ; :: uses TARSKI:def 3
assume c6 in product (PA (c1 -tuples_on c4)) ;
then consider c7 being Function such that
E11: c6 = c7
and E12: dom c7 = dom (PA (c1 -tuples_on c4))
and E13: for b1 being set holds
( b1 in dom (PA (c1 -tuples_on c4)) implies c7 . b1 in (PA (c1 -tuples_on c4)) . b1 ) by CARD_3:def 5;
E14: c1 -tuples_on c4 = { b1 where B is Element of c4 * : len b1 = c1 } by FINSEQ_2:def 4;
consider c8 being Element of c1 -tuples_on c4;
c8 in c1 -tuples_on c4 ;
then consider c9 being Element of c4 * such that
E15: c8 = c9
and E16: len c9 = c1 by E14;
E17: dom c7 = DOM (c1 -tuples_on c4) by E12, E8
.= dom c8 by PRALG_2:def 2 ;
dom c8 = Seg (len c9) by E15, FINSEQ_1:def 3;
then E18: c7 is FinSequence by E17, FINSEQ_1:def 2;
rng c7 c= c4
proof
let c10 be set ; :: uses TARSKI:def 3
assume c10 in rng c7 ;
then consider c11 being set such that
E19: c11 in dom c7
and E20: c7 . c11 = c10 by FUNCT_1:def 5;
c7 . c11 in (PA (c1 -tuples_on c4)) . c11 by E12, E13, E19;
then c7 . c11 in pi (c1 -tuples_on c4),c11 by E12, E19, E6;
then consider c12 being Function such that
E21: c12 in c1 -tuples_on c4
and E22: c7 . c11 = c12 . c11 by CARD_3:def 6;
consider c13 being Element of c4 * such that
E23: c12 = c13
and len c13 = c1 by E14, E21;
E24: rng c13 c= c4 by FINSEQ_1:def 4;
dom c7 = dom c13 by E17, E21, E23, PRALG_2:def 1;
then c13 . c11 in rng c13 by E19, FUNCT_1:def 5;
hence c10 in c4 by E20, E22, E23, E24;
end;
then reconsider c10 = c7 as FinSequence of c4 by E18, FINSEQ_1:def 4;
E19: c10 in c4 * by FINSEQ_1:def 11;
len c10 = c1 by E15, E16, E17, FINSEQ_3:31;
hence c6 in c1 -tuples_on c4 by E11, E14, E19;
end;
hence c1 -tuples_on c2 = product (PA (c1 -tuples_on c4)) ;
end;
end;
end;
end;

E11: for b1 being natural number holds
- 1 < b1
proof
let c1 be natural number ;
( - 1 < 0 & 0 <= c1 ) ;
hence - 1 < c1 ;
end;

E12: for b1 being natural number
for b2, b3, b4 being Nat holds
not ( 1 <= b2 & 2 <= b3 & not b1 < b2 - 1 & not ( b2 <= b1 & b1 <= (b2 + b3) - 3 ) & not b1 = (b2 + b3) - 2 & not (b2 + b3) - 2 < b1 & not b1 = b2 - 1 )
proof
let c1 be natural number ;
let c2, c3, c4 be Nat;
assume that E13: 1 <= c2
and E14: 2 <= c3
and E15: c2 - 1 <= c1
and E16: not ( not c2 > c1 & not c1 > (c2 + c3) - 3 )
and E17: c1 <> (c2 + c3) - 2
and E18: c1 <= (c2 + c3) - 2 ;
E19: c2 - 1 is Nat by E13, INT_1:18;
now
per cases not ( not c1 < c2 & not (c2 + c3) - 3 < c1 ) by E16;
case c1 < c2 ;
then c1 < (c2 - 1) + 1 ;
hence c1 <= c2 - 1 by E19, NAT_1:38;
end;
case E20: (c2 + c3) - 3 < c1 ;
1 + 2 <= c2 + c3 by E13, E14, XREAL_1:9;
then E21: (c2 + c3) - 3 is Nat by INT_1:18;
c1 < ((c2 + c3) - 3) + 1 by E17, E18, REAL_1:def 5;
hence c1 <= c2 - 1 by E20, E21, NAT_1:38;
end;
end;
end;
hence c2 - 1 = c1 by E15, XREAL_1:1;
end;

theorem E13: :: AMISTD_2:11
for b1, b2 being set
for b3 being AMI-Struct of b2
for b4 being FinPartState of b3 holds
b4 \ b1 is FinPartState of b3
proof
let c1, c2 be set ;
let c3 be AMI-Struct of c2;
let c4 be FinPartState of c3;
c4 \ c1 c= c4 by XBOOLE_1:36;
then c4 \ c1 in sproduct the Object-Kind of c3 by AMI_1:40;
hence c4 \ c1 is FinPartState of c3 by AMI_1:def 24;
end;

theorem E14: :: AMISTD_2:12
for b1 being set
for b2 being with_non-empty_elements set
for b3 being non empty non void IC-Ins-separated definite AMI-Struct of b2
for b4 being programmed FinPartState of b3 holds
b4 \ b1 is programmed FinPartState of b3
proof
let c1 be set ;
let c2 be with_non-empty_elements set ;
let c3 be non empty non void IC-Ins-separated definite AMI-Struct of c2;
let c4 be programmed FinPartState of c3;
reconsider c5 = c4 \ c1 as FinPartState of c3 by E13;
per cases not ( not c5 is empty & c5 is empty ) ;
suppose c5 is empty ;
then reconsider c6 = c5 as empty FinPartState of c3 ;
c6 is programmed ;
hence c4 \ c1 is programmed FinPartState of c3 ;
end;
suppose not c5 is empty ;
then reconsider c6 = c5 as non empty FinPartState of c3 ;
c6 is programmed
proof
c6 c= c4 by XBOOLE_1:36;
then E15: dom c6 c= dom c4 by GRFUNC_1:8;
dom c4 c= the Instruction-Locations of c3 by AMI_3:def 13;
hence dom c6 c= the Instruction-Locations of c3 by E15, XBOOLE_1:1; :: uses AMI_3:def 13
end;
hence c4 \ c1 is programmed FinPartState of c3 ;
end;
end;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite AMI-Struct of c1;
let c3, c4 be Instruction-Location of c2;
let c5, c6 be Element of the Instructions of c2;
redefine func --> as a3,a4 --> a5,a6 -> FinPartState of a2;
coherence
c3,c4 --> c5,c6 is FinPartState of c2
proof
( ObjectKind c3 = the Instructions of c2 & ObjectKind c4 = the Instructions of c2 ) by AMI_1:def 14;
hence c3,c4 --> c5,c6 is FinPartState of c2 by AMI_1:58;
end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non void halting AMI-Struct of c1;
cluster halting Element of the Instructions of a2;
existence
ex b1 being Instruction of c2 st b1 is halting
proof
take halt c2 ;
thus halt c2 is halting ;
end;
end;

theorem E15: :: AMISTD_2:13
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being programmed lower FinPartState of b2
for b4 being programmed FinPartState of b2 holds
( dom b3 = dom b4 implies b4 is lower )
proof
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be programmed lower FinPartState of c2;
let c4 be programmed FinPartState of c2;
assume dom c3 = dom c4 ;
hence for b1 being Instruction-Location of c2 holds
( b1 in dom c4 implies for b2 being Instruction-Location of c2 holds
( b2 <= b1 implies b2 in dom c4 ) ) by AMISTD_1:def 20; :: uses AMISTD_1:def 20
end;

theorem E16: :: AMISTD_2:14
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being programmed lower FinPartState of b2
for b4 being Instruction-Location of b2 holds
not ( b4 in dom b3 & not locnum b4 < card b3 )
proof
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be programmed lower FinPartState of c2;
let c4 be Instruction-Location of c2;
assume E17: c4 in dom c3 ;
c4 = il. c2,(locnum c4) by AMISTD_1:def 13;
hence locnum c4 < card c3 by E17, AMISTD_1:50;
end;

theorem E17: :: AMISTD_2:15
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being programmed lower FinPartState of b2 holds dom b3 = { (il. b2,b4) where B is Nat : b4 < card b3 }
proof
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be programmed lower FinPartState of c2;
E18: dom c3 c= the Instruction-Locations of c2 by AMI_3:def 13;
hereby :: uses TARSKI:def 3,XBOOLE_0:def 10
let c4 be set ;
assume E19: c4 in dom c3 ;
then reconsider c5 = c4 as Instruction-Location of c2 by E18;
E20: locnum c5 < card c3 by E19, E16;
reconsider c6 = locnum c5 as Element of NAT ;
c5 = il. c2,c6 by AMISTD_1:def 13;
hence c4 in { (il. c2,b1) where B is Nat : b1 < card c3 } by E20;
end; let c4 be set ; :: uses TARSKI:def 3
assume c4 in { (il. c2,b1) where B is Nat : b1 < card c3 } ;
then ex b1 being Nat st
( c4 = il. c2,b1 & b1 < card c3 ) ;
hence c4 in dom c3 by AMISTD_1:50;
end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be Element of the Instructions of c2;
func AddressPart a3 -> set equals :: AMISTD_2:def 3
a3 `2 ;
coherence
c3 `2 is set
;
end;

:: deftheorem defines AddressPart AMISTD_2:def 3 :
for b1 being set
for b2 being AMI-Struct of b1
for b3 being Element of the Instructions of b2 holds AddressPart b3 = b3 `2 ;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be Element of the Instructions of c2;
redefine func AddressPart as AddressPart a3 -> FinSequence of (union a1) \/ the carrier of a2;
coherence
AddressPart c3 is FinSequence of (union c1) \/ the carrier of c2
proof
AddressPart c3 = c3 `2 ;
hence AddressPart c3 is FinSequence of (union c1) \/ the carrier of c2 by FINSEQ_1:def 11;
end;
end;

theorem E18: :: AMISTD_2:16
for b1 being set
for b2 being AMI-Struct of b1
for b3, b4 being Element of the Instructions of b2 holds
( ( InsCode b3 = InsCode b4 & AddressPart b3 = AddressPart b4 ) implies ( b3 = b4 ) )
proof
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3, c4 be Element of the Instructions of c2;
assume E19: ( InsCode c3 = InsCode c4 & AddressPart c3 = AddressPart c4 ) ;
( ex b1, b2 being set st
( b1 in the Instruction-Codes of c2 & b2 in ((union c1) \/ the carrier of c2) * & c3 = [b1,b2] ) & ex b1, b2 being set st
( b1 in the Instruction-Codes of c2 & b2 in ((union c1) \/ the carrier of c2) * & c4 = [b1,b2] ) ) by ZFMISC_1:def 2;
then E20: ( c3 = [(c3 `1 ),(c3 `2 )] & c4 = [(c4 `1 ),(c4 `2 )] ) by MCART_1:8;
( InsCode c3 = c3 `1 & InsCode c4 = c4 `1 & AddressPart c3 = c3 `2 & AddressPart c4 = c4 `2 ) by AMI_5:def 1;
hence c3 = c4 by E19, E20;
end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
attr a2 is homogeneous means :E19: :: AMISTD_2:def 4
for b1, b2 being Instruction of a2 holds
( InsCode b1 = InsCode b2 implies dom (AddressPart b1) = dom (AddressPart b2) );
end;

:: deftheorem E19 defines homogeneous AMISTD_2:def 4 :
for b1 being set
for b2 being AMI-Struct of b1 holds
( b2 is homogeneous iff for b3, b4 being Instruction of b2 holds
( InsCode b3 = InsCode b4 implies dom (AddressPart b3) = dom (AddressPart b4) ) );

theorem E20: :: AMISTD_2:17
for b1 being with_non-empty_elements set
for b2 being Instruction of (STC b1) holds AddressPart b2 = 0
proof
let c1 be with_non-empty_elements set ;
let c2 be Instruction of (STC c1);
the Instructions of (STC c1) = {[0,0],[1,0]} by AMISTD_1:def 11;
then E21: ( c2 = [0,0] or c2 = [1,0] ) by TARSKI:def 2;
thus AddressPart c2 = c2 `2
.= 0 by E21, MCART_1:def 2 ;
end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be InsType of c2;
func AddressParts a3 -> set equals :: AMISTD_2:def 5
{ (AddressPart b1) where B is Instruction of a2 : InsCode b1 = a3 } ;
coherence
{ (AddressPart b1) where B is Instruction of c2 : InsCode b1 = c3 } is set
;
end;

:: deftheorem defines AddressParts AMISTD_2:def 5 :
for b1 being set
for b2 being AMI-Struct of b1
for b3 being InsType of b2 holds AddressParts b3 = { (AddressPart b4) where B is Instruction of b2 : InsCode b4 = b3 } ;

registration
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be InsType of c2;
cluster AddressParts a3 -> functional ;
coherence
AddressParts c3 is functional
proof
let c4 be set ; :: uses FRAENKEL:def 1
assume c4 in AddressParts c3 ;
then ex b1 being Instruction of c2 st
( c4 = AddressPart b1 & InsCode b1 = c3 ) ;
hence c4 is Function ;
end;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite AMI-Struct of c1;
let c3 be Instruction of c2;
attr a3 is with_explicit_jumps means :E21: :: AMISTD_2:def 6
for b1 being set holds
not ( b1 in JUMP a3 & for b2 being set holds
not ( b2 in dom (AddressPart a3) & b1 = (AddressPart a3) . b2 & (PA (AddressParts (InsCode a3))) . b2 = the Instruction-Locations of a2 ) );
attr a3 is without_implicit_jumps means :E22: :: AMISTD_2:def 7
for b1 being set holds
( ex b2 being set st
( b2 in dom (AddressPart a3) & b1 = (AddressPart a3) . b2 & (PA (AddressParts (InsCode a3))) . b2 = the Instruction-Locations of a2 ) implies b1 in JUMP a3 );
end;

:: deftheorem E21 defines with_explicit_jumps AMISTD_2:def 6 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite AMI-Struct of b1
for b3 being Instruction of b2 holds
( b3 is with_explicit_jumps iff for b4 being set holds
not ( b4 in JUMP b3 & for b5 being set holds
not ( b5 in dom (AddressPart b3) & b4 = (AddressPart b3) . b5 & (PA (AddressParts (InsCode b3))) . b5 = the Instruction-Locations of b2 ) ) );

:: deftheorem E22 defines without_implicit_jumps AMISTD_2:def 7 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite AMI-Struct of b1
for b3 being Instruction of b2 holds
( b3 is without_implicit_jumps iff for b4 being set holds
( ex b5 being set st
( b5 in dom (AddressPart b3) & b4 = (AddressPart b3) . b5 & (PA (AddressParts <