:: COMPUT_1 semantic presentation

definition
let c1 be non empty set ;
let c2 be Nat;
let c3 be Element of c2 -tuples_on c1;
let c4 be Nat;
let c5 be Element of c1;
redefine func +* as c3 +* c4,c5 -> Element of a2 -tuples_on a1;
coherence
c3 +* c4,c5 is Element of c2 -tuples_on c1
proof end;
end;

definition
let c1 be Nat;
let c2 be Element of c1 -tuples_on NAT ;
let c3 be Nat;
redefine func . as c2 . c3 -> Element of NAT ;
coherence
c2 . c3 is Element of NAT
proof end;
end;

theorem Th1: :: COMPUT_1:1
canceled;

theorem Th2: :: COMPUT_1:2
canceled;

theorem Th3: :: COMPUT_1:3
for b1, b2, b3 being set holds
( <*b1,b2*> +* 1,b3 = <*b3,b2*> & <*b1,b2*> +* 2,b3 = <*b1,b3*> )
proof end;

theorem Th4: :: COMPUT_1:4
canceled;

theorem Th5: :: COMPUT_1:5
for b1, b2, b3, b4 being set
for b5, b6 being Function st b5 +* b1,b2 = b6 +* b1,b3 holds
b5 +* b1,b4 = b6 +* b1,b4
proof end;

theorem Th6: :: COMPUT_1:6
for b1 being Nat
for b2 being set
for b3 being FinSequence holds Del (b3 +* b1,b2),b1 = Del b3,b1
proof end;

theorem Th7: :: COMPUT_1:7
for b1 being Nat
for b2 being set
for b3, b4 being FinSequence st b3 +* b1,b2 = b4 +* b1,b2 holds
Del b3,b1 = Del b4,b1
proof end;

theorem Th8: :: COMPUT_1:8
for b1 being set holds 0 -tuples_on b1 = {{} }
proof end;

theorem Th9: :: COMPUT_1:9
for b1 being Nat st b1 <> 0 holds
b1 -tuples_on {} = {}
proof end;

theorem Th10: :: COMPUT_1:10
for b1 being Function st {} in rng b1 holds
<:b1:> = {}
proof end;

theorem Th11: :: COMPUT_1:11
for b1 being non empty set
for b2 being Function st rng b2 = b1 holds
rng <:<*b2*>:> = 1 -tuples_on b1
proof end;

theorem Th12: :: COMPUT_1:12
for b1, b2 being Nat
for b3 being non empty set st 1 <= b1 & b1 <= b2 + 1 holds
for b4 being Element of (b2 + 1) -tuples_on b3 holds Del b4,b1 in b2 -tuples_on b3
proof end;

theorem Th13: :: COMPUT_1:13
for b1 being set
for b2 being FinSequenceSet of b1 holds b2 c= b1 *
proof end;

definition
let c1 be set ;
attr a1 is compatible means :Def1: :: COMPUT_1:def 1
for b1, b2 being Function st b1 in a1 & b2 in a1 holds
b1 tolerates b2;
end;

:: deftheorem Def1 defines compatible COMPUT_1:def 1 :
for b1 being set holds
( b1 is compatible iff for b2, b3 being Function st b2 in b1 & b3 in b1 holds
b2 tolerates b3 );

registration
cluster non empty functional compatible set ;
existence
ex b1 being set st
( not b1 is empty & b1 is functional & b1 is compatible )
proof end;
end;

registration
let c1 be functional compatible set ;
cluster union a1 -> Relation-like Function-like ;
coherence
( union c1 is Function-like & union c1 is Relation-like )
proof end;
end;

theorem Th14: :: COMPUT_1:14
for b1 being set holds
( ( b1 is functional & b1 is compatible ) iff union b1 is Function )
proof end;

registration
let c1, c2 be set ;
cluster compatible PartFunc-set of a1,a2;
existence
ex b1 being PFUNC_DOMAIN of c1,c2 st
( not b1 is empty & b1 is compatible )
proof end;
end;

theorem Th15: :: COMPUT_1:15
for b1 being non empty functional compatible set holds dom (union b1) = union { (dom b2) where B is Element of b1 : verum }
proof end;

theorem Th16: :: COMPUT_1:16
for b1 being functional compatible set
for b2 being Function st b2 in b1 holds
( dom b2 c= dom (union b1) & ( for b3 being set st b3 in dom b2 holds
(union b1) . b3 = b2 . b3 ) )
proof end;

theorem Th17: :: COMPUT_1:17
for b1 being non empty functional compatible set holds rng (union b1) = union { (rng b2) where B is Element of b1 : verum }
proof end;

registration
let c1, c2 be set ;
cluster -> functional PartFunc-set of a1,a2;
coherence
for b1 being PFUNC_DOMAIN of c1,c2 holds b1 is functional
proof end;
end;

theorem Th18: :: COMPUT_1:18
for b1, b2 being set
for b3 being compatible PFUNC_DOMAIN of b1,b2 holds union b3 is PartFunc of b1,b2
proof end;

notation
let c1 be Relation;
synonym to-naturals c1 for natural-yielding c1;
end;

definition
let c1 be Relation;
attr a1 is from-natural-fseqs means :Def2: :: COMPUT_1:def 2
dom a1 c= NAT * ;
end;

:: deftheorem Def2 defines from-natural-fseqs COMPUT_1:def 2 :
for b1 being Relation holds
( b1 is from-natural-fseqs iff dom b1 c= NAT * );

registration
cluster to-naturals from-natural-fseqs set ;
existence
ex b1 being Function st
( b1 is from-natural-fseqs & b1 is to-naturals )
proof end;
end;

definition
let c1 be from-natural-fseqs Relation;
attr a1 is len-total means :Def3: :: COMPUT_1:def 3
for b1, b2 being FinSequence of NAT st len b1 = len b2 & b1 in dom a1 holds
b2 in dom a1;
end;

:: deftheorem Def3 defines len-total COMPUT_1:def 3 :
for b1 being from-natural-fseqs Relation holds
( b1 is len-total iff for b2, b3 being FinSequence of NAT st len b2 = len b3 & b2 in dom b1 holds
b3 in dom b1 );

definition
let c1 be Relation;
attr a1 is homogeneous means :Def4: :: COMPUT_1:def 4
for b1, b2 being FinSequence st b1 in dom a1 & b2 in dom a1 holds
len b1 = len b2;
end;

:: deftheorem Def4 defines homogeneous COMPUT_1:def 4 :
for b1 being Relation holds
( b1 is homogeneous iff for b2, b3 being FinSequence st b2 in dom b1 & b3 in dom b1 holds
len b2 = len b3 );

theorem Th19: :: COMPUT_1:19
for b1 being Nat
for b2 being non empty set
for b3 being Relation st dom b3 c= b1 -tuples_on b2 holds
b3 is homogeneous
proof end;

registration
cluster {} -> homogeneous ;
coherence
{} is homogeneous
proof end;
end;

registration
let c1 be FinSequence;
let c2 be set ;
cluster K256({a1},a2) -> non empty homogeneous ;
coherence
( not {c1} --> c2 is empty & {c1} --> c2 is homogeneous )
proof end;
end;

registration
cluster non empty homogeneous set ;
existence
ex b1 being Function st
( not b1 is empty & b1 is homogeneous )
proof end;
end;

registration
let c1 be homogeneous Function;
let c2 be Function;
cluster a1 * a2 -> homogeneous ;
coherence
c2 * c1 is homogeneous
proof end;
end;

registration
let c1, c2 be set ;
cluster homogeneous Relation of a1 * ,a2;
existence
ex b1 being PartFunc of c1 * ,c2 st b1 is homogeneous
proof end;
end;

registration
let c1, c2 be non empty set ;
cluster non empty homogeneous Relation of a1 * ,a2;
existence
ex b1 being PartFunc of c1 * ,c2 st
( not b1 is empty & b1 is homogeneous )
proof end;
end;

registration
let c1 be non empty set ;
cluster non empty quasi_total homogeneous Relation of a1 * ,a1;
existence
ex b1 being PartFunc of c1 * ,c1 st
( not b1 is empty & b1 is homogeneous & b1 is quasi_total )
proof end;
end;

registration
cluster non empty to-naturals from-natural-fseqs len-total homogeneous set ;
existence
ex b1 being from-natural-fseqs Function st
( not b1 is empty & b1 is homogeneous & b1 is to-naturals & b1 is len-total )
proof end;
end;

registration
cluster -> to-naturals from-natural-fseqs Relation of NAT * , NAT ;
coherence
for b1 being PartFunc of NAT * , NAT holds
( b1 is to-naturals & b1 is from-natural-fseqs )
proof end;
end;

registration
cluster quasi_total -> to-naturals from-natural-fseqs len-total Relation of NAT * , NAT ;
coherence
for b1 being PartFunc of NAT * , NAT st b1 is quasi_total holds
b1 is len-total
proof end;
end;

theorem Th20: :: COMPUT_1:20
for b1 being to-naturals from-natural-fseqs len-total Function holds b1 is quasi_total PartFunc of NAT * , NAT
proof end;

definition
let c1 be homogeneous Relation;
func arity c1 -> Nat means :Def5: :: COMPUT_1:def 5
for b1 being FinSequence st b1 in dom a1 holds
a2 = len b1 if ex b1 being FinSequence st b1 in dom a1
otherwise a2 = 0;
existence
( ( ex b1 being FinSequence st b1 in dom c1 implies ex b1 being Nat st
for b2 being FinSequence st b2 in dom c1 holds
b1 = len b2 ) & ( ( for b1 being FinSequence holds not b1 in dom c1 ) implies ex b1 being Nat st b1 = 0 ) )
proof end;
uniqueness
for b1, b2 being Nat holds
( ( ex b3 being FinSequence st b3 in dom c1 & ( for b3 being FinSequence st b3 in dom c1 holds
b1 = len b3 ) & ( for b3 being FinSequence st b3 in dom c1 holds
b2 = len b3 ) implies b1 = b2 ) & ( ( for b3 being FinSequence holds not b3 in dom c1 ) & b1 = 0 & b2 = 0 implies b1 = b2 ) )
proof end;
correctness
consistency
for b1 being Nat holds verum
;
;
end;

:: deftheorem Def5 defines arity COMPUT_1:def 5 :
for b1 being homogeneous Relation
for b2 being Nat holds
( ( ex b3 being FinSequence st b3 in dom b1 implies ( b2 = arity b1 iff for b3 being FinSequence st b3 in dom b1 holds
b2 = len b3 ) ) & ( ( for b3 being FinSequence holds not b3 in dom b1 ) implies ( b2 = arity b1 iff b2 = 0 ) ) );

theorem Th21: :: COMPUT_1:21
arity {} = 0
proof end;

theorem Th22: :: COMPUT_1:22
for b1 being homogeneous Relation st dom b1 = {{} } holds
arity b1 = 0
proof end;

theorem Th23: :: COMPUT_1:23
for b1, b2 being set
for b3 being homogeneous PartFunc of b1 * ,b2 holds dom b3 c= (arity b3) -tuples_on b1
proof end;

theorem Th24: :: COMPUT_1:24
for b1 being from-natural-fseqs homogeneous Function holds dom b1 c= (arity b1) -tuples_on NAT
proof end;

Lemma26: for b1 being non empty set
for b2 being homogeneous PartFunc of b1 * ,b1 holds
( ( b2 is quasi_total & not b2 is empty ) iff dom b2 = (arity b2) -tuples_on b1 )
proof end;

theorem Th25: :: COMPUT_1:25
for b1 being set
for b2 being homogeneous PartFunc of b1 * ,b1 holds
( ( b2 is quasi_total & not b2 is empty ) iff dom b2 = (arity b2) -tuples_on b1 )
proof end;

theorem Th26: :: COMPUT_1:26
for b1 being to-naturals from-natural-fseqs homogeneous Function holds
( ( b1 is len-total & not b1 is empty ) iff dom b1 = (arity b1) -tuples_on NAT )
proof end;

theorem Th27: :: COMPUT_1:27
for b1 being non empty set
for b2 being non empty homogeneous PartFunc of b1 * ,b1
for b3 being Nat st dom b2 c= b3 -tuples_on b1 holds
arity b2 = b3
proof end;

theorem Th28: :: COMPUT_1:28
for b1 being non empty set
for b2 being homogeneous PartFunc of b1 * ,b1
for b3 being Nat st dom b2 = b3 -tuples_on b1 holds
arity b2 = b3
proof end;

definition
let c1 be Relation;
attr a1 is with_the_same_arity means :Def6: :: COMPUT_1:def 6
for b1, b2 being Function st b1 in rng a1 & b2 in rng a1 holds
( ( not b1 is empty or b2 is empty or dom b2 = {{} } ) & ( not b1 is empty & not b2 is empty implies ex b3 being Natex b4 being non empty set st
( dom b1 c= b3 -tuples_on b4 & dom b2 c= b3 -tuples_on b4 ) ) );
end;

:: deftheorem Def6 defines with_the_same_arity COMPUT_1:def 6 :
for b1 being Relation holds
( b1 is with_the_same_arity iff for b2, b3 being Function st b2 in rng b1 & b3 in rng b1 holds
( ( not b2 is empty or b3 is empty or dom b3 = {{} } ) & ( not b2 is empty & not b3 is empty implies ex b4 being Natex b5 being non empty set st
( dom b2 c= b4 -tuples_on b5 & dom b3 c= b4 -tuples_on b5 ) ) ) );

registration
cluster {} -> homogeneous with_the_same_arity ;
coherence
{} is with_the_same_arity
proof end;
end;

registration
cluster with_the_same_arity set ;
existence
ex b1 being FinSequence st b1 is with_the_same_arity
proof end;
let c1 be set ;
cluster with_the_same_arity FinSequence of a1;
existence
ex b1 being FinSequence of c1 st b1 is with_the_same_arity
proof end;
cluster with_the_same_arity Element of a1 * ;
existence
ex b1 being Element of c1 * st b1 is with_the_same_arity
proof end;
end;

definition
let c1 be with_the_same_arity Relation;
func arity c1 -> Nat means :Def7: :: COMPUT_1:def 7
for b1 being homogeneous Function st b1 in rng a1 holds
a2 = arity b1 if ex b1 being homogeneous Function st b1 in rng a1
otherwise a2 = 0;
existence
( ( ex b1 being homogeneous Function st b1 in rng c1 implies ex b1 being Nat st
for b2 being homogeneous Function st b2 in rng c1 holds
b1 = arity b2 ) & ( ( for b1 being homogeneous Function holds not b1 in rng c1 ) implies ex b1 being Nat st b1 = 0 ) )
proof end;
uniqueness
for b1, b2 being Nat holds
( ( ex b3 being homogeneous Function st b3 in rng c1 & ( for b3 being homogeneous Function st b3 in rng c1 holds
b1 = arity b3 ) & ( for b3 being homogeneous Function st b3 in rng c1 holds
b2 = arity b3 ) implies b1 = b2 ) & ( ( for b3 being homogeneous Function holds not b3 in rng c1 ) & b1 = 0 & b2 = 0 implies b1 = b2 ) )
proof end;
correctness
consistency
for b1 being Nat holds verum
;
;
end;

:: deftheorem Def7 defines arity COMPUT_1:def 7 :
for b1 being with_the_same_arity Relation
for b2 being Nat holds
( ( ex b3 being homogeneous Function st b3 in rng b1 implies ( b2 = arity b1 iff for b3 being homogeneous Function st b3 in rng b1 holds
b2 = arity b3 ) ) & ( ( for b3 being homogeneous Function holds not b3 in rng b1 ) implies ( b2 = arity b1 iff b2 = 0 ) ) );

theorem Th29: :: COMPUT_1:29
for b1 being with_the_same_arity FinSequence st len b1 = 0 holds
arity b1 = 0
proof end;

definition
let c1 be set ;
func HFuncs c1 -> PFUNC_DOMAIN of a1 * ,a1 equals :: COMPUT_1:def 8
{ b1 where B is Element of PFuncs (a1 * ),a1 : b1 is homogeneous } ;
coherence
{ b1 where B is Element of PFuncs (c1 * ),c1 : b1 is homogeneous } is PFUNC_DOMAIN of c1 * ,c1
proof end;
end;

:: deftheorem Def8 defines HFuncs COMPUT_1:def 8 :
for b1 being set holds HFuncs b1 = { b2 where B is Element of PFuncs (b1 * ),b1 : b2 is homogeneous } ;

theorem Th30: :: COMPUT_1:30
for b1 being set holds {} in HFuncs b1
proof end;

registration
let c1 be non empty set ;
cluster non empty quasi_total homogeneous Element of HFuncs a1;
existence
ex b1 being Element of HFuncs c1 st
( not b1 is empty & b1 is homogeneous & b1 is quasi_total )
proof end;
end;

registration
let c1 be set ;
cluster -> homogeneous Element of HFuncs a1;
coherence
for b1 being Element of HFuncs c1 holds b1 is homogeneous
proof end;
end;

registration
let c1 be non empty set ;
let c2 be non empty Subset of (HFuncs c1);
cluster -> homogeneous Element of a2;
coherence
for b1 being Element of c2 holds b1 is homogeneous
proof end;
end;

theorem Th31: :: COMPUT_1:31
for b1 being to-naturals from-natural-fseqs homogeneous Function holds b1 is Element of HFuncs NAT
proof end;

theorem Th32: :: COMPUT_1:32
for b1 being to-naturals from-natural-fseqs len-total homogeneous Function holds b1 is quasi_total Element of HFuncs NAT
proof end;

theorem Th33: :: COMPUT_1:33
for b1 being non empty set
for b2 being Relation st rng b2 c= HFuncs b1 & ( for b3, b4 being homogeneous Function st b3 in rng b2 & b4 in rng b2 holds
arity b3 = arity b4 ) holds
b2 is with_the_same_arity
proof end;

definition
let c1, c2 be Nat;
func c1 const c2 -> to-naturals from-natural-fseqs homogeneous Function equals :: COMPUT_1:def 9
(a1 -tuples_on NAT ) --> a2;
coherence
(c1 -tuples_on NAT ) --> c2 is to-naturals from-natural-fseqs homogeneous Function
proof end;
end;

:: deftheorem Def9 defines const COMPUT_1:def 9 :
for b1, b2 being Nat holds b1 const b2 = (b1 -tuples_on NAT ) --> b2;

theorem Th34: :: COMPUT_1:34
for b1, b2 being Nat holds b1 const b2 in HFuncs NAT
proof end;

registration
let c1, c2 be Nat;
cluster a1 const a2 -> non empty to-naturals from-natural-fseqs len-total homogeneous ;
coherence
( c1 const c2 is len-total & not c1 const c2 is empty )
proof end;
end;

theorem Th35: :: COMPUT_1:35
for b1, b2 being Nat holds arity (b1 const b2) = b1
proof end;

theorem Th36: :: COMPUT_1:36
for b1, b2 being Nat
for b3 being Element of b1 -tuples_on NAT holds (b1 const b2) . b3 = b2 by FUNCOP_1:13;

definition
let c1, c2 be Nat;
func c1 succ c2 -> to-naturals from-natural-fseqs homogeneous Function means :Def10: :: COMPUT_1:def 10
( dom a3 = a1 -tuples_on NAT & ( for b1 being Element of a1 -tuples_on NAT holds a3 . b1 = (b1 /. a2) + 1 ) );
existence
ex b1 being to-naturals from-natural-fseqs homogeneous Function st
( dom b1 = c1 -tuples_on NAT & ( for b2 being Element of c1 -tuples_on NAT holds b1 . b2 = (b2 /. c2) + 1 ) )
proof end;
uniqueness
for b1, b2 being to-naturals from-natural-fseqs homogeneous Function st dom b1 = c1 -tuples_on NAT & ( for b3 being Element of c1 -tuples_on NAT holds b1 . b3 = (b3 /. c2) + 1 ) & dom b2 = c1 -tuples_on NAT & ( for b3 being Element of c1 -tuples_on NAT holds b2 . b3 = (b3 /. c2) + 1 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def10 defines succ COMPUT_1:def 10 :
for b1, b2 being Nat
for b3 being to-naturals from-natural-fseqs homogeneous Function holds
( b3 = b1 succ b2 iff ( dom b3 = b1 -tuples_on NAT & ( for b4 being Element of b1 -tuples_on NAT holds b3 . b4 = (b4 /. b2) + 1 ) ) );

theorem Th37: :: COMPUT_1:37
for b1, b2 being Nat holds b1 succ b2 in HFuncs NAT
proof end;

registration
let c1, c2 be Nat;
cluster a1 succ a2 -> non empty to-naturals from-natural-fseqs len-total homogeneous ;
coherence
( c1 succ c2 is len-total & not c1 succ c2 is empty )
proof end;
end;

theorem Th38: :: COMPUT_1:38
for b1, b2 being Nat holds arity (b1 succ b2) = b1
proof end;

definition
let c1, c2 be Nat;
func c1 proj c2 -> to-naturals from-natural-fseqs homogeneous Function equals :: COMPUT_1:def 11
proj (a1 |-> NAT ),a2;
correctness
coherence
proj (c1 |-> NAT ),c2 is to-naturals from-natural-fseqs homogeneous Function
;
proof end;
end;

:: deftheorem Def11 defines proj COMPUT_1:def 11 :
for b1, b2 being Nat holds b1 proj b2 = proj (b1 |-> NAT ),b2;

theorem Th39: :: COMPUT_1:39
for b1, b2 being Nat holds b1 proj b2 in HFuncs NAT
proof end;

theorem Th40: :: COMPUT_1:40
for b1, b2 being Nat holds
( dom (b1 proj b2) = b1 -tuples_on NAT & ( 1 <= b2 & b2 <= b1 implies rng (b1 proj b2) = NAT ) )
proof end;

registration
let c1, c2 be Nat;
cluster a1 proj a2 -> non empty to-naturals from-natural-fseqs len-total homogeneous ;
coherence
( c1 proj c2 is len-total & not c1 proj c2 is empty )
proof end;
end;

theorem Th41: :: COMPUT_1:41
for b1, b2 being Nat holds arity (b1 proj b2) = b1
proof end;

theorem Th42: :: COMPUT_1:42
for b1, b2 being Nat
for b3 being Element of b1 -tuples_on NAT holds (b1 proj b2) . b3 = b3 . b2
proof end;

registration
let c1 be set ;
cluster HFuncs a1 -> functional ;
coherence
HFuncs c1 is functional
;
end;

theorem Th43: :: COMPUT_1:43
for b1 being Nat
for b2, b3 being non empty set
for b4 being Function of b2, HFuncs b3 st rng b4 is compatible & ( for b5 being Element of b2 holds dom (b4 . b5) c= b1 -tuples_on b3 ) holds
ex b5 being Element of HFuncs b3 st
( b5 = Union b4 & dom b5 c= b1 -tuples_on b3 )
proof end;

theorem Th44: :: COMPUT_1:44
for b1 being non empty set
for b2 being Function of NAT , HFuncs b1 st ( for b3 being Nat holds b2 . b3 c= b2 . (b3 + 1) ) holds
Union b2 in HFuncs b1
proof end;

theorem Th45: :: COMPUT_1:45
for b1 being non empty set
for b2 being with_the_same_arity FinSequence of HFuncs b1 holds dom <:b2:> c= (arity b2) -tuples_on b1
proof end;

registration
let c1 be non empty set ;
let c2 be with_the_same_arity FinSequence of HFuncs c1;
cluster <:a2:> -> homogeneous ;
coherence
<:c2:> is homogeneous
proof end;
end;

theorem Th46: :: COMPUT_1:46
for b1 being non empty set
for b2 being Element of HFuncs b1
for b3 being with_the_same_arity FinSequence of HFuncs b1 holds
( dom (b2 * <:b3:>) c= (arity b3) -tuples_on b1 & rng (b2 * <:b3:>) c= b1 & b2 * <:b3:> in HFuncs b1 )
proof end;

definition
let c1, c2 be non empty set ;
let c3 be PFUNC_DOMAIN of c1,c2;
let c4 be non empty Subset of c3;
redefine mode Element as Element of c4 -> Element of a3;
coherence
for b1 being Element of c4 holds b1 is Element of c3
proof end;
end;

registration
let c1 be from-natural-fseqs homogeneous Function;
cluster <*a1*> -> with_the_same_arity ;
coherence
<*c1*> is with_the_same_arity
proof end;
end;

theorem Th47: :: COMPUT_1:47
for b1 being to-naturals from-natural-fseqs homogeneous Function holds arity <*b1*> = arity b1
proof end;

theorem Th48: :: COMPUT_1:48
for b1, b2 being non empty Element of HFuncs NAT
for b3 being with_the_same_arity FinSequence of HFuncs NAT st b2 = b1 * <:b3:> holds
arity b2 = arity b3
proof end;

theorem Th49: :: COMPUT_1:49
for b1 being non empty set
for b2 being non empty quasi_total Element of HFuncs b1
for b3 being with_the_same_arity FinSequence of HFuncs b1 st arity b2 = len b3 & not b3 is empty & ( for b4 being Element of HFuncs b1 st b4 in rng b3 holds
( b4 is quasi_total & not b4 is empty ) ) holds
( b2 * <:b3:> is non empty quasi_total Element of HFuncs b1 & dom (b2 * <:b3:>) = (arity b3) -tuples_on b1 )
proof end;

theorem Th50: :: COMPUT_1:50
for b1 being non empty set
for b2 being quasi_total Element of HFuncs b1
for b3 being with_the_same_arity FinSequence of HFuncs b1 st arity b2 = len b3 & ( for b4 being Element of HFuncs b1 st b4 in rng b3 holds
b4 is quasi_total ) holds
b2 * <:b3:> is quasi_total Element of HFuncs b1
proof end;

theorem Th51: :: COMPUT_1:51
for b1 being non empty set
for b2, b3 being non empty quasi_total Element of HFuncs b1 st arity b2 = 0 & arity b3 = 0 & b2 . {} = b3 . {} holds
b2 = b3
proof end;

theorem Th52: :: COMPUT_1:52
for b1, b2 being non empty to-naturals from-natural-fseqs len-total homogeneous Function st arity b1 = 0 & arity b2 = 0 & b1 . {} = b2 . {} holds
b1 = b2
proof end;

definition
let c1, c2, c3 be to-naturals from-natural-fseqs homogeneous Function;
let c4 be Nat;
pred c1 is_primitive-recursively_expressed_by c2,c3,c4 means :Def12: :: COMPUT_1:def 12
ex b1 being Nat st
( dom a1 c= b1 -tuples_on NAT & a4 >= 1 & a4 <= b1 & (arity a2) + 1 = b1 & b1 + 1 = arity a3 & ( for b2 being FinSequence of NAT st len b2 = b1 holds
( ( b2 +* a4,0 in dom a1 implies Del b2,a4 in dom a2 ) & ( Del b2,a4 in dom a2 implies b2 +* a4,0 in dom a1 ) & ( b2 +* a4,0 in dom a1 implies a1 . (b2 +* a4,0) = a2 . (Del b2,a4) ) & ( for b3 being Nat holds
( ( b2 +* a4,(b3 + 1) in dom a1 implies ( b2 +* a4,b3 in dom a1 & (b2 +* a4,b3) ^ <*(a1 . (b2 +* a4,b3))*> in dom a3 ) ) & ( b2 +* a4,b3 in dom a1 & (b2 +* a4,b3) ^ <*(a1 . (b2 +* a4,b3))*> in dom a3 implies b2 +* a4,(b3 + 1) in dom a1 ) & ( b2 +* a4,(b3 + 1) in dom a1 implies a1 . (b2 +* a4,(b3 + 1)) = a3 . ((b2 +* a4,b3) ^ <*(a1 . (b2 +* a4,b3))*>) ) ) ) ) ) );
end;

:: deftheorem Def12 defines is_primitive-recursively_expressed_by COMPUT_1:def 12 :
for b1, b2, b3 being to-naturals from-natural-fseqs homogeneous Function
for b4 being Nat holds
( b1 is_primitive-recursively_expressed_by b2,b3,b4 iff ex b5 being Nat st
( dom b1 c= b5 -tuples_on NAT & b4 >= 1 & b4 <= b5 & (arity b2) + 1 = b5 & b5 + 1 = arity b3 & ( for b6 being FinSequence of NAT st len b6 = b5 holds
( ( b6 +* b4,0 in dom b1 implies Del b6,b4 in dom b2 ) & ( Del b6,b4 in dom b2 implies b6 +* b4,0 in dom b1 ) & ( b6 +* b4,0 in dom b1 implies b1 . (b6 +* b4,0) = b2 . (Del b6,b4) ) & ( for b7 being Nat holds
( ( b6 +* b4,(b7 + 1) in dom b1 implies ( b6 +* b4,b7 in dom b1 & (b6 +* b4,b7) ^ <*(b1 . (b6 +* b4,b7))*> in dom b3 ) ) & ( b6 +* b4,b7 in dom b1 & (b6 +* b4,b7) ^ <*(b1 . (b6 +* b4,b7))*> in dom b3 implies b6 +* b4,(b7 + 1) in dom b1 ) & ( b6 +* b4,(b7 + 1) in dom b1 implies b1 . (b6 +* b4,(b7 + 1)) = b3 . ((b6 +* b4,b7) ^ <*(b1 . (b6 +* b4,b7))*>) ) ) ) ) ) ) );

defpred S1[ Nat, Element of HFuncs NAT , Element of HFuncs NAT , FinSequence of NAT , Nat, homogeneous Function] means ( ( a5 in dom a4 & a4 +* a5,a1 in dom a2 & (a4 +* a5,a1) ^ <*(a2 . (a4 +* a5,a1))*> in dom a6 implies a3 = a2 +* ({(a4 +* a5,(a1 + 1))} --> (a6 . ((a4 +* a5,a1) ^ <*(a2 . (a4 +* a5,a1))*>))) ) & ( ( not a5 in dom a4 or not a4 +* a5,a1 in dom a2 or not (a4 +* a5,a1) ^ <*(a2 . (a4 +* a5,a1))*> in dom a6 ) implies a3 = a2 ) );

definition
let c1, c2 be to-naturals from-natural-fseqs homogeneous Function;
let c3 be Nat;
let c4 be FinSequence of NAT ;
func primrec c1,c2,c3,c4 -> Element of HFuncs NAT means :Def13: :: COMPUT_1:def 13
ex b1 being Function of NAT , HFuncs NAT st
( a5 = b1 . (a4 /. a3) & ( a3 in dom a4 & Del a4,a3 in dom a1 implies b1 . 0 = {(a4 +* a3,0)} --> (a1 . (Del a4,a3)) ) & ( ( not a3 in dom a4 or not Del a4,a3 in dom a1 ) implies b1 . 0 = {} ) & ( for b2 being Nat holds
( ( a3 in dom a4 & a4 +* a3,b2 in dom (b1 . b2) & (a4 +* a3,b2) ^ <*((b1 . b2) . (a4 +* a3,b2))*> in dom a2 implies b1 . (b2 + 1) = (b1 . b2) +* ({(a4 +* a3,(b2 + 1))} --> (a2 . ((a4 +* a3,b2) ^ <*((b1 . b2) . (a4 +* a3,b2))*>))) ) & ( ( not a3 in dom a4 or not a4 +* a3,b2 in dom (b1 . b2) or not (a4 +* a3,b2) ^ <*((b1 . b2) . (a4 +* a3,b2))*> in dom a2 ) implies b1 . (b2 + 1) = b1 . b2 ) ) ) );
existence
ex b1 being Element of HFuncs NAT ex b2 being Function of NAT , HFuncs NAT st
( b1 = b2 . (c4 /. c3) & ( c3 in dom c4 & Del c4,c3 in dom c1 implies b2 . 0 = {(c4 +* c3,0)} --> (c1 . (Del c4,c3)) ) & ( ( not c3 in dom c4 or not Del c4,c3 in dom c1 ) implies b2 . 0 = {} ) & ( for b3 being Nat holds
( ( c3 in dom c4 & c4 +* c3,b3 in dom (b2 . b3) & (c4 +* c3,b3) ^ <*((b2 . b3) . (c4 +* c3,b3))*> in dom c2 implies b2 . (b3 + 1) = (b2 . b3) +* ({(c4 +* c3,(b3 + 1))} --> (c2 . ((c4 +* c3,b3) ^ <*((b2 . b3) . (c4 +* c3,b3))*>))) ) & ( ( not c3 in dom c4 or not c4 +* c3,b3 in dom (b2 . b3) or not (c4 +* c3,b3) ^ <*((b2 . b3) . (c4 +* c3,b3))*> in dom c2 ) implies b2 . (b3 + 1) = b2 . b3 ) ) ) )
proof end;
uniqueness
for b1, b2 being Element of HFuncs NAT st ex b3 being Function of NAT , HFuncs NAT st
( b1 = b3 . (c4 /. c3) & ( c3 in dom c4 & Del c4,c3 in dom c1 implies b3 . 0 = {(c4 +* c3,0)} --> (c1 . (Del c4,c3)) ) & ( ( not c3 in dom c4 or not Del c4,c3 in dom c1 ) implies b3 . 0 = {} ) & ( for b4 being Nat holds
( ( c3 in dom c4 & c4 +* c3,b4 in dom (b3 . b4) & (c4 +* c3,b4) ^ <*((b3 . b4) . (c4 +* c3,b4))*> in dom c2 implies b3 . (b4 + 1) = (b3 . b4) +* ({(c4 +* c3,(b4 + 1))} --> (c2 . ((c4 +* c3,b4) ^ <*((b3 . b4) . (c4 +* c3,b4))*>))) ) & ( ( not c3 in dom c4 or not c4 +* c3,b4 in dom (b3 . b4) or not (c4 +* c3,b4) ^ <*((b3 . b4) . (c4 +* c3,b4))*> in dom c2 ) implies b3 . (b4 + 1) = b3 . b4 ) ) ) ) & ex b3 being Function of NAT , HFuncs NAT st
( b2 = b3 . (c4 /. c3) & ( c3 in dom c4 & Del c4,c3 in dom c1 implies b3 . 0 = {(c4 +* c3,0)} --> (c1 . (Del c4,c3)) ) & ( ( not c3 in dom c4 or not Del c4,c3 in dom c1 ) implies b3 . 0 = {} ) & ( for b4 being Nat holds
( ( c3 in dom c4 & c4 +* c3,b4 in dom (b3 . b4) & (c4 +* c3,b4) ^ <*((b3 . b4) . (c4 +* c3,b4))*> in dom c2 implies b3 . (b4 + 1) = (b3 . b4) +* ({(c4 +* c3,(b4 + 1))} --> (c2 . ((c4 +* c3,b4) ^ <*((b3 . b4) . (c4 +* c3,b4))*>))) ) & ( ( not c3 in dom c4 or not c4 +* c3,b4 in dom (b3 . b4) or not (c4 +* c3,b4) ^ <*((b3 . b4) . (c4 +* c3,b4))*> in dom c2 ) implies b3 . (b4 + 1) = b3 . b4 ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines primrec COMPUT_1:def 13 :
for b1, b2 being to-naturals from-natural-fseqs homogeneous Function
for b3 being Nat
for b4 being FinSequence of NAT
for b5 being Element of HFuncs NAT holds
( b5 = primrec b1,b2,b3,b4 iff ex b6 being Function of NAT , HFuncs NAT st
( b5 = b6 . (b4 /. b3) & ( b3 in dom b4 & Del b4,b3 in dom b1 implies b6 . 0 = {(b4 +* b3,0)} --> (b1 . (Del b4,b3)) ) & ( ( not b3 in dom b4 or not Del b4,b3 in dom b1 ) implies b6 . 0 = {} ) & ( for b7 being Nat holds
( ( b3 in dom b4 & b4 +* b3,b7 in dom (b6 . b7) & (b4 +* b3,b7) ^ <*((b6 . b7) . (b4 +* b3,b7))*> in dom b2 implies b6 . (b7 + 1) = (b6 . b7) +* ({(b4 +* b3,(b7 + 1))} --> (b2 . ((b4 +* b3,b7) ^ <*((b6 . b7) . (b4 +* b3,b7))*>))) ) & ( ( not b3 in dom b4 or not b4 +* b3,b7 in dom (b6 . b7) or not (b4 +* b3,b7) ^ <*((b6 . b7) . (b4 +* b3,b7))*> in dom b2 ) implies b6 . (b7 + 1) = b6 . b7 ) ) ) ) );

theorem Th53: :: COMPUT_1:53
for b1 being Nat
for b2, b3 being to-naturals from-natural-fseqs homogeneous Function
for b4, b5 being FinSequence of NAT st b5 in dom (primrec b2,b3,b1,b4) holds
ex b6 being Nat st b5 = b4 +* b1,b6
proof end;

theorem Th54: :: COMPUT_1:54
for b1 being Nat
for b2, b3 being to-naturals from-natural-fseqs homogeneous Function
for b4 being FinSequence of NAT st not b1 in dom b4 holds
primrec b2,b3,b1,b4 = {}
proof end;

theorem Th55: :: COMPUT_1:55
for b1 being Nat
for b2, b3 being to-naturals from-natural-fseqs homogeneous Function
for b4, b5 being FinSequence of NAT holds primrec b2,b3,b1,b4 tolerates primrec b2,b3,b1,b5
proof end;

theorem Th56: :: COMPUT_1:56
for b1 being Nat
for b2, b3 being to-naturals from-natural-fseqs homogeneous Function
for b4 being FinSequence of NAT holds dom (primrec b2,b3,b1,b4) c= (1 + (arity b2)) -tuples_on NAT
proof end;

theorem Th57: :: COMPUT_1:57
for b1 being Nat
for b2, b3 being to-naturals from-natural-fseqs homogeneous Function
for b4 being FinSequence of NAT st b2 is empty holds
primrec b2,b3,b1,b4 is empty
proof end;

theorem Th58: :: COMPUT_1:58
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function
for b4 being Element of ((arity b2) + 1) -tuples_on NAT st b2 is len-total & b3 is len-total & (arity b2) + 2 = arity b3 & 1 <= b1 & b1 <= 1 + (arity b2) holds
b4 in dom (primrec b2,b3,b1,b4)
proof end;

definition
let c1, c2 be to-naturals from-natural-fseqs homogeneous Function;
let c3 be Nat;
func primrec c1,c2,c3 -> Element of HFuncs NAT means :Def14: :: COMPUT_1:def 14
ex b1 being Function of ((arity a1) + 1) -tuples_on NAT , HFuncs NAT st
( a4 = Union b1 & ( for b2 being Element of ((arity a1) + 1) -tuples_on NAT holds b1 . b2 = primrec a1,a2,a3,b2 ) );
existence
ex b1 being Element of HFuncs NAT ex b2 being Function of ((arity c1) + 1) -tuples_on NAT , HFuncs NAT st
( b1 = Union b2 & ( for b3 being Element of ((arity c1) + 1) -tuples_on NAT holds b2 . b3 = primrec c1,c2,c3,b3 ) )
proof end;
uniqueness
for b1, b2 being Element of HFuncs NAT st ex b3 being Function of ((arity c1) + 1) -tuples_on NAT , HFuncs NAT st
( b1 = Union b3 & ( for b4 being Element of ((arity c1) + 1) -tuples_on NAT holds b3 . b4 = primrec c1,c2,c3,b4 ) ) & ex b3 being Function of ((arity c1) + 1) -tuples_on NAT , HFuncs NAT st
( b2 = Union b3 & ( for b4 being Element of ((arity c1) + 1) -tuples_on NAT holds b3 . b4 = primrec c1,c2,c3,b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines primrec COMPUT_1:def 14 :
for b1, b2 being to-naturals from-natural-fseqs homogeneous Function
for b3 being Nat
for b4 being Element of HFuncs NAT holds
( b4 = primrec b1,b2,b3 iff ex b5 being Function of ((arity b1) + 1) -tuples_on NAT , HFuncs NAT st
( b4 = Union b5 & ( for b6 being Element of ((arity b1) + 1) -tuples_on NAT holds b5 . b6 = primrec b1,b2,b3,b6 ) ) );

theorem Th59: :: COMPUT_1:59
for b1 being Nat
for b2, b3 being to-naturals from-natural-fseqs homogeneous Function st b2 is empty holds
primrec b2,b3,b1 is empty
proof end;

theorem Th60: :: COMPUT_1:60
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function holds dom (primrec b2,b3,b1) c= ((arity b2) + 1) -tuples_on NAT
proof end;

theorem Th61: :: COMPUT_1:61
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function st b2 is len-total & b3 is len-total & (arity b2) + 2 = arity b3 & 1 <= b1 & b1 <= 1 + (arity b2) holds
( dom (primrec b2,b3,b1) = ((arity b2) + 1) -tuples_on NAT & arity (primrec b2,b3,b1) = (arity b2) + 1 )
proof end;

E66: now
let c1, c2 be non empty to-naturals from-natural-fseqs homogeneous Function;
let c3 be Element of ((arity c1) + 1) -tuples_on NAT ;
let c4, c5 be Nat;
set c6 = c3 +* c4,(c5 + 1);
set c7 = c3 +* c4,c5;
let c8, c9 be Function of NAT , HFuncs NAT ;
assume that
E67: ( ( c4 in dom (c3 +* c4,(c5 + 1)) & Del (c3 +* c4,(c5 + 1)),c4 in dom c1 implies c8 . 0 = {((c3 +* c4,(c5 + 1)) +* c4,0)} --> (c1 . (Del (c3 +* c4,(c5 + 1)),c4)) ) & ( ( not c4 in dom (c3 +* c4,(c5 + 1)) or not Del (c3 +* c4,(c5 + 1)),c4 in dom c1 ) implies c8 . 0 = {} ) ) and
E68: for b1 being Nat holds S1[b1,c8 . b1,c8 . (b1 + 1),c3 +* c4,(c5 + 1),c4,c2] and
E69: ( ( c4 in dom (c3 +* c4,c5) & Del (c3 +* c4,c5),c4 in dom c1 implies c9 . 0 = {((c3 +* c4,c5) +* c4,0)} --> (c1 . (Del (c3 +* c4,c5),c4)) ) & ( ( not c4 in dom (c3 +* c4,c5) or not Del (c3 +* c4,c5),c4 in dom c1 ) implies c9 . 0 = {} ) ) and
E70: for b1 being Nat holds S1[b1,c9 . b1,c9 . (b1 + 1),c3 +* c4,c5,c4,c2] ;
E71: ( dom c3 = dom (c3 +* c4,c5) & dom c3 = dom (c3 +* c4,(c5 + 1)) ) by FUNCT_7:32;
E72: (c3 +* c4,c5) +* c4,0 = c3 +* c4,0 by FUNCT_7:36
.= (c3 +* c4,(c5 + 1)) +* c4,0 by FUNCT_7:36 ;
E73: Del (c3 +* c4,c5),c4 = Del c3,c4 by Th6
.= Del (c3 +* c4,(c5 + 1)),c4 by Th6 ;
for b1 being set st b1 in NAT holds
c9 . b1 = c8 . b1
proof
defpred S2[ Nat] means c9 . a1 = c8 . a1;
E74: S2[0] by E67, E69, E71, E72, E73;
E75: for b1 being Nat st S2[b1] holds
S2[b1 + 1]
proof
let c10 be Nat;
assume E76: S2[c10] ;
E77: (c3 +* c4,c5) +* c4,c10 = c3 +* c4,c10 by FUNCT_7:36
.= (c3 +* c4,(c5 + 1)) +* c4,c10 by FUNCT_7:36 ;
E78: (c3 +* c4,c5) +* c4,(c10 + 1) = c3 +* c4,(c10 + 1) by FUNCT_7:36
.= (c3 +* c4,(c5 + 1)) +* c4,(c10 + 1) by FUNCT_7:36 ;
per cases ( ( c4 in dom (c3 +* c4,c5) & (c3 +* c4,c5) +* c4,c10 in dom (c9 . c10) & ((c3 +* c4,c5) +* c4,c10) ^ <*((c9 . c10) . ((c3 +* c4,c5) +* c4,c10))*> in dom c2 ) or not c4 in dom (c3 +* c4,c5) or not (c3 +* c4,c5) +* c4,c10 in dom (c9 . c10) or not ((c3 +* c4,c5) +* c4,c10) ^ <*((c9 . c10) . ((c3 +* c4,c5) +* c4,c10))*> in dom c2 ) ;
suppose E79: ( c4 in dom (c3 +* c4,c5) & (c3 +* c4,c5) +* c4,c10 in dom (c9 . c10) & ((c3 +* c4,c5) +* c4,c10) ^ <*((c9 . c10) . ((c3 +* c4,c5) +* c4,c10))*> in dom c2 ) ;
hence c9 . (c10 + 1) = (c9 . c10) +* ({((c3 +* c4,c5) +* c4,(c10 + 1))} --> (c2 . (((c3 +* c4,c5) +* c4,c10) ^ <*((c9 . c10) . ((c3 +* c4,c5) +* c4,c10))*>))) by E70
.= c8 . (c10 + 1) by E68, E71, E76, E77, E78, E79 ;

end;
suppose E79: ( not c4 in dom (c3 +* c4,c5) or not (c3 +* c4,c5) +* c4,c10 in dom (c9 . c10) or not ((c3 +* c4,c5) +* c4,c10) ^ <*((c9 . c10) . ((c3 +* c4,c5) +* c4,c10))*> in dom c2 ) ;
hence c9 . (c10 + 1) = c9 . c10 by E70
.= c8 . (c10 + 1) by E68, E71, E76, E77, E79 ;

end;
end;
end;
E76: for b1 being Nat holds S2[b1] from NAT_1:sch 1(E74, E75);
let c10 be set ;
assume c10 in NAT ;
hence c9 . c10 = c8 . c10 by E76;
end;
hence c8 = c9 by FUNCT_2:18;
end;

E67: now
let c1, c2 be non empty to-naturals from-natural-fseqs homogeneous Function;
let c3 be Element of ((arity c1) + 1) -tuples_on NAT ;
let c4, c5 be Nat;
assume E68: c4 in dom c3 ;
set c6 = c3 +* c4,c5;
set c7 = c3 +* c4,(c5 + 1);
let c8 be Function of NAT , HFuncs NAT ;
assume that
E69: ( ( c4 in dom (c3 +* c4,(c5 + 1)) & Del (c3 +* c4,(c5 + 1)),c4 in dom c1 implies c8 . 0 = {((c3 +* c4,(c5 + 1)) +* c4,0)} --> (c1 . (Del (c3 +* c4,(c5 + 1)),c4)) ) & ( ( not c4 in dom (c3 +* c4,(c5 + 1)) or not Del (c3 +* c4,(c5 + 1)),c4 in dom c1 ) implies c8 . 0 = {} ) ) and
E70: for b1 being Nat holds S1[b1,c8 . b1,c8 . (b1 + 1),c3 +* c4,(c5 + 1),c4,c2] ;
thus (c8 . (c5 + 1)) . (c3 +* c4,c5) = (c8 . c5) . (c3 +* c4,c5)
proof
per cases ( ( c4 in dom (c3 +* c4,(c5 + 1)) & (c3 +* c4,(c5 + 1)) +* c4,c5 in dom (c8 . c5) & ((c3 +* c4,(c5 + 1)) +* c4,c5) ^ <*((c8 . c5) . ((c3 +* c4,(c5 + 1)) +* c4,c5))*> in dom c2 ) or not c4 in dom (c3 +* c4,(c5 + 1)) or not (c3 +* c4,(c5 + 1)) +* c4,c5 in dom (c8 . c5) or not ((c3 +* c4,(c5 + 1)) +* c4,c5) ^ <*((c8 . c5) . ((c3 +* c4,(c5 + 1)) +* c4,c5))*> in dom c2 ) ;
suppose ( c4 in dom (c3 +* c4,(c5 + 1)) & (c3 +* c4,(c5 + 1)) +* c4,c5 in dom (c8 . c5) & ((c3 +* c4,(c5 + 1)) +* c4,c5) ^ <*((c8 . c5) . ((c3 +* c4,(c5 + 1)) +* c4,c5))*> in dom c2 ) ;
then E71: c8 . (c5 + 1) = (c8 . c5) +* ({((c3 +* c4,(c5 + 1)) +* c4,(c5 + 1))} --> (c2 . (((c3 +* c4,(c5 + 1)) +* c4,c5) ^ <*((c8 . c5) . ((c3 +* c4,(c5 + 1)) +* c4,c5))*>))) by E70;
( (c3 +* c4,c5) . c4 = c5 & (c3 +* c4,(c5 + 1)) . c4 = c5 + 1 ) by E68, FUNCT_7:33;
then ( c3 +* c4,c5 <> c3 +* c4,(c5 + 1) & c3 +* c4,(c5 + 1) = (c3 +* c4,(c5 + 1)) +* c4,(c5 + 1) ) by FUNCT_7:36;
then not c3 +* c4,c5 in {((c3 +* c4,(c5 + 1)) +* c4,(c5 + 1))} by TARSKI:def 1;
then not c3 +* c4,c5 in dom ({((c3 +* c4,(c5 + 1)) +* c4,(c5 + 1))} --> (c2 . (((c3 +* c4,(c5 + 1)) +* c4,c5) ^ <*((c8 . c5) . ((c3 +* c4,(c5 + 1)) +* c4,c5))*>))) by FUNCOP_1:19;
hence (c8 . (c5 + 1)) . (c3 +* c4,c5) = (c8 . c5) . (c3 +* c4,c5) by E71, FUNCT_4:12;
end;
suppose ( not c4 in dom (c3 +* c4,(c5 + 1)) or not (c3 +* c4,(c5 + 1)) +* c4,c5 in dom (c8 . c5) or not ((c3 +* c4,(c5 + 1)) +* c4,c5) ^ <*((c8 . c5) . ((c3 +* c4,(c5 + 1)) +* c4,c5))*> in dom c2 ) ;
hence (c8 . (c5 + 1)) . (c3 +* c4,c5) = (c8 . c5) . (c3 +* c4,c5) by E70;
end;
end;
end;
E71: for b1, b2 being Nat st c3 +* c4,b2 in dom (c8 . b1) holds
b2 <= b1
proof
defpred S2[ Nat] means for b1 being Nat st c3 +* c4,b1 in dom (c8 . a1) holds
b1 <= a1;
E72: S2[0]
proof
let c9 be Nat;
assume E73: c3 +* c4,c9 in dom (c8 . 0) ;
per cases ( ( c4 in dom (c3 +* c4,(c5 + 1)) & Del (c3 +* c4,(c5 + 1)),c4 in dom c1 ) or not c4 in dom (c3 +* c4,(c5 + 1)) or not Del (c3 +* c4,(c5 + 1)),c4 in dom c1 ) ;
suppose ( c4 in dom (c3 +* c4,(c5 + 1)) & Del (c3 +* c4,(c5 + 1)),c4 in dom c1 ) ;
then dom (c8 . 0) = {((c3 +* c4,(c5 + 1)) +* c4,0)} by E69, FUNCOP_1:19;
then E74: c3 +* c4,c9 = (c3 +* c4,(c5 + 1)) +* c4,0 by E73, TARSKI:def 1
.= c3 +* c4,0 by FUNCT_7:36 ;
c9 = (c3 +* c4,c9) . c4 by E68, FUNCT_7:33
.= 0 by E68, E74, FUNCT_7:33 ;
hence c9 <= 0 ;
end;
suppose ( not c4 in dom (c3 +* c4,(c5 + 1)) or not Del (c3 +* c4,(c5 + 1)),c4 in dom c1 ) ;
hence c9 <= 0 by E69, E73, RELAT_1:60;
end;
end;
end;
E73: for b1 being Nat st S2[b1] holds
S2[b1 + 1]
proof
let c9 be Nat;
assume E74: S2[c9] ;
let c10 be Nat;
assume E75: c3 +* c4,c10 in dom (c8 . (c9 + 1)) ;
per cases ( ( c4 in dom (c3 +* c4,(c5 + 1)) & (c3 +* c4,(c5 + 1)) +* c4,c9 in dom (c8 . c9) & ((c3 +* c4,(c5 + 1)) +* c4,c9) ^ <*((c8 . c9) . ((c3 +* c4,(c5 + 1)) +* c4,c9))*> in dom c2 ) or not c4 in dom (c3 +* c4,(c5 + 1)) or not (c3 +* c4,(c5 + 1)) +* c4,c9 in dom (c8 . c9) or not ((c3 +* c4,(c5 + 1)) +* c4,c9) ^ <*((c8 . c9) . ((c3 +* c4,(c5 + 1)) +* c4,c9))*> in dom c2 ) ;
suppose ( c4 in dom (c3 +* c4,(c5 + 1)) & (c3 +* c4,(c5 + 1)) +* c4,c9 in dom (c8 . c9) & ((c3 +* c4,(c5 + 1)) +* c4,c9) ^ <*((c8 . c9) . ((c3 +* c4,(c5 + 1)) +* c4,c9))*> in dom c2 ) ;
then c8 . (c9 + 1) = (c8 . c9) +* ({((c3 +* c4,(c5 + 1)) +* c4,(c9 + 1))} --> (c2 . (((c3 +* c4,(c5 + 1)) +* c4,c9) ^ <*((c8 . c9) . ((c3 +* c4,(c5 + 1)) +* c4,c9))*>))) by E70;
then dom (c8 . (c9 + 1)) = (dom (c8 . c9)) \/ (dom ({((c3 +* c4,(c5 + 1)) +* c4,(c9 + 1))} --> (c2 . (((c3 +* c4,(c5 + 1)) +* c4,c9) ^ <*((c8 . c9) . ((c3 +* c4,(c5 + 1)) +* c4,c9))*>)))) by FUNCT_4:def 1;
then E76: dom (c8 . (c9 + 1)) = (dom (c8 . c9)) \/ {((c3 +* c4,(c5 + 1)) +* c4,(c9 + 1))} by FUNCOP_1:19;
thus c10 <= c9 + 1
proof
per cases ( c3 +* c4,c10 in dom (c8 . c9) or c3 +* c4,c10 in {((c3 +* c4,(c5 + 1)) +* c4,(c9 + 1))} ) by E75, E76, XBOOLE_0:def 2;
suppose c3 +* c4,c10 in dom (c8 . c9) ;
then ( c10 <= c9 & c9 <= c9 + 1 ) by E74, NAT_1:29;
hence c10 <= c9 + 1 by XREAL_1:2;
end;
suppose c3 +* c4,c10 in {((c3 +* c4,(c5 + 1)) +* c4,(c9 + 1))} ;
then E77: c3 +* c4,c10 = (c3 +* c4,(c5 + 1)) +* c4,(c9 + 1) by TARSKI:def 1
.= c3 +* c4,(c9 + 1) by FUNCT_7:36 ;
c10 = (c3 +* c4,c10) . c4 by E68, FUNCT_7:33
.= c9 + 1 by E68, E77, FUNCT_7:33 ;
hence c10 <= c9 + 1 ;
end;
end;
end;
end;
suppose ( not c4 in dom (c3 +* c4,(c5 + 1)) or not (c3 +* c4,(c5 + 1)) +* c4,c9 in dom (c8 . c9) or not ((c3 +* c4,(c5 + 1)) +* c4,c9) ^ <*((c8 . c9) . ((c3 +* c4,(c5 + 1)) +* c4,c9))*> in dom c2 ) ;
then c8 . (c9 + 1) = c8 . c9 by E70;
then ( c10 <= c9 & c9 <= c9 + 1 ) by E74, E75, NAT_1:29;
hence c10 <= c9 + 1 by XREAL_1:2;
end;
end;
end;
thus for b1 being Nat holds S2[b1] from NAT_1:sch 1(E72, E73);
end;
thus not c3 +* c4,(c5 + 1) in dom (c8 . c5)
proof
assume c3 +* c4,(c5 + 1) in dom (c8 . c5) ;
then c5 + 1 <= c5 by E71;
hence contradiction by NAT_1:38;
end;
end;

E68: now
let c1, c2 be non empty to-naturals from-natural-fseqs homogeneous Function;
let c3 be Element of ((arity c1) + 1) -tuples_on NAT ;
let c4, c5 be Nat;
assume E69: c4 in dom c3 ;
let c6 be Function of ((arity c1) + 1) -tuples_on NAT , HFuncs NAT ;
assume E70: for b1 being Element of ((arity c1) + 1) -tuples_on NAT holds c6 . b1 = primrec c1,c2,c4,b1 ;
thus for b1, b2 being Nat holds dom (c6 . (c3 +* c4,b1)) c= dom (c6 . (c3 +* c4,(b1 + b2)))
proof
let c7 be Nat;
set c8 = c3 +* c4,c7;
defpred S2[ Nat] means dom (c6 . (c3 +* c4,c7)) c= dom (c6 . (c3 +* c4,(c7 + a1)));
E71: S2[0] ;
E72: now
let c9 be Nat;
assume E73: S2[c9] ;
set c10 = c3 +* c4,(c7 + c9);
set c11 = c3 +* c4,((c7 + c9) + 1);
set c12 = c7 + c9;
consider c13 being Function of NAT , HFuncs NAT such that
E74: primrec c1,c2,c4,(c3 +* c4,(c7 + c9)) = c13 . ((c3 +* c4,(c7 + c9)) /. c4) and
E75: ( ( c4 in dom (c3 +* c4,(c7 + c9)) & Del (c3 +* c4,(c7 + c9)),c4 in dom c1 implies c13 . 0 = {((c3 +* c4,(c7 + c9)) +* c4,0)} --> (c1 . (Del (c3 +* c4,(c7 + c9)),c4)) ) & ( ( not c4 in dom (c3 +* c4,(c7 + c9)) or not Del (c3 +* c4,(c7 + c9)),c4 in dom c1 ) implies c13 . 0 = {} ) ) and
E76: for b1 being Nat holds S1[b1,c13 . b1,c13 . (b1 + 1),c3 +* c4,(c7 + c9),c4,c2] by Def13;
consider c14 being Function of NAT , HFuncs NAT such that
E77: primrec c1,c2,c4,(c3 +* c4,((c7 + c9) + 1)) = c14 . ((c3 +* c4,((c7 + c9) + 1)) /. c4) and
E78: ( ( c4 in dom (c3 +* c4,((c7 + c9) + 1)) & Del (c3 +* c4,((c7 + c9) + 1)),c4 in dom c1 implies c14 . 0 = {((c3 +* c4,((c7 + c9) + 1)) +* c4,0)} --> (c1 . (Del (c3 +* c4,((c7 + c9) + 1)),c4)) ) & ( ( not c4 in dom (c3 +* c4,((c7 + c9) + 1)) or not Del (c3 +* c4,((c7 + c9) + 1)),c4 in dom c1 ) implies c14 . 0 = {} ) ) and
E79: for b1 being Nat holds S1[b1,c14 . b1,c14 . (b1 + 1),c3 +* c4,((c7 + c9) + 1),c4,c2] by Def13;
E80: c14 = c13 by E75, E76, E78, E79, Lemma66;
E81: ( dom c3 = dom (c3 +* c4,c7) & dom c3 = dom (c3 +* c4,((c7 + c9) + 1)) & dom c3 = dom (c3 +* c4,(c7 + c9)) ) by FUNCT_7:32;
then E82: (c3 +* c4,((c7 + c9) + 1)) /. c4 = (c3 +* c4,((c7 + c9) + 1)) . c4 by E69, FINSEQ_4:def 4
.= (c7 + c9) + 1 by E69, FUNCT_7:33 ;
E83: (c3 +* c4,(c7 + c9)) /. c4 = (c3 +* c4,(c7 + c9)) . c4 by E69, E81, FINSEQ_4:def 4
.= c7 + c9 by E69, FUNCT_7:33 ;
E84: c6 . (c3 +* c4,(c7 + (c9 + 1))) = c13 . ((c7 + c9) + 1) by E70, E77, E80, E82;
E85: c6 . (c3 +* c4,(c7 + c9)) = c13 . (c7 + c9) by E70, E74, E83;
per cases ( ( c4 in dom (c3 +* c4,(c7 + c9)) & (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) & ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) or not c4 in dom (c3 +* c4,(c7 + c9)) or not (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) or not ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) ;
suppose ( c4 in dom (c3 +* c4,(c7 + c9)) & (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) & ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) ;
then c13 . ((c7 + c9) + 1) = (c13 . (c7 + c9)) +* ({((c3 +* c4,(c7 + c9)) +* c4,((c7 + c9) + 1))} --> (c2 . (((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*>))) by E76;
then dom (c13 . ((c7 + c9) + 1)) = (dom (c13 . (c7 + c9))) \/ (dom ({((c3 +* c4,(c7 + c9)) +* c4,((c7 + c9) + 1))} --> (c2 . (((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*>)))) by FUNCT_4:def 1;
then dom (c13 . (c7 + c9)) c= dom (c13 . ((c7 + c9) + 1)) by XBOOLE_1:7;
hence S2[c9 + 1] by E73, E84, E85, XBOOLE_1:1;
end;
suppose ( not c4 in dom (c3 +* c4,(c7 + c9)) or not (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) or not ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) ;
hence S2[c9 + 1] by E73, E76, E84, E85;
end;
end;
end;
thus for b1 being Nat holds S2[b1] from NAT_1:sch 1(E71, E72);
end;
end;

E69: now
let c1, c2 be non empty to-naturals from-natural-fseqs homogeneous Function;
let c3 be Element of ((arity c1) + 1) -tuples_on NAT ;
let c4, c5 be Nat;
assume E70: c4 in dom c3 ;
let c6 be Function of ((arity c1) + 1) -tuples_on NAT , HFuncs NAT ;
assume E71: for b1 being Element of ((arity c1) + 1) -tuples_on NAT holds c6 . b1 = primrec c1,c2,c4,b1 ;
thus for b1, b2 being Nat st not c3 +* c4,b1 in dom (c6 . (c3 +* c4,b1)) holds
not c3 +* c4,b1 in dom (c6 . (c3 +* c4,(b1 + b2)))
proof
let c7 be Nat;
set c8 = c3 +* c4,c7;
defpred S2[ Nat] means ( not c3 +* c4,c7 in dom (c6 . (c3 +* c4,c7)) implies not c3 +* c4,c7 in dom (c6 . (c3 +* c4,(c7 + a1))) );
E72: S2[0] ;
E73: for b1 being Nat st S2[b1] holds
S2[b1 + 1]
proof
let c9 be Nat;
assume that
E74: S2[c9] and
E75: not c3 +* c4,c7 in dom (c6 . (c3 +* c4,c7)) ;
set c10 = c3 +* c4,(c7 + c9);
set c11 = c3 +* c4,((c7 + c9) + 1);
set c12 = c7 + c9;
consider c13 being Function of NAT , HFuncs NAT such that
E76: primrec c1,c2,c4,(c3 +* c4,(c7 + c9)) = c13 . ((c3 +* c4,(c7 + c9)) /. c4) and
E77: ( ( c4 in dom (c3 +* c4,(c7 + c9)) & Del (c3 +* c4,(c7 + c9)),c4 in dom c1 implies c13 . 0 = {((c3 +* c4,(c7 + c9)) +* c4,0)} --> (c1 . (Del (c3 +* c4,(c7 + c9)),c4)) ) & ( ( not c4 in dom (c3 +* c4,(c7 + c9)) or not Del (c3 +* c4,(c7 + c9)),c4 in dom c1 ) implies c13 . 0 = {} ) ) and
E78: for b1 being Nat holds S1[b1,c13 . b1,c13 . (b1 + 1),c3 +* c4,(c7 + c9),c4,c2] by Def13;
consider c14 being Function of NAT , HFuncs NAT such that
E79: primrec c1,c2,c4,(c3 +* c4,((c7 + c9) + 1)) = c14 . ((c3 +* c4,((c7 + c9) + 1)) /. c4) and
E80: ( ( c4 in dom (c3 +* c4,((c7 + c9) + 1)) & Del (c3 +* c4,((c7 + c9) + 1)),c4 in dom c1 implies c14 . 0 = {((c3 +* c4,((c7 + c9) + 1)) +* c4,0)} --> (c1 . (Del (c3 +* c4,((c7 + c9) + 1)),c4)) ) & ( ( not c4 in dom (c3 +* c4,((c7 + c9) + 1)) or not Del (c3 +* c4,((c7 + c9) + 1)),c4 in dom c1 ) implies c14 . 0 = {} ) ) and
E81: for b1 being Nat holds S1[b1,c14 . b1,c14 . (b1 + 1),c3 +* c4,((c7 + c9) + 1),c4,c2] by Def13;
E82: c14 = c13 by E77, E78, E80, E81, Lemma66;
E83: ( dom c3 = dom (c3 +* c4,c7) & dom c3 = dom (c3 +* c4,((c7 + c9) + 1)) & dom c3 = dom (c3 +* c4,(c7 + c9)) ) by FUNCT_7:32;
then E84: (c3 +* c4,((c7 + c9) + 1)) /. c4 = (c3 +* c4,((c7 + c9) + 1)) . c4 by E70, FINSEQ_4:def 4
.= (c7 + c9) + 1 by E70, FUNCT_7:33 ;
(c3 +* c4,(c7 + c9)) /. c4 = (c3 +* c4,(c7 + c9)) . c4 by E70, E83, FINSEQ_4:def 4
.= c7 + c9 by E70, FUNCT_7:33 ;
then E85: not c3 +* c4,c7 in dom (c13 . (c7 + c9)) by E71, E74, E75, E76;
E86: c6 . (c3 +* c4,(c7 + (c9 + 1))) = c13 . ((c7 + c9) + 1) by E71, E79, E82, E84;
per cases ( ( c4 in dom (c3 +* c4,(c7 + c9)) & (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) & ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) or not c4 in dom (c3 +* c4,(c7 + c9)) or not (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) or not ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) ;
suppose ( c4 in dom (c3 +* c4,(c7 + c9)) & (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) & ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) ;
then c13 . ((c7 + c9) + 1) = (c13 . (c7 + c9)) +* ({((c3 +* c4,(c7 + c9)) +* c4,((c7 + c9) + 1))} --> (c2 . (((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*>))) by E78;
then dom (c13 . ((c7 + c9) + 1)) = (dom (c13 . (c7 + c9))) \/ (dom ({((c3 +* c4,(c7 + c9)) +* c4,((c7 + c9) + 1))} --> (c2 . (((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*>)))) by FUNCT_4:def 1;
then E87: dom (c13 . ((c7 + c9) + 1)) = (dom (c13 . (c7 + c9))) \/ {((c3 +* c4,(c7 + c9)) +* c4,((c7 + c9) + 1))} by FUNCOP_1:19;
c7 <= c7 + c9 by NAT_1:29;
then E88: c7 <> (c7 + c9) + 1 by NAT_1:38;
( (c3 +* c4,c7) . c4 = c7 & ((c3 +* c4,(c7 + c9)) +* c4,((c7 + c9) + 1)) . c4 = (c7 + c9) + 1 ) by E70, E83, FUNCT_7:33;
then not c3 +* c4,c7 in {((c3 +* c4,(c7 + c9)) +* c4,((c7 + c9) + 1))} by E88, TARSKI:def 1;
hence not c3 +* c4,c7 in dom (c6 . (c3 +* c4,(c7 + (c9 + 1)))) by E85, E86, E87, XBOOLE_0:def 2;
end;
suppose ( not c4 in dom (c3 +* c4,(c7 + c9)) or not (c3 +* c4,(c7 + c9)) +* c4,(c7 + c9) in dom (c13 . (c7 + c9)) or not ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)) ^ <*((c13 . (c7 + c9)) . ((c3 +* c4,(c7 + c9)) +* c4,(c7 + c9)))*> in dom c2 ) ;
hence not c3 +* c4,c7 in dom (c6 . (c3 +* c4,(c7 + (c9 + 1)))) by E78, E85, E86;
end;
end;
end;
thus for b1 being Nat holds S2[b1] from NAT_1:sch 1(E72, E73);
end;
end;

Lemma70: for b1, b2 being Nat
for b3, b4 being non empty to-naturals from-natural-fseqs homogeneous Function
for b5 being Element of ((arity b3) + 1) -tuples_on NAT st b1 in dom b5 holds
( ( b5 +* b1,0 in dom (primrec b3,b4,b1) implies Del b5,b1 in dom b3 ) & ( Del b5,b1 in dom b3 implies b5 +* b1,0 in dom (primrec b3,b4,b1) ) & ( b5 +* b1,0 in dom (primrec b3,b4,b1) implies (primrec b3,b4,b1) . (b5 +* b1,0) = b3 . (Del b5,b1) ) & ( b5 +* b1,(b2 + 1) in dom (primrec b3,b4,b1) implies ( b5 +* b1,b2 in dom (primrec b3,b4,b1) & (b5 +* b1,b2) ^ <*((primrec b3,b4,b1) . (b5 +* b1,b2))*> in dom b4 ) ) & ( b5 +* b1,b2 in dom (primrec b3,b4,b1) & (b5 +* b1,b2) ^ <*((primrec b3,b4,b1) . (b5 +* b1,b2))*> in dom b4 implies b5 +* b1,(b2 + 1) in dom (primrec b3,b4,b1) ) & ( b5 +* b1,(b2 + 1) in dom (primrec b3,b4,b1) implies (primrec b3,b4,b1) . (b5 +* b1,(b2 + 1)) = b4 . ((b5 +* b1,b2) ^ <*((primrec b3,b4,b1) . (b5 +* b1,b2))*>) ) )
proof end;

theorem Th62: :: COMPUT_1:62
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function
for b4 being Element of ((arity b2) + 1) -tuples_on NAT st b1 in dom b4 holds
( b4 +* b1,0 in dom (primrec b2,b3,b1) iff Del b4,b1 in dom b2 ) by Lemma70;

theorem Th63: :: COMPUT_1:63
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function
for b4 being Element of ((arity b2) + 1) -tuples_on NAT st b1 in dom b4 & b4 +* b1,0 in dom (primrec b2,b3,b1) holds
(primrec b2,b3,b1) . (b4 +* b1,0) = b2 . (Del b4,b1) by Lemma70;

theorem Th64: :: COMPUT_1:64
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function
for b4 being Element of ((arity b2) + 1) -tuples_on NAT st b1 in dom b4 & b2 is len-total holds
(primrec b2,b3,b1) . (b4 +* b1,0) = b2 . (Del b4,b1)
proof end;

theorem Th65: :: COMPUT_1:65
for b1, b2 being Nat
for b3, b4 being non empty to-naturals from-natural-fseqs homogeneous Function
for b5 being Element of ((arity b3) + 1) -tuples_on NAT st b1 in dom b5 holds
( b5 +* b1,(b2 + 1) in dom (primrec b3,b4,b1) iff ( b5 +* b1,b2 in dom (primrec b3,b4,b1) & (b5 +* b1,b2) ^ <*((primrec b3,b4,b1) . (b5 +* b1,b2))*> in dom b4 ) ) by Lemma70;

theorem Th66: :: COMPUT_1:66
for b1, b2 being Nat
for b3, b4 being non empty to-naturals from-natural-fseqs homogeneous Function
for b5 being Element of ((arity b3) + 1) -tuples_on NAT st b1 in dom b5 & b5 +* b1,(b2 + 1) in dom (primrec b3,b4,b1) holds
(primrec b3,b4,b1) . (b5 +* b1,(b2 + 1)) = b4 . ((b5 +* b1,b2) ^ <*((primrec b3,b4,b1) . (b5 +* b1,b2))*>) by Lemma70;

theorem Th67: :: COMPUT_1:67
for b1, b2 being Nat
for b3, b4 being non empty to-naturals from-natural-fseqs homogeneous Function
for b5 being Element of ((arity b3) + 1) -tuples_on NAT st b3 is len-total & b4 is len-total & (arity b3) + 2 = arity b4 & 1 <= b1 & b1 <= 1 + (arity b3) holds
(primrec b3,b4,b1) . (b5 +* b1,(b2 + 1)) = b4 . ((b5 +* b1,b2) ^ <*((primrec b3,b4,b1) . (b5 +* b1,b2))*>)
proof end;

theorem Th68: :: COMPUT_1:68
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function st (arity b2) + 2 = arity b3 & 1 <= b1 & b1 <= (arity b2) + 1 holds
primrec b2,b3,b1 is_primitive-recursively_expressed_by b2,b3,b1
proof end;

theorem Th69: :: COMPUT_1:69
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function st 1 <= b1 & b1 <= (arity b2) + 1 holds
for b4 being Element of HFuncs NAT st b4 is_primitive-recursively_expressed_by b2,b3,b1 holds
b4 = primrec b2,b3,b1
proof end;

definition
let c1 be set ;
attr a1 is composition_closed means :Def15: :: COMPUT_1:def 15
for b1 being Element of HFuncs NAT
for b2 being with_the_same_arity FinSequence of HFuncs NAT st b1 in a1 & arity b1 = len b2 & rng b2 c= a1 holds
b1 * <:b2:> in a1;
attr a1 is primitive-recursion_closed means :Def16: :: COMPUT_1:def 16
for b1, b2, b3 being Element of HFuncs NAT
for b4 being Nat st b1 is_primitive-recursively_expressed_by b2,b3,b4 & b2 in a1 & b3 in a1 holds
b1 in a1;
end;

:: deftheorem Def15 defines composition_closed COMPUT_1:def 15 :
for b1 being set holds
( b1 is composition_closed iff for b2 being Element of HFuncs NAT
for b3 being with_the_same_arity FinSequence of HFuncs NAT st b2 in b1 & arity b2 = len b3 & rng b3 c= b1 holds
b2 * <:b3:> in b1 );

:: deftheorem Def16 defines primitive-recursion_closed COMPUT_1:def 16 :
for b1 being set holds
( b1 is primitive-recursion_closed iff for b2, b3, b4 being Element of HFuncs NAT
for b5 being Nat st b2 is_primitive-recursively_expressed_by b3,b4,b5 & b3 in b1 & b4 in b1 holds
b2 in b1 );

definition
let c1 be set ;
attr a1 is primitive-recursively_closed means :Def17: :: COMPUT_1:def 17
( 0 const 0 in a1 & 1 succ 1 in a1 & ( for b1, b2 being Nat st 1 <= b2 & b2 <= b1 holds
b1 proj b2 in a1 ) & a1 is composition_closed & a1 is primitive-recursion_closed );
end;

:: deftheorem Def17 defines primitive-recursively_closed COMPUT_1:def 17 :
for b1 being set holds
( b1 is primitive-recursively_closed iff ( 0 const 0 in b1 & 1 succ 1 in b1 & ( for b2, b3 being Nat st 1 <= b3 & b3 <= b2 holds
b2 proj b3 in b1 ) & b1 is composition_closed & b1 is primitive-recursion_closed ) );

theorem Th70: :: COMPUT_1:70
HFuncs NAT is primitive-recursively_closed
proof end;

registration
cluster non empty primitive-recursively_closed Element of bool (HFuncs NAT );
existence
ex b1 being Subset of (HFuncs NAT ) st
( b1 is primitive-recursively_closed & not b1 is empty )
proof end;
end;

Lemma78: for b1 being non empty set
for b2, b3 being Nat st 1 <= b3 & b3 <= b2 holds
for b4 being Element of b1
for b5 being Element of b2 -tuples_on b1 holds b5 +* b3,b4 in b2 -tuples_on b1
;

theorem Th71: :: COMPUT_1:71
for b1 being Nat
for b2, b3 being to-naturals from-natural-fseqs homogeneous Function
for b4 being Element of HFuncs NAT st b2 = {} & b4 is_primitive-recursively_expressed_by b2,b3,b1 holds
b4 = {}
proof end;

theorem Th72: :: COMPUT_1:72
for b1 being Element of HFuncs NAT
for b2, b3 being quasi_total Element of HFuncs NAT
for b4 being Nat st b1 is_primitive-recursively_expressed_by b2,b3,b4 holds
( b1 is quasi_total & ( not b2 is empty implies not b1 is empty ) )
proof end;

theorem Th73: :: COMPUT_1:73
for b1, b2 being Nat
for b3 being non empty primitive-recursively_closed Subset of (HFuncs NAT ) holds b1 const b2 in b3
proof end;

theorem Th74: :: COMPUT_1:74
for b1, b2 being Nat
for b3 being non empty primitive-recursively_closed Subset of (HFuncs NAT ) st 1 <= b1 & b1 <= b2 holds
b2 succ b1 in b3
proof end;

theorem Th75: :: COMPUT_1:75
for b1 being non empty primitive-recursively_closed Subset of (HFuncs NAT ) holds {} in b1
proof end;

theorem Th76: :: COMPUT_1:76
for b1 being non empty primitive-recursively_closed Subset of (HFuncs NAT )
for b2 being Element of b1
for b3 being with_the_same_arity FinSequence of b1 st arity b2 = len b3 holds
b2 * <:b3:> in b1
proof end;

theorem Th77: :: COMPUT_1:77
for b1 being non empty primitive-recursively_closed Subset of (HFuncs NAT )
for b2, b3 being Element of b1 st (arity b2) + 2 = arity b3 holds
for b4 being Nat st 1 <= b4 & b4 <= (arity b2) + 1 holds
primrec b2,b3,b4 in b1
proof end;

definition
func PrimRec -> Subset of (HFuncs NAT ) equals :: COMPUT_1:def 18
meet { b1 where B is Subset of (HFuncs NAT ) : b1 is primitive-recursively_closed } ;
coherence
meet { b1 where B is Subset of (HFuncs NAT ) : b1 is primitive-recursively_closed } is Subset of (HFuncs NAT )
proof end;
end;

:: deftheorem Def18 defines PrimRec COMPUT_1:def 18 :
PrimRec = meet { b1 where B is Subset of (HFuncs NAT ) : b1 is primitive-recursively_closed } ;

theorem Th78: :: COMPUT_1:78
for b1 being Subset of (HFuncs NAT ) st b1 is primitive-recursively_closed holds
PrimRec c= b1
proof end;

registration
cluster PrimRec -> non empty primitive-recursively_closed ;
coherence
( not PrimRec is empty & PrimRec is primitive-recursively_closed )
proof end;
end;

registration
cluster -> homogeneous Element of PrimRec ;
coherence
for b1 being Element of PrimRec holds b1 is homogeneous
;
end;

definition
let c1 be set ;
attr a1 is primitive-recursive means :Def19: :: COMPUT_1:def 19
a1 in PrimRec ;
end;

:: deftheorem Def19 defines primitive-recursive COMPUT_1:def 19 :
for b1 being set holds
( b1 is primitive-recursive iff b1 in PrimRec );

registration
cluster primitive-recursive -> Relation-like Function-like set ;
coherence
for b1 being set st b1 is primitive-recursive holds
( b1 is Relation-like & b1 is Function-like )
proof end;
end;

registration
cluster primitive-recursive -> to-naturals from-natural-fseqs homogeneous set ;
coherence
for b1 being Relation st b1 is primitive-recursive holds
( b1 is homogeneous & b1 is to-naturals & b1 is from-natural-fseqs )
proof end;
end;

registration
cluster -> Relation-like Function-like to-naturals from-natural-fseqs homogeneous primitive-recursive Element of PrimRec ;
coherence
for b1 being Element of PrimRec holds b1 is primitive-recursive
by Def19;
end;

registration
cluster to-naturals from-natural-fseqs homogeneous primitive-recursive set ;
existence
ex b1 being Function st b1 is primitive-recursive
proof end;
cluster to-naturals from-natural-fseqs homogeneous primitive-recursive Element of HFuncs NAT ;
existence
ex b1 being Element of HFuncs NAT st b1 is primitive-recursive
proof end;
end;

definition
func initial-funcs -> Subset of (HFuncs NAT ) equals :: COMPUT_1:def 20
{(0 const 0),(1 succ 1)} \/ { (b1 proj b2) where B is Nat, B is Nat : ( 1 <= b2 & b2 <= b1 ) } ;
coherence
{(0 const 0),(1 succ 1)} \/ { (b1 proj b2) where B is Nat, B is Nat : ( 1 <= b2 & b2 <= b1 ) } is Subset of (HFuncs NAT )
proof end;
let c1 be Subset of (HFuncs NAT );
func PR-closure c1 -> Subset of (HFuncs NAT ) equals :: COMPUT_1:def 21
a1 \/ { b1 where B is Element of HFuncs NAT : ex b1, b2 being Element of HFuncs NAT ex b3 being Nat st
( b2 in a1 & b3 in a1 & b1 is_primitive-recursively_expressed_by b2,b3,b4 )
}
;
coherence
c1 \/ { b1 where B is Element of HFuncs NAT : ex b1, b2 being Element of HFuncs NAT ex b3 being Nat st
( b2 in c1 & b3 in c1 & b1 is_primitive-recursively_expressed_by b2,b3,b4 )
}
is Subset of (HFuncs NAT )
proof end;
func composition-closure c1 -> Subset of (HFuncs NAT ) equals :: COMPUT_1:def 22
a1 \/ { (b1 * <:b2:>) where B is Element of HFuncs NAT , B is with_the_same_arity Element of (HFuncs NAT ) * : ( b1 in a1 & arity b1 = len b2 & rng b2 c= a1 ) } ;
coherence
c1 \/ { (b1 * <:b2:>) where B is Element of HFuncs NAT , B is with_the_same_arity Element of (HFuncs NAT ) * : ( b1 in c1 & arity b1 = len b2 & rng b2 c= c1 ) } is Subset of (HFuncs NAT )
proof end;
end;

:: deftheorem Def20 defines initial-funcs COMPUT_1:def 20 :
initial-funcs = {(0 const 0),(1 succ 1)} \/ { (b1 proj b2) where B is Nat, B is Nat : ( 1 <= b2 & b2 <= b1 ) } ;

:: deftheorem Def21 defines PR-closure COMPUT_1:def 21 :
for b1 being Subset of (HFuncs NAT ) holds PR-closure b1 = b1 \/ { b2 where B is Element of HFuncs NAT : ex b1, b2 being Element of HFuncs NAT ex b3 being Nat st
( b3 in b1 & b4 in b1 & b2 is_primitive-recursively_expressed_by b3,b4,b5 )
}
;

:: deftheorem Def22 defines composition-closure COMPUT_1:def 22 :
for b1 being Subset of (HFuncs NAT ) holds composition-closure b1 = b1 \/ { (b2 * <:b3:>) where B is Element of HFuncs NAT , B is with_the_same_arity Element of (HFuncs NAT ) * : ( b2 in b1 & arity b2 = len b3 & rng b3 c= b1 ) } ;

definition
func PrimRec-Approximation -> Function of NAT , bool (HFuncs NAT ) means :Def23: :: COMPUT_1:def 23
( a1 . 0 = initial-funcs & ( for b1 being Nat holds a1 . (b1 + 1) = (PR-closure (a1 . b1)) \/ (composition-closure (a1 . b1)) ) );
existence
ex b1 being Function of NAT , bool (HFuncs NAT ) st
( b1 . 0 = initial-funcs & ( for b2 being Nat holds b1 . (b2 + 1) = (PR-closure (b1 . b2)) \/ (composition-closure (b1 . b2)) ) )
proof end;
uniqueness
for b1, b2 being Function of NAT , bool (HFuncs NAT ) st b1 . 0 = initial-funcs & ( for b3 being Nat holds b1 . (b3 + 1) = (PR-closure (b1 . b3)) \/ (composition-closure (b1 . b3)) ) & b2 . 0 = initial-funcs & ( for b3 being Nat holds b2 . (b3 + 1) = (PR-closure (b2 . b3)) \/ (composition-closure (b2 . b3)) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def23 defines PrimRec-Approximation COMPUT_1:def 23 :
for b1 being Function of NAT , bool (HFuncs NAT ) holds
( b1 = PrimRec-Approximation iff ( b1 . 0 = initial-funcs & ( for b2 being Nat holds b1 . (b2 + 1) = (PR-closure (b1 . b2)) \/ (composition-closure (b1 . b2)) ) ) );

theorem Th79: :: COMPUT_1:79
for b1, b2 being Nat st b1 <= b2 holds
PrimRec-Approximation . b1 c= PrimRec-Approximation . b2
proof end;

theorem Th80: :: COMPUT_1:80
Union PrimRec-Approximation is primitive-recursively_closed
proof end;

theorem Th81: :: COMPUT_1:81
PrimRec = Union PrimRec-Approximation
proof end;

theorem Th82: :: COMPUT_1:82
for b1 being Nat
for b2 being Element of HFuncs NAT st b2 in PrimRec-Approximation . b1 holds
b2 is quasi_total
proof end;

registration
cluster -> Relation-like Function-like quasi_total to-naturals from-natural-fseqs homogeneous primitive-recursive Element of PrimRec ;
coherence
for b1 being Element of PrimRec holds
( b1 is quasi_total & b1 is homogeneous )
proof end;
end;

registration
cluster primitive-recursive -> quasi_total homogeneous Element of HFuncs NAT ;
coherence
for b1 being Element of HFuncs NAT st b1 is primitive-recursive holds
b1 is quasi_total
proof end;
end;

registration
cluster from-natural-fseqs primitive-recursive -> from-natural-fseqs len-total set ;
coherence
for b1 being from-natural-fseqs Function st b1 is primitive-recursive holds
b1 is len-total
proof end;
cluster non empty quasi_total to-naturals from-natural-fseqs len-total homogeneous primitive-recursive Element of PrimRec ;
existence
not for b1 being Element of PrimRec holds b1 is empty
proof end;
end;

definition
let c1 be homogeneous Relation;
attr a1 is nullary means :Def24: :: COMPUT_1:def 24
arity a1 = 0;
attr a1 is unary means :Def25: :: COMPUT_1:def 25
arity a1 = 1;
attr a1 is binary means :Def26: :: COMPUT_1:def 26
arity a1 = 2;
attr a1 is 3-ary means :Def27: :: COMPUT_1:def 27
arity a1 = 3;
end;

:: deftheorem Def24 defines nullary COMPUT_1:def 24 :
for b1 being homogeneous Relation holds
( b1 is nullary iff arity b1 = 0 );

:: deftheorem Def25 defines unary COMPUT_1:def 25 :
for b1 being homogeneous Relation holds
( b1 is unary iff arity b1 = 1 );

:: deftheorem Def26 defines binary COMPUT_1:def 26 :
for b1 being homogeneous Relation holds
( b1 is binary iff arity b1 = 2 );

:: deftheorem Def27 defines 3-ary COMPUT_1:def 27 :
for b1 being homogeneous Relation holds
( b1 is 3-ary iff arity b1 = 3 );

registration
cluster homogeneous unary -> non empty homogeneous set ;
coherence
for b1 being homogeneous Function st b1 is unary holds
not b1 is empty
proof end;
cluster homogeneous binary -> non empty homogeneous set ;
coherence
for b1 being homogeneous Function st b1 is binary holds
not b1 is empty
proof end;
cluster homogeneous 3-ary -> non empty homogeneous set ;
coherence
for b1 being homogeneous Function st b1 is 3-ary holds
not b1 is empty
proof end;
end;

registration
cluster 1 proj 1 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
1 proj 1 is primitive-recursive
proof end;
cluster 2 proj 1 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
2 proj 1 is primitive-recursive
proof end;
cluster 2 proj 2 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
2 proj 2 is primitive-recursive
proof end;
cluster 1 succ 1 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
1 succ 1 is primitive-recursive
proof end;
cluster 3 succ 3 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
3 succ 3 is primitive-recursive
proof end;
let c1 be Nat;
cluster 0 const a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous nullary ;
coherence
0 const c1 is nullary
proof end;
cluster 1 const a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous unary ;
coherence
1 const c1 is unary
proof end;
cluster 2 const a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous binary ;
coherence
2 const c1 is binary
proof end;
cluster 3 const a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous 3-ary ;
coherence
3 const c1 is 3-ary
proof end;
cluster 1 proj a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous unary ;
coherence
1 proj c1 is unary
proof end;
cluster 2 proj a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous binary ;
coherence
2 proj c1 is binary
proof end;
cluster 3 proj a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous 3-ary ;
coherence
3 proj c1 is 3-ary
proof end;
cluster 1 succ a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous unary ;
coherence
1 succ c1 is unary
proof end;
cluster 2 succ a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous binary ;
coherence
2 succ c1 is binary
proof end;
cluster 3 succ a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous 3-ary ;
coherence
3 succ c1 is 3-ary
proof end;
let c2 be Nat;
cluster a1 const a2 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
c1 const c2 is primitive-recursive
proof end;
end;

registration
cluster non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive nullary set ;
existence
ex b1 being homogeneous Function st
( b1 is nullary & b1 is primitive-recursive & not b1 is empty )
by Def17;
cluster non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive unary set ;
existence
ex b1 being homogeneous Function st
( b1 is unary & b1 is primitive-recursive )
by Def17;
cluster non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive binary set ;
existence
ex b1 being homogeneous Function st
( b1 is binary & b1 is primitive-recursive )
proof end;
cluster non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive 3-ary set ;
existence
ex b1 being homogeneous Function st
( b1 is 3-ary & b1 is primitive-recursive )
proof end;
end;

registration
cluster non empty to-naturals from-natural-fseqs len-total homogeneous nullary set ;
existence
ex b1 being from-natural-fseqs homogeneous Function st
( not b1 is empty & b1 is nullary & b1 is len-total & b1 is to-naturals )
proof end;
cluster non empty to-naturals from-natural-fseqs len-total homogeneous unary set ;
existence
ex b1 being from-natural-fseqs homogeneous Function st
( not b1 is empty & b1 is unary & b1 is len-total & b1 is to-naturals )
proof end;
cluster non empty to-naturals from-natural-fseqs len-total homogeneous binary set ;
existence
ex b1 being from-natural-fseqs homogeneous Function st
( not b1 is empty & b1 is binary & b1 is len-total & b1 is to-naturals )
proof end;
cluster non empty to-naturals from-natural-fseqs len-total homogeneous 3-ary set ;
existence
ex b1 being from-natural-fseqs homogeneous Function st
( not b1 is empty & b1 is 3-ary & b1 is len-total & b1 is to-naturals )
proof end;
end;

registration
let c1 be non empty primitive-recursive nullary Function;
let c2 be primitive-recursive binary Function;
cluster primrec a1,a2,1 -> non empty quasi_total to-naturals from-natural-fseqs len-total homogeneous primitive-recursive unary ;
coherence
( primrec c1,c2,1 is primitive-recursive & primrec c1,c2,1 is unary )
proof end;
end;

registration
let c1 be primitive-recursive unary Function;
let c2 be primitive-recursive 3-ary Function;
cluster primrec a1,a2,1 -> non empty quasi_total to-naturals from-natural-fseqs len-total homogeneous primitive-recursive binary ;
coherence
( primrec c1,c2,1 is primitive-recursive & primrec c1,c2,1 is binary )
proof end;
cluster primrec a1,a2,2 -> non empty quasi_total to-naturals from-natural-fseqs len-total homogeneous primitive-recursive binary ;
coherence
( primrec c1,c2,2 is primitive-recursive & primrec c1,c2,2 is binary )
proof end;
end;

theorem Th83: :: COMPUT_1:83
for b1 being Nat
for b2 being to-naturals from-natural-fseqs len-total homogeneous unary Function
for b3 being non empty to-naturals from-natural-fseqs homogeneous Function holds (primrec b2,b3,2) . <*b1,0*> = b2 . <*b1*>
proof end;

theorem Th84: :: COMPUT_1:84
for b1, b2 being non empty to-naturals from-natural-fseqs homogeneous Function st b1 is len-total & arity b1 = 0 holds
(primrec b1,b2,1) . <*0*> = b1 . {}
proof end;

theorem Th85: :: COMPUT_1:85
for b1, b2 being Nat
for b3 being to-naturals from-natural-fseqs len-total homogeneous unary Function
for b4 being to-naturals from-natural-fseqs len-total homogeneous 3-ary Function holds (primrec b3,b4,2) . <*b1,(b2 + 1)*> = b4 . <*b1,b2,((primrec b3,b4,2) . <*b1,b2*>)*>
proof end;

theorem Th86: :: COMPUT_1:86
for b1 being Nat
for b2, b3 being non empty to-naturals from-natural-fseqs homogeneous Function st b2 is len-total & b3 is len-total & arity b2 = 0 & arity b3 = 2 holds
(primrec b2,b3,1) . <*(b1 + 1)*> = b3 . <*b1,((primrec b2,b3,1) . <*b1*>)*>
proof end;

E101: now
let c1 be non empty quasi_total homogeneous PartFunc of NAT * , NAT ;
assume E102: arity c1 = 2 ;
thus E103: dom <:<*(3 proj 1),(3 proj 3)*>:> = (dom (3 proj 1)) /\ (dom (3 proj 3)) by FUNCT_6:62;
hence E104: dom <:<*(3 proj 1),(3 proj 3)*>:> = (3 -tuples_on NAT ) /\ (dom (3 proj 3)) by Th40
.= (3 -tuples_on NAT ) /\ (3 -tuples_on NAT ) by Th40
.= 3 -tuples_on NAT ;

reconsider c2 = <*0,0,0*> as FinSequence of NAT ;
len c2 = 3 by FINSEQ_1:62;
then E105: c2 is Element of 3 -tuples_on NAT by FINSEQ_2:110;
E106: dom c1 = 2 -tuples_on NAT by E102, Th25;
set c3 = c1 * <:<*(3 proj 1),(3 proj 3)*>:>;
now
let c4 be set ;
set c5 = <*(3 proj 1),(3 proj 3)*>;
set c6 = <:<*(3 proj 1),(3 proj 3)*>:>;
E107: product (rngs <*(3 proj 1),(3 proj 3)*>) = product <*(rng (3 proj 1)),(rng (3 proj 3))*> by FUNCT_6:34
.= product <*NAT ,(rng (3 proj 3))*> by Th40
.= product <*NAT ,NAT *> by Th40
.= 2 -tuples_on NAT by FUNCT_6:6 ;
hereby
assume E108: c4 in rng <:<*(3 proj 1),(3 proj 3)*>:> ;
rng <:<*(3 proj 1),(3 proj 3)*>:> c= product (rngs <*(3 proj 1),(3 proj 3)*>) by FUNCT_6:49;
hence c4 in dom c1 by E106, E107, E108;
end;
assume c4 in dom c1 ;
then consider c7, c8 being Nat such that
E108: c4 = <*c7,c8*> by E106, FINSEQ_2:120;
reconsider c9 = <*c7,0,c8*> as Element of 3 -tuples_on NAT by FINSEQ_2:124;
<:<*(3 proj 1),(3 proj 3)*>:> . c9 = <*((3 proj 1) . c9),((3 proj 3) . c9)*> by E103, E104, FUNCT_6:62
.= <*(c9 . 1),((3 proj 3) . c9)*> by Th42
.= <*(c9 . 1),(c9 . 3)*> by Th42
.= <*c7,(c9 . 3)*> by FINSEQ_1:62
.= c4 by E108, FINSEQ_1:62 ;
hence c4 in rng <:<*(3 proj 1),(3 proj 3)*>:> by E104, FUNCT_1:def 5;
end;
then E107: rng <:<*(3 proj 1),(3 proj 3)*>:> = dom c1 by TARSKI:2;
hence E108: dom (c1 * <:<*(3 proj 1),(3 proj 3)*>:>) = 3 -tuples_on NAT by E104, RELAT_1:46;
then E109: dom (c1 * <:<*(3 proj 1),(3 proj 3)*>:>) c= NAT * by MSUALG_1:12;
rng c1 c= NAT by RELSET_1:12;
then rng (c1 * <:<*(3 proj 1),(3 proj 3)*>:>) c= NAT by E107, RELAT_1:47;
then reconsider c4 = c1 * <:<*(3 proj 1),(3 proj 3)*>:> as PartFunc of NAT * , NAT by E109, RELSET_1:11;
now
let c5, c6 be FinSequence;
assume ( c5 in dom c4 & c6 in dom c4 ) ;
then ( 3 = len c5 & 3 = len c6 ) by E108, FINSEQ_2:109;
hence len c5 = len c6 ;
end;
then reconsider c5 = c4 as homogeneous PartFunc of NAT * , NAT by Def4;
take c6 = c5;
thus c6 = c1 * <:<*(3 proj 1),(3 proj 3)*>:> ;
c6 is Element of PFuncs (NAT * ),NAT by PARTFUN1:119;
then c6 in HFuncs NAT ;
hence c6 is Element of HFuncs NAT ;
for b1 being FinSequence st b1 in dom c6 holds
3 = len b1 by E108, FINSEQ_2:109;
hence arity c6 = 3 by E105, E108, Def5;
hence ( c6 is quasi_total & not c6 is empty ) by E108, Th25;
end;

definition
let c1 be Function;
func (1,2)->(1,?,2) c1 -> Function equals :: COMPUT_1:def 28
a1 * <:<*(3 proj 1),(3 proj 3)*>:>;
coherence
c1 * <:<*(3 proj 1),(3 proj 3)*>:> is Function
;
end;

:: deftheorem Def28 defines (1,2)->(1,?,2) COMPUT_1:def 28 :
for b1 being Function holds (1,2)->(1,?,2) b1 = b1 * <:<*(3 proj 1),(3 proj 3)*>:>;

registration
let c1 be to-naturals from-natural-fseqs Function;
cluster (1,2)->(1,?,2) a1 -> to-naturals from-natural-fseqs ;
coherence
( (1,2)->(1,?,2) c1 is to-naturals & (1,2)->(1,?,2) c1 is from-natural-fseqs )
proof end;
end;

registration
let c1 be homogeneous Function;
cluster (1,2)->(1,?,2) a1 -> homogeneous ;
coherence
(1,2)->(1,?,2) c1 is homogeneous
proof end;
end;

registration
let c1 be to-naturals from-natural-fseqs len-total homogeneous binary Function;
cluster (1,2)->(1,?,2) a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous 3-ary ;
coherence
( not (1,2)->(1,?,2) c1 is empty & (1,2)->(1,?,2) c1 is 3-ary & (1,2)->(1,?,2) c1 is len-total )
proof end;
end;

theorem Th87: :: COMPUT_1:87
for b1, b2, b3 being Nat
for b4 being to-naturals from-natural-fseqs len-total homogeneous binary Function holds ((1,2)->(1,?,2) b4) . <*b1,b2,b3*> = b4 . <*b1,b3*>
proof end;

theorem Th88: :: COMPUT_1:88
for b1 being primitive-recursive binary Function holds (1,2)->(1,?,2) b1 in PrimRec
proof end;

registration
let c1 be homogeneous primitive-recursive binary Function;
cluster (1,2)->(1,?,2) a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive 3-ary ;
coherence
( (1,2)->(1,?,2) c1 is primitive-recursive & (1,2)->(1,?,2) c1 is 3-ary )
proof end;
end;

definition
func [+] -> primitive-recursive binary Function equals :: COMPUT_1:def 29
primrec (1 proj 1),(3 succ 3),2;
coherence
primrec (1 proj 1),(3 succ 3),2 is primitive-recursive binary Function
;
end;

:: deftheorem Def29 defines [+] COMPUT_1:def 29 :
[+] = primrec (1 proj 1),(3 succ 3),2;

theorem Th89: :: COMPUT_1:89
for b1, b2 being Nat holds [+] . <*b1,b2*> = b1 + b2
proof end;

definition
func [*] -> primitive-recursive binary Function equals :: COMPUT_1:def 30
primrec (1 const 0),((1,2)->(1,?,2) [+] ),2;
coherence
primrec (1 const 0),((1,2)->(1,?,2) [+] ),2 is primitive-recursive binary Function
;
end;

:: deftheorem Def30 defines [*] COMPUT_1:def 30 :
[*] = primrec (1 const 0),((1,2)->(1,?,2) [+] ),2;

theorem Th90: :: COMPUT_1:90
for b1, b2 being Nat holds [*] . <*b1,b2*> = b1 * b2
proof end;

registration
let c1, c2 be homogeneous primitive-recursive binary Function;
cluster <*a1,a2*> -> with_the_same_arity ;
coherence
<*c1,c2*> is with_the_same_arity
proof end;
end;

registration
let c1, c2, c3 be primitive-recursive binary Function;
cluster <:<*a2,a3*>:> * a1 -> to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
c1 * <:<*c2,c3*>:> is primitive-recursive
proof end;
end;

registration
let c1, c2, c3 be primitive-recursive binary Function;
cluster <:<*a2,a3*>:> * a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive binary ;
coherence
c1 * <:<*c2,c3*>:> is binary
proof end;
end;

registration
let c1 be primitive-recursive unary Function;
let c2 be primitive-recursive Function;
cluster <:<*a2*>:> * a1 -> to-naturals from-natural-fseqs len-total homogeneous primitive-recursive ;
coherence
c1 * <:<*c2*>:> is primitive-recursive
proof end;
end;

registration
let c1 be primitive-recursive unary Function;
let c2 be primitive-recursive binary Function;
cluster <:<*a2*>:> * a1 -> non empty to-naturals from-natural-fseqs len-total homogeneous primitive-recursive binary ;
coherence
c1 * <:<*c2*>:> is binary
proof end;
end;

definition
func [!] -> primitive-recursive unary Function equals :: COMPUT_1:def 31
primrec (0 const 1),([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>),1;
coherence
primrec (0 const 1),([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>),1 is primitive-recursive unary Function
;
end;

:: deftheorem Def31 defines [!] COMPUT_1:def 31 :
[!] = primrec (0 const 1),([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>),1;

scheme :: COMPUT_1:sch 1
s1{ F1() -> to-naturals from-natural-fseqs len-total homogeneous unary Function, F2() -> to-naturals from-natural-fseqs len-total homogeneous binary Function, F3( set ) -> Nat, F4( set , set ) -> Nat } :
for b1, b2 being Nat holds (F1() * <:<*F2()*>:>) . <*b1,b2*> = F3(F4(b1,b2))
provided
E106: for b1 being Nat holds F1() . <*b1*> = F3(b1) and
E107: for b1, b2 being Nat holds F2() . <*b1,b2*> = F4(b1,b2)
proof end;

scheme :: COMPUT_1:sch 2
s2{ F1() -> to-naturals from-natural-fseqs len-total homogeneous binary Function, F2() -> to-naturals from-natural-fseqs len-total homogeneous binary Function, F3() -> to-naturals from-natural-fseqs len-total homogeneous binary Function, F4( set , set ) -> Nat, F5( set , set ) -> Nat, F6( set , set ) -> Nat } :
for b1, b2 being Nat holds (F1() * <:<*F2(),F3()*>:>) . <*b1,b2*> = F4(F5(b1,b2),F6(b1,b2))
provided
E106: for b1, b2 being Nat holds F1() . <*b1,b2*> = F4(b1,b2) and
E107: for b1, b2 being Nat holds F2() . <*b1,b2*> = F5(b1,b2) and
E108: for b1, b2 being Nat holds F3() . <*b1,b2*> = F6(b1,b2)
proof end;

theorem Th91: :: COMPUT_1:91
for b1 being Nat holds [!] . <*b1*> = b1 !
proof end;

definition
func [^] -> primitive-recursive binary Function equals :: COMPUT_1:def 32
primrec (1 const 1),((1,2)->(1,?,2) [*] ),2;
coherence
primrec (1 const 1),((1,2)->(1,?,2) [*] ),2 is primitive-recursive binary Function
;
end;

:: deftheorem Def32 defines [^] COMPUT_1:def 32 :
[^] = primrec (1 const 1),((1,2)->(1,?,2) [*] ),2;

theorem Th92: :: COMPUT_1:92
for b1, b2 being Nat holds [^] . <*b1,b2*> = b1 |^ b2
proof end;

definition
func [pred] -> primitive-recursive unary Function equals :: COMPUT_1:def 33
primrec (0 const 0),(2 proj 1),1;
coherence
primrec (0 const 0),(2 proj 1),1 is primitive-recursive unary Function
;
end;

:: deftheorem Def33 defines [pred] COMPUT_1:def 33 :
[pred] = primrec (0 const 0),(2 proj 1),1;

theorem Th93: :: COMPUT_1:93
for b1 being Nat holds
( [pred] . <*0*> = 0 & [pred] . <*(b1 + 1)*> = b1 )
proof end;

definition
func [-] -> primitive-recursive binary Function equals :: COMPUT_1:def 34
primrec (1 proj 1),((1,2)->(1,?,2) ([pred] * <:<*(2 proj 2)*>:>)),2;
coherence
primrec (1 proj 1),((1,2)->(1,?,2) ([pred] * <:<*(2 proj 2)*>:>)),2 is primitive-recursive binary Function
;
end;

:: deftheorem Def34 defines [-] COMPUT_1:def 34 :
[-] = primrec (1 proj 1),((1,2)->(1,?,2) ([pred] * <:<*(2 proj 2)*>:>)),2;

theorem Th94: :: COMPUT_1:94
for b1, b2 being Nat holds [-] . <*b1,b2*> = b1 -' b2
proof end;