:: FUNCT_7 semantic presentation

theorem Th1: :: FUNCT_7:1
for b1 being Function
for b2 being set st rng b1 c= b2 holds
(id b2) * b1 = b1
proof end;

theorem Th2: :: FUNCT_7:2
for b1 being set
for b2 being non empty set
for b3 being Function of b1,b2 st b3 is one-to-one holds
for b4 being Subset of b1
for b5 being Subset of b2 st b5 c= b3 .: b4 holds
b3 " b5 c= b4
proof end;

theorem Th3: :: FUNCT_7:3
for b1, b2 being non empty set
for b3 being Function of b1,b2 st b3 is one-to-one holds
for b4 being Element of b1
for b5 being Subset of b1 st b3 . b4 in b3 .: b5 holds
b4 in b5
proof end;

theorem Th4: :: FUNCT_7:4
for b1, b2 being non empty set
for b3 being Function of b1,b2 st b3 is one-to-one holds
for b4 being Element of b1
for b5 being Subset of b1
for b6 being Subset of b2 st b3 . b4 in (b3 .: b5) \ b6 holds
b4 in b5 \ (b3 " b6)
proof end;

theorem Th5: :: FUNCT_7:5
for b1, b2 being non empty set
for b3 being Function of b1,b2 st b3 is one-to-one holds
for b4 being Element of b2
for b5 being Subset of b1
for b6 being Subset of b2 st b4 in (b3 .: b5) \ b6 holds
(b3 " ) . b4 in b5 \ (b3 " b6)
proof end;

theorem Th6: :: FUNCT_7:6
for b1 being Function
for b2 being set st b2 in dom b1 holds
b1 | {b2} = b2 .--> (b1 . b2)
proof end;

registration
let c1, c2 be set ;
cluster a1 .--> a2 -> non empty ;
coherence
not c1 .--> c2 is empty
proof end;
end;

registration
let c1, c2, c3, c4 be set ;
cluster a1,a2 --> a3,a4 -> non empty ;
coherence
not c1,c2 --> c3,c4 is empty
proof end;
end;

theorem Th7: :: FUNCT_7:7
for b1 being set
for b2 being ManySortedSet of b1
for b3 being set st b3 in b1 holds
b3 .--> (b2 . b3) = b2 | {b3}
proof end;

theorem Th8: :: FUNCT_7:8
for b1, b2 being set
for b3 being ManySortedSet of [:b1,b2:]
for b4, b5 being set st b4 in b1 & b5 in b2 holds
b4,b5 :-> (b3 . b4,b5) = b3 | [:{b4},{b5}:]
proof end;

theorem Th9: :: FUNCT_7:9
canceled;

theorem Th10: :: FUNCT_7:10
for b1, b2, b3 being Function st rng b2 c= dom b1 & rng b3 c= dom b1 holds
b1 * (b2 +* b3) = (b1 * b2) +* (b1 * b3)
proof end;

theorem Th11: :: FUNCT_7:11
for b1, b2, b3 being Function holds (b2 +* b3) * b1 = (b2 * b1) +* (b3 * b1)
proof end;

theorem Th12: :: FUNCT_7:12
for b1, b2, b3 being Function st rng b1 misses dom b2 holds
(b3 +* b2) * b1 = b3 * b1
proof end;

theorem Th13: :: FUNCT_7:13
for b1, b2, b3 being set st b1 meets rng ((id b2) +* (b1 --> b3)) holds
b3 in b1
proof end;

theorem Th14: :: FUNCT_7:14
for b1, b2, b3 being set st b1 <> b2 holds
not b1 in rng ((id b3) +* (b1 .--> b2))
proof end;

theorem Th15: :: FUNCT_7:15
for b1, b2 being set
for b3 being Function st dom b3 = b1 \/ {b2} holds
b3 = (b3 | b1) +* (b2 .--> (b3 . b2))
proof end;

theorem Th16: :: FUNCT_7:16
for b1 being Function
for b2, b3, b4 being set holds (b1 +* (b2 --> b3)) +* (b2 --> b4) = b1 +* (b2 --> b4)
proof end;

theorem Th17: :: FUNCT_7:17
canceled;

theorem Th18: :: FUNCT_7:18
INT <> INT *
proof end;

theorem Th19: :: FUNCT_7:19
{} * = {{} }
proof end;

theorem Th20: :: FUNCT_7:20
for b1, b2 being set holds
( <*b1*> in b2 * iff b1 in b2 )
proof end;

theorem Th21: :: FUNCT_7:21
for b1, b2 being set st b1 * c= b2 * holds
b1 c= b2
proof end;

theorem Th22: :: FUNCT_7:22
for b1 being Subset of NAT st ( for b2, b3 being Nat st b2 in b1 & b3 < b2 holds
b3 in b1 ) holds
b1 is Cardinal
proof end;

theorem Th23: :: FUNCT_7:23
for b1 being finite set
for b2 being non empty Subset-Family of b1 ex b3 being Element of b2 st
for b4 being Element of b2 st b4 c= b3 holds
b4 = b3
proof end;

theorem Th24: :: FUNCT_7:24
for b1, b2 being FinSequence st len b1 = (len b2) + 1 holds
for b3 being Nat holds
( b3 in dom b2 iff ( b3 in dom b1 & b3 + 1 in dom b1 ) )
proof end;

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

registration
cluster {} -> Function-yielding ;
coherence
{} is Function-yielding
proof end;
let c1 be Function;
cluster <*a1*> -> Function-yielding ;
coherence
<*c1*> is Function-yielding
proof end;
let c2 be Function;
cluster <*a1,a2*> -> Function-yielding ;
coherence
<*c1,c2*> is Function-yielding
proof end;
let c3 be Function;
cluster <*a1,a2,a3*> -> Function-yielding ;
coherence
<*c1,c2,c3*> is Function-yielding
proof end;
end;

registration
let c1 be Nat;
let c2 be Function;
cluster a1 |-> a2 -> Function-yielding ;
coherence
c1 |-> c2 is Function-yielding
proof end;
end;

registration
let c1, c2 be Function-yielding FinSequence;
cluster a1 ^ a2 -> Function-yielding ;
coherence
c1 ^ c2 is Function-yielding
proof end;
end;

theorem Th25: :: FUNCT_7:25
for b1, b2 being FinSequence st b1 ^ b2 is Function-yielding holds
( b1 is Function-yielding & b2 is Function-yielding )
proof end;

scheme :: FUNCT_7:sch 1
s1{ F1() -> non empty set , F2() -> non empty set , F3() -> non empty set , F4( Element of F1(), Element of F2()) -> set } :
ex b1 being Function of [:F1(),F2():],F3() st
for b2 being Element of F1()
for b3 being Element of F2() holds b1 . [b2,b3] = F4(b2,b3)
provided
E10: for b1 being Element of F1()
for b2 being Element of F2() holds F4(b1,b2) in F3()
proof end;

scheme :: FUNCT_7:sch 2
s2{ F1() -> set , F2() -> non empty set , F3( set ) -> set , F4( set ) -> set } :
{ F3(b1) where B is Element of F2() : F4(b1) in F1() } is finite
provided
E10: F1() is finite and
E11: for b1, b2 being Element of F2() st F4(b1) = F4(b2) holds
b1 = b2
proof end;

scheme :: FUNCT_7:sch 3
s3{ F1() -> set , F2() -> non empty set , F3( set ) -> set } :
F1(),{ b1 where B is Element of F2() : F3(b1) in F1() } are_equipotent
provided
E10: for b1 being set st b1 in F1() holds
ex b2 being Element of F2() st b1 = F3(b2) and
E11: for b1, b2 being Element of F2() st F3(b1) = F3(b2) holds
b1 = b2
proof end;

scheme :: FUNCT_7:sch 4
s4{ F1() -> set , F2() -> non empty set , F3( set ) -> set } :
F1(),{ F3(b1) where B is Element of F2() : b1 in F1() } are_equipotent
provided
E10: F1() c= F2() and
E11: for b1, b2 being Element of F2() st F3(b1) = F3(b2) holds
b1 = b2
proof end;

scheme :: FUNCT_7:sch 5
s5{ P1[ set ] } :
for b1 being Function-yielding FinSequence holds P1[b1]
provided
E10: P1[ {} ] and
E11: for b1 being Function-yielding FinSequence st P1[b1] holds
for b2 being Function holds P1[b1 ^ <*b2*>]
proof end;

definition
let c1, c2 be set ;
assume E10: c1 in c2 ;
func In c1,c2 -> Element of a2 equals :Def1: :: FUNCT_7:def 1
a1;
correctness
coherence
c1 is Element of c2
;
by E10;
end;

:: deftheorem Def1 defines In FUNCT_7:def 1 :
for b1, b2 being set st b1 in b2 holds
In b1,b2 = b1;

theorem Th26: :: FUNCT_7:26
for b1, b2, b3 being set st b1 in b2 /\ b3 holds
In b1,b2 = In b1,b3
proof end;

definition
let c1, c2 be Function;
let c3 be set ;
pred c1,c2 equal_outside c3 means :: FUNCT_7:def 2
a1 | ((dom a1) \ a3) = a2 | ((dom a2) \ a3);
end;

:: deftheorem Def2 defines equal_outside FUNCT_7:def 2 :
for b1, b2 being Function
for b3 being set holds
( b1,b2 equal_outside b3 iff b1 | ((dom b1) \ b3) = b2 | ((dom b2) \ b3) );

theorem Th27: :: FUNCT_7:27
for b1 being Function
for b2 being set holds b1,b1 equal_outside b2
proof end;

theorem Th28: :: FUNCT_7:28
for b1, b2 being Function
for b3 being set st b1,b2 equal_outside b3 holds
b2,b1 equal_outside b3
proof end;

theorem Th29: :: FUNCT_7:29
for b1, b2, b3 being Function
for b4 being set st b1,b2 equal_outside b4 & b2,b3 equal_outside b4 holds
b1,b3 equal_outside b4
proof end;

theorem Th30: :: FUNCT_7:30
for b1, b2 being Function
for b3 being set st b1,b2 equal_outside b3 holds
(dom b1) \ b3 = (dom b2) \ b3
proof end;

theorem Th31: :: FUNCT_7:31
for b1, b2 being Function
for b3 being set st dom b2 c= b3 holds
b1,b1 +* b2 equal_outside b3
proof end;

definition
let c1 be Function;
let c2, c3 be set ;
func c1 +* c2,c3 -> Function equals :Def3: :: FUNCT_7:def 3
a1 +* (a2 .--> a3) if a2 in dom a1
otherwise a1;
correctness
coherence
( ( c2 in dom c1 implies c1 +* (c2 .--> c3) is Function ) & ( not c2 in dom c1 implies c1 is Function ) )
;
consistency
for b1 being Function holds verum
;
;
end;

:: deftheorem Def3 defines +* FUNCT_7:def 3 :
for b1 being Function
for b2, b3 being set holds
( ( b2 in dom b1 implies b1 +* b2,b3 = b1 +* (b2 .--> b3) ) & ( not b2 in dom b1 implies b1 +* b2,b3 = b1 ) );

theorem Th32: :: FUNCT_7:32
for b1 being Function
for b2, b3 being set holds dom (b1 +* b3,b2) = dom b1
proof end;

theorem Th33: :: FUNCT_7:33
for b1 being Function
for b2, b3 being set st b3 in dom b1 holds
(b1 +* b3,b2) . b3 = b2
proof end;

theorem Th34: :: FUNCT_7:34
for b1 being Function
for b2, b3, b4 being set st b3 <> b4 holds
(b1 +* b3,b2) . b4 = b1 . b4
proof end;

theorem Th35: :: FUNCT_7:35
for b1 being Function
for b2, b3, b4, b5 being set st b4 <> b5 holds
(b1 +* b4,b2) +* b5,b3 = (b1 +* b5,b3) +* b4,b2
proof end;

theorem Th36: :: FUNCT_7:36
for b1 being Function
for b2, b3, b4 being set holds (b1 +* b4,b2) +* b4,b3 = b1 +* b4,b3
proof end;

theorem Th37: :: FUNCT_7:37
for b1 being Function
for b2 being set holds b1 +* b2,(b1 . b2) = b1
proof end;

registration
let c1 be FinSequence;
let c2 be Nat;
let c3 be set ;
cluster a1 +* a2,a3 -> FinSequence-like ;
coherence
c1 +* c2,c3 is FinSequence-like
proof end;
end;

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

theorem Th38: :: FUNCT_7:38
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4 being Nat st b4 in dom b2 holds
(b2 +* b4,b3) /. b4 = b3
proof end;

theorem Th39: :: FUNCT_7:39
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4, b5 being Nat st b4 <> b5 & b5 in dom b2 holds
(b2 +* b4,b3) /. b5 = b2 /. b5
proof end;

theorem Th40: :: FUNCT_7:40
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being Element of b1
for b5 being Nat holds b2 +* b5,(b2 /. b5) = b2
proof end;

definition
let c1 be set ;
let c2 be Function-yielding FinSequence;
func compose c2,c1 -> Function means :Def4: :: FUNCT_7:def 4
ex b1 being ManySortedFunction of NAT st
( a3 = b1 . (len a2) & b1 . 0 = id a1 & ( for b2 being Nat st b2 + 1 in dom a2 holds
for b3, b4 being Function st b3 = b1 . b2 & b4 = a2 . (b2 + 1) holds
b1 . (b2 + 1) = b4 * b3 ) );
uniqueness
for b1, b2 being Function st ex b3 being ManySortedFunction of NAT st
( b1 = b3 . (len c2) & b3 . 0 = id c1 & ( for b4 being Nat st b4 + 1 in dom c2 holds
for b5, b6 being Function st b5 = b3 . b4 & b6 = c2 . (b4 + 1) holds
b3 . (b4 + 1) = b6 * b5 ) ) & ex b3 being ManySortedFunction of NAT st
( b2 = b3 . (len c2) & b3 . 0 = id c1 & ( for b4 being Nat st b4 + 1 in dom c2 holds
for b5, b6 being Function st b5 = b3 . b4 & b6 = c2 . (b4 + 1) holds
b3 . (b4 + 1) = b6 * b5 ) ) holds
b1 = b2
proof end;
correctness
existence
ex b1 being Functionex b2 being ManySortedFunction of NAT st
( b1 = b2 . (len c2) & b2 . 0 = id c1 & ( for b3 being Nat st b3 + 1 in dom c2 holds
for b4, b5 being Function st b4 = b2 . b3 & b5 = c2 . (b3 + 1) holds
b2 . (b3 + 1) = b5 * b4 ) )
;
proof end;
end;

:: deftheorem Def4 defines compose FUNCT_7:def 4 :
for b1 being set
for b2 being Function-yielding FinSequence
for b3 being Function holds
( b3 = compose b2,b1 iff ex b4 being ManySortedFunction of NAT st
( b3 = b4 . (len b2) & b4 . 0 = id b1 & ( for b5 being Nat st b5 + 1 in dom b2 holds
for b6, b7 being Function st b6 = b4 . b5 & b7 = b2 . (b5 + 1) holds
b4 . (b5 + 1) = b7 * b6 ) ) );

definition
let c1 be Function-yielding FinSequence;
let c2 be set ;
func apply c1,c2 -> FinSequence means :Def5: :: FUNCT_7:def 5
( len a3 = (len a1) + 1 & a3 . 1 = a2 & ( for b1 being Nat
for b2 being Function st b1 in dom a1 & b2 = a1 . b1 holds
a3 . (b1 + 1) = b2 . (a3 . b1) ) );
existence
ex b1 being FinSequence st
( len b1 = (len c1) + 1 & b1 . 1 = c2 & ( for b2 being Nat
for b3 being Function st b2 in dom c1 & b3 = c1 . b2 holds
b1 . (b2 + 1) = b3 . (b1 . b2) ) )
proof end;
correctness
uniqueness
for b1, b2 being FinSequence st len b1 = (len c1) + 1 & b1 . 1 = c2 & ( for b3 being Nat
for b4 being Function st b3 in dom c1 & b4 = c1 . b3 holds
b1 . (b3 + 1) = b4 . (b1 . b3) ) & len b2 = (len c1) + 1 & b2 . 1 = c2 & ( for b3 being Nat
for b4 being Function st b3 in dom c1 & b4 = c1 . b3 holds
b2 . (b3 + 1) = b4 . (b2 . b3) ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def5 defines apply FUNCT_7:def 5 :
for b1 being Function-yielding FinSequence
for b2 being set
for b3 being FinSequence holds
( b3 = apply b1,b2 iff ( len b3 = (len b1) + 1 & b3 . 1 = b2 & ( for b4 being Nat
for b5 being Function st b4 in dom b1 & b5 = b1 . b4 holds
b3 . (b4 + 1) = b5 . (b3 . b4) ) ) );

theorem Th41: :: FUNCT_7:41
for b1 being set holds compose {} ,b1 = id b1
proof end;

theorem Th42: :: FUNCT_7:42
for b1 being set holds apply {} ,b1 = <*b1*>
proof end;

theorem Th43: :: FUNCT_7:43
for b1 being set
for b2 being Function-yielding FinSequence
for b3 being Function holds compose (b2 ^ <*b3*>),b1 = b3 * (compose b2,b1)
proof end;

theorem Th44: :: FUNCT_7:44
for b1 being set
for b2 being Function-yielding FinSequence
for b3 being Function holds apply (b2 ^ <*b3*>),b1 = (apply b2,b1) ^ <*(b3 . ((apply b2,b1) . ((len b2) + 1)))*>
proof end;

theorem Th45: :: FUNCT_7:45
for b1 being set
for b2 being Function-yielding FinSequence
for b3 being Function holds compose (<*b3*> ^ b2),b1 = (compose b2,(b3 .: b1)) * (b3 | b1)
proof end;

theorem Th46: :: FUNCT_7:46
for b1 being set
for b2 being Function-yielding FinSequence
for b3 being Function holds apply (<*b3*> ^ b2),b1 = <*b1*> ^ (apply b2,(b3 . b1))
proof end;

theorem Th47: :: FUNCT_7:47
for b1 being set
for b2 being Function holds compose <*b2*>,b1 = b2 * (id b1)
proof end;

theorem Th48: :: FUNCT_7:48
for b1 being set
for b2 being Function st dom b2 c= b1 holds
compose <*b2*>,b1 = b2
proof end;

theorem Th49: :: FUNCT_7:49
for b1 being set
for b2 being Function holds apply <*b2*>,b1 = <*b1,(b2 . b1)*>
proof end;

theorem Th50: :: FUNCT_7:50
for b1, b2 being set
for b3, b4 being Function-yielding FinSequence st rng (compose b3,b1) c= b2 holds
compose (b3 ^ b4),b1 = (compose b4,b2) * (compose b3,b1)
proof end;

theorem Th51: :: FUNCT_7:51
for b1 being set
for b2, b3 being Function-yielding FinSequence holds (apply (b2 ^ b3),b1) . ((len (b2 ^ b3)) + 1) = (apply b3,((apply b2,b1) . ((len b2) + 1))) . ((len b3) + 1)
proof end;

theorem Th52: :: FUNCT_7:52
for b1 being set
for b2, b3 being Function-yielding FinSequence holds apply (b2 ^ b3),b1 = (apply b2,b1) $^ (apply b3,((apply b2,b1) . ((len b2) + 1)))
proof end;

theorem Th53: :: FUNCT_7:53
for b1 being set
for b2, b3 being Function holds compose <*b2,b3*>,b1 = (b3 * b2) * (id b1)
proof end;

theorem Th54: :: FUNCT_7:54
for b1 being set
for b2, b3 being Function st ( dom b2 c= b1 or dom (b3 * b2) c= b1 ) holds
compose <*b2,b3*>,b1 = b3 * b2
proof end;

theorem Th55: :: FUNCT_7:55
for b1 being set
for b2, b3 being Function holds apply <*b2,b3*>,b1 = <*b1,(b2 . b1),(b3 . (b2 . b1))*>
proof end;

theorem Th56: :: FUNCT_7:56
for b1 being set
for b2, b3, b4 being Function holds compose <*b2,b3,b4*>,b1 = ((b4 * b3) * b2) * (id b1)
proof end;

theorem Th57: :: FUNCT_7:57
for b1 being set
for b2, b3, b4 being Function st ( dom b2 c= b1 or dom (b3 * b2) c= b1 or dom ((b4 * b3) * b2) c= b1 ) holds
compose <*b2,b3,b4*>,b1 = (b4 * b3) * b2
proof end;

theorem Th58: :: FUNCT_7:58
for b1 being set
for b2, b3, b4 being Function holds apply <*b2,b3,b4*>,b1 = <*b1*> ^ <*(b2 . b1),(b3 . (b2 . b1)),(b4 . (b3 . (b2 . b1)))*>
proof end;

definition
let c1 be FinSequence;
func firstdom c1 -> set means :Def6: :: FUNCT_7:def 6
a2 is empty if a1 is empty
otherwise a2 = proj1 (a1 . 1);
correctness
consistency
for b1 being set holds verum
;
existence
( ( for b1 being set holds verum ) & ( c1 is empty implies ex b1 being set st b1 is empty ) & ( not c1 is empty implies ex b1 being set st b1 = proj1 (c1 . 1) ) )
;
uniqueness
for b1, b2 being set holds
( ( c1 is empty & b1 is empty & b2 is empty implies b1 = b2 ) & ( not c1 is empty & b1 = proj1 (c1 . 1) & b2 = proj1 (c1 . 1) implies b1 = b2 ) )
;
;
func lastrng c1 -> set means :Def7: :: FUNCT_7:def 7
a2 is empty if a1 is empty
otherwise a2 = proj2 (a1 . (len a1));
correctness
consistency
for b1 being set holds verum
;
existence
( ( for b1 being set holds verum ) & ( c1 is empty implies ex b1 being set st b1 is empty ) & ( not c1 is empty implies ex b1 being set st b1 = proj2 (c1 . (len c1)) ) )
;
uniqueness
for b1, b2 being set holds
( ( c1 is empty & b1 is empty & b2 is empty implies b1 = b2 ) & ( not c1 is empty & b1 = proj2 (c1 . (len c1)) & b2 = proj2 (c1 . (len c1)) implies b1 = b2 ) )
;
;
end;

:: deftheorem Def6 defines firstdom FUNCT_7:def 6 :
for b1 being FinSequence
for b2 being set holds
( ( b1 is empty implies ( b2 = firstdom b1 iff b2 is empty ) ) & ( not b1 is empty implies ( b2 = firstdom b1 iff b2 = proj1 (b1 . 1) ) ) );

:: deftheorem Def7 defines lastrng FUNCT_7:def 7 :
for b1 being FinSequence
for b2 being set holds
( ( b1 is empty implies ( b2 = lastrng b1 iff b2 is empty ) ) & ( not b1 is empty implies ( b2 = lastrng b1 iff b2 = proj2 (b1 . (len b1)) ) ) );

theorem Th59: :: FUNCT_7:59
( firstdom {} = {} & lastrng {} = {} ) by Def6, Def7;

theorem Th60: :: FUNCT_7:60
for b1 being Function
for b2 being FinSequence holds
( firstdom (<*b1*> ^ b2) = dom b1 & lastrng (b2 ^ <*b1*>) = rng b1 )
proof end;

theorem Th61: :: FUNCT_7:61
for b1 being set
for b2 being Function-yielding FinSequence st b2 <> {} holds
rng (compose b2,b1) c= lastrng b2
proof end;

definition
let c1 be FinSequence;
attr a1 is FuncSeq-like means :Def8: :: FUNCT_7:def 8
ex b1 being FinSequence st
( len b1 = (len a1) + 1 & ( for b2 being Nat st b2 in dom a1 holds
a1 . b2 in Funcs (b1 . b2),(b1 . (b2 + 1)) ) );
end;

:: deftheorem Def8 defines FuncSeq-like FUNCT_7:def 8 :
for b1 being FinSequence holds
( b1 is FuncSeq-like iff ex b2 being FinSequence st
( len b2 = (len b1) + 1 & ( for b3 being Nat st b3 in dom b1 holds
b1 . b3 in Funcs (b2 . b3),(b2 . (b3 + 1)) ) ) );

theorem Th62: :: FUNCT_7:62
for b1, b2 being FinSequence st b1 ^ b2 is FuncSeq-like holds
( b1 is FuncSeq-like & b2 is FuncSeq-like )
proof end;

registration
cluster FuncSeq-like -> Function-yielding set ;
coherence
for b1 being FinSequence st b1 is FuncSeq-like holds
b1 is Function-yielding
proof end;
end;

registration
cluster empty -> Function-yielding FuncSeq-like set ;
coherence
for b1 being FinSequence st b1 is empty holds
b1 is FuncSeq-like
proof end;
end;

registration
let c1 be Function;
cluster <*a1*> -> Function-yielding FuncSeq-like ;
coherence
<*c1*> is FuncSeq-like
proof end;
end;

registration
cluster non empty non-empty Function-yielding FuncSeq-like set ;
existence
ex b1 being FinSequence st
( b1 is FuncSeq-like & not b1 is empty & b1 is non-empty )
proof end;
end;

definition
mode FuncSequence is FuncSeq-like FinSequence;
end;

theorem Th63: :: FUNCT_7:63
for b1 being set
for b2 being FuncSequence st b2 <> {} holds
dom (compose b2,b1) = (firstdom b2) /\ b1
proof end;

theorem Th64: :: FUNCT_7:64
for b1 being FuncSequence holds dom (compose b1,(firstdom b1)) = firstdom b1
proof end;

theorem Th65: :: FUNCT_7:65
for b1 being FuncSequence
for b2 being Function st rng b2 c= firstdom b1 holds
<*b2*> ^ b1 is FuncSequence
proof end;

theorem Th66: :: FUNCT_7:66
for b1 being FuncSequence
for b2 being Function st lastrng b1 c= dom b2 holds
b1 ^ <*b2*> is FuncSequence
proof end;

theorem Th67: :: FUNCT_7:67
for b1, b2 being set
for b3 being FuncSequence st b1 in firstdom b3 & b1 in b2 holds
(apply b3,b1) . ((len b3) + 1) = (compose b3,b2) . b1
proof end;

definition
let c1, c2 be set ;
assume E37: ( c2 is empty implies c1 is empty ) ;
mode FuncSequence of c1,c2 -> FuncSequence means :Def9: :: FUNCT_7:def 9
( firstdom a3 = a1 & lastrng a3 c= a2 );
existence
ex b1 being FuncSequence st
( firstdom b1 = c1 & lastrng b1 c= c2 )
proof end;
end;

:: deftheorem Def9 defines FuncSequence FUNCT_7:def 9 :
for b1, b2 being set st ( b2 is empty implies b1 is empty ) holds
for b3 being FuncSequence holds
( b3 is FuncSequence of b1,b2 iff ( firstdom b3 = b1 & lastrng b3 c= b2 ) );

definition
let c1 be non empty set ;
let c2 be set ;
let c3 be FuncSequence of c2,c1;
redefine func compose as compose c3,c2 -> Function of a2,a1;
coherence
compose c3,c2 is Function of c2,c1
proof end;
end;

definition
let c1 be non empty non-empty FinSequence;
mode FuncSequence of c1 -> FinSequence means :Def10: :: FUNCT_7:def 10
( (len a2) + 1 = len a1 & ( for b1 being Nat st b1 in dom a2 holds
a2 . b1 in Funcs (a1 . b1),(a1 . (b1 + 1)) ) );
existence
ex b1 being FinSequence st
( (len b1) + 1 = len c1 & ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 in Funcs (c1 . b2),(c1 . (b2 + 1)) ) )
proof end;
end;

:: deftheorem Def10 defines FuncSequence FUNCT_7:def 10 :
for b1 being non empty non-empty FinSequence
for b2 being FinSequence holds
( b2 is FuncSequence of b1 iff ( (len b2) + 1 = len b1 & ( for b3 being Nat st b3 in dom b2 holds
b2 . b3 in Funcs (b1 . b3),(b1 . (b3 + 1)) ) ) );

registration
let c1 be non empty non-empty FinSequence;
cluster -> non-empty FuncSeq-like FuncSequence of a1;
coherence
for b1 being FuncSequence of c1 holds
( b1 is FuncSeq-like & b1 is non-empty )
proof end;
end;

theorem Th68: :: FUNCT_7:68
for b1 being non empty non-empty FinSequence
for b2 being FuncSequence of b1 st b2 <> {} holds
( firstdom b2 = b1 . 1 & lastrng b2 c= b1 . (len b1) )
proof end;

theorem Th69: :: FUNCT_7:69
for b1 being non empty non-empty FinSequence
for b2 being FuncSequence of b1 holds
( dom (compose b2,(b1 . 1)) = b1 . 1 & rng (compose b2,(b1 . 1)) c= b1 . (len b1) )
proof end;

Lemma40: for b1 being set
for b2 being Function of b1,b1 holds rng b2 c= dom b2
proof end;

Lemma41: for b1 being Function
for b2 being Element of NAT
for b3, b4 being Function of NAT , PFuncs ((dom b1) \/ (rng b1)),((dom b1) \/ (rng b1)) st b3 . 0 = id ((dom b1) \/ (rng b1)) & ( for b5 being Element of NAT ex b6 being Function st
( b6 = b3 . b5 & b3 . (b5 + 1) = b6 * b1 ) ) & b4 . 0 = id ((dom b1) \/ (rng b1)) & ( for b5 being Element of NAT ex b6 being Function st
( b6 = b4 . b5 & b4 . (b5 + 1) = b6 * b1 ) ) holds
b3 = b4
proof end;

definition
let c1 be Function;
let c2 be Element of NAT ;
func iter c1,c2 -> Function means :Def11: :: FUNCT_7:def 11
ex b1 being Function of NAT , PFuncs ((dom a1) \/ (rng a1)),((dom a1) \/ (rng a1)) st
( a3 = b1 . a2 & b1 . 0 = id ((dom a1) \/ (rng a1)) & ( for b2 being Element of NAT ex b3 being Function st
( b3 = b1 . b2 & b1 . (b2 + 1) = b3 * a1 ) ) );
existence
ex b1 being Functionex b2 being Function of NAT , PFuncs ((dom c1) \/ (rng c1)),((dom c1) \/ (rng c1)) st
( b1 = b2 . c2 & b2 . 0 = id ((dom c1) \/ (rng c1)) & ( for b3 being Element of NAT ex b4 being Function st
( b4 = b2 . b3 & b2 . (b3 + 1) = b4 * c1 ) ) )
proof end;
uniqueness
for b1, b2 being Function st ex b3 being Function of NAT , PFuncs ((dom c1) \/ (rng c1)),((dom c1) \/ (rng c1)) st
( b1 = b3 . c2 & b3 . 0 = id ((dom c1) \/ (rng c1)) & ( for b4 being Element of NAT ex b5 being Function st
( b5 = b3 . b4 & b3 . (b4 + 1) = b5 * c1 ) ) ) & ex b3 being Function of NAT , PFuncs ((dom c1) \/ (rng c1)),((dom c1) \/ (rng c1)) st
( b2 = b3 . c2 & b3 . 0 = id ((dom c1) \/ (rng c1)) & ( for b4 being Element of NAT ex b5 being Function st
( b5 = b3 . b4 & b3 . (b4 + 1) = b5 * c1 ) ) ) holds
b1 = b2
by Lemma41;
end;

:: deftheorem Def11 defines iter FUNCT_7:def 11 :
for b1 being Function
for b2 being Element of NAT
for b3 being Function holds
( b3 = iter b1,b2 iff ex b4 being Function of NAT , PFuncs ((dom b1) \/ (rng b1)),((dom b1) \/ (rng b1)) st
( b3 = b4 . b2 & b4 . 0 = id ((dom b1) \/ (rng b1)) & ( for b5 being Element of NAT ex b6 being Function st
( b6 = b4 . b5 & b4 . (b5 + 1) = b6 * b1 ) ) ) );

Lemma43: for b1 being Function holds
( (id ((dom b1) \/ (rng b1))) * b1 = b1 & b1 * (id ((dom b1) \/ (rng b1))) = b1 )
proof end;

theorem Th70: :: FUNCT_7:70
for b1 being Function holds iter b1,0 = id ((dom b1) \/ (rng b1))
proof end;

Lemma45: for b1 being Function st rng b1 c= dom b1 holds
iter b1,0 = id (dom b1)
proof end;

theorem Th71: :: FUNCT_7:71
for b1 being Function
for b2 being Nat holds iter b1,(b2 + 1) = (iter b1,b2) * b1
proof end;

theorem Th72: :: FUNCT_7:72
for b1 being Function holds iter b1,1 = b1
proof end;

theorem Th73: :: FUNCT_7:73
for b1 being Function
for b2 being Nat holds iter b1,(b2 + 1) = b1 * (iter b1,b2)
proof end;

theorem Th74: :: FUNCT_7:74
for b1 being Function
for b2 being Nat holds
( dom (iter b1,b2) c= (dom b1) \/ (rng b1) & rng (iter b1,b2) c= (dom b1) \/ (rng b1) )
proof end;

theorem Th75: :: FUNCT_7:75
for b1 being Function
for b2 being Nat st b2 <> 0 holds
( dom (iter b1,b2) c= dom b1 & rng (iter b1,b2) c= rng b1 )
proof end;

theorem Th76: :: FUNCT_7:76
for b1 being Function
for b2 being Nat st rng b1 c= dom b1 holds
( dom (iter b1,b2) = dom b1 & rng (iter b1,b2) c= dom b1 )
proof end;

theorem Th77: :: FUNCT_7:77
for b1 being Function
for b2 being Nat holds (iter b1,b2) * (id ((dom b1) \/ (rng b1))) = iter b1,b2
proof end;

theorem Th78: :: FUNCT_7:78
for b1 being Function
for b2 being Nat holds (id ((dom b1) \/ (rng b1))) * (iter b1,b2) = iter b1,b2
proof end;

theorem Th79: :: FUNCT_7:79
for b1 being Function
for b2, b3 being Nat holds (iter b1,b2) * (iter b1,b3) = iter b1,(b2 + b3)
proof end;

Lemma53: for b1 being Function
for b2, b3 being Nat st iter (iter b1,b2),b3 = iter b1,(b2 * b3) holds
iter (iter b1,b2),(b3 + 1) = iter b1,(b2 * (b3 + 1))
proof end;

theorem Th80: :: FUNCT_7:80
for b1 being Function
for b2, b3 being Nat st b2 <> 0 holds
iter (iter b1,b3),b2 = iter b1,(b3 * b2)
proof end;

theorem Th81: :: FUNCT_7:81
for b1 being Function
for b2, b3 being Nat st rng b1 c= dom b1 holds
iter (iter b1,b2),b3 = iter b1,(b2 * b3)
proof end;

theorem Th82: :: FUNCT_7:82
for b1 being Nat holds iter {} ,b1 = {}
proof end;

theorem Th83: :: FUNCT_7:83
for b1 being set
for b2 being Nat holds iter (id b1),b2 = id b1
proof end;

theorem Th84: :: FUNCT_7:84
for b1 being Function st rng b1 misses dom b1 holds
iter b1,2 = {}
proof end;

theorem Th85: :: FUNCT_7:85
for b1 being set
for b2 being Nat
for b3 being Function of b1,b1 holds iter b3,b2 is Function of b1,b1
proof end;

theorem Th86: :: FUNCT_7:86
for b1 being set
for b2 being Function of b1,b1 holds iter b2,0 = id b1
proof end;

theorem Th87: :: FUNCT_7:87
for b1 being set
for b2, b3 being Nat
for b4 being Function of b1,b1 holds iter (iter b4,b2),b3 = iter b4,(b2 * b3)
proof end;

theorem Th88: :: FUNCT_7:88
for b1 being set
for b2 being Nat
for b3 being PartFunc of b1,b1 holds iter b3,b2 is PartFunc of b1,b1
proof end;

theorem Th89: :: FUNCT_7:89
for b1, b2 being set
for b3 being Function
for b4 being Nat st b4 <> 0 & b1 in b2 & b3 = b2 --> b1 holds
iter b3,b4 = b3
proof end;

theorem Th90: :: FUNCT_7:90
for b1 being Function
for b2 being Nat holds iter b1,b2 = compose (b2 |-> b1),((dom b1) \/ (rng b1))
proof end;