:: FINSEQ_1 semantic presentation  Show TPTP formulae Show IDV graph for whole article:: Showing IDV graph ... (Click the Palm Trees again to close it)

definition
let n be natural number ;
func Seg n -> set equals :: FINSEQ_1:def 1
{ k where k is Nat : ( 1 <= k & k <= n ) } ;
correctness
coherence
{ k where k is Nat : ( 1 <= k & k <= n ) } is set
;
;
end;

:: deftheorem defines Seg FINSEQ_1:def 1 :
for n being natural number holds Seg n = { k where k is Nat : ( 1 <= k & k <= n ) } ;

definition
let n be natural number ;
:: original: Seg
redefine func Seg n -> Subset of NAT ;
coherence
Seg n is Subset of NAT
proof end;
end;

theorem :: FINSEQ_1:1  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem :: FINSEQ_1:2  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th3: :: FINSEQ_1:3  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a, b being natural number holds
( a in Seg b iff ( 1 <= a & a <= b ) )
proof end;

theorem Th4: :: FINSEQ_1:4  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
( Seg 0 = {} & Seg 1 = {1} & Seg 2 = {1,2} )
proof end;

theorem Th5: :: FINSEQ_1:5  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a being natural number holds
( a = 0 or a in Seg a )
proof end;

theorem :: FINSEQ_1:6  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a being natural number holds a + 1 in Seg (a + 1) by Th5;

theorem Th7: :: FINSEQ_1:7  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a, b being natural number holds
( a <= b iff Seg a c= Seg b )
proof end;

theorem Th8: :: FINSEQ_1:8  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a, b being natural number st Seg a = Seg b holds
a = b
proof end;

theorem Th9: :: FINSEQ_1:9  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for c, a being natural number st c <= a holds
Seg c = (Seg a) /\ (Seg c)
proof end;

theorem :: FINSEQ_1:10  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for c, a being natural number st Seg c = (Seg c) /\ (Seg a) holds
c <= a
proof end;

theorem Th11: :: FINSEQ_1:11  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a being natural number holds (Seg a) \/ {(a + 1)} = Seg (a + 1)
proof end;

theorem :: FINSEQ_1:12  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for k being natural number holds Seg k = (Seg (k + 1)) \ {(k + 1)}
proof end;

definition
let IT be Relation;
attr IT is FinSequence-like means :Def2: :: FINSEQ_1:def 2
ex n being Nat st dom IT = Seg n;
end;

:: deftheorem Def2 defines FinSequence-like FINSEQ_1:def 2 :
for IT being Relation holds
( IT is FinSequence-like iff ex n being Nat st dom IT = Seg n );

registration
cluster FinSequence-like set ;
existence
ex b1 being Function st b1 is FinSequence-like
proof end;
end;

definition
mode FinSequence is FinSequence-like Function;
end;

defpred S1[ set , set ] means ex k being Nat st
( $1 = k & $2 = k + 1 );

registration
let n be natural number ;
cluster Seg n -> finite ;
coherence
Seg n is finite
proof end;
end;

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

Lm1: for n being Nat holds Seg n,n are_equipotent
proof end;

Lm2: for n being Nat holds Card (Seg n) = Card n
proof end;

notation
let p be FinSequence;
synonym len p for Card p;
end;

definition
let p be FinSequence;
:: original: len
redefine func len p -> Nat means :Def3: :: FINSEQ_1:def 3
Seg it = dom p;
coherence
len p is Nat
proof end;
compatibility
for b1 being Nat holds
( b1 = len p iff Seg b1 = dom p )
proof end;
end;

:: deftheorem Def3 defines len FINSEQ_1:def 3 :
for p being FinSequence
for b2 being Nat holds
( b2 = len p iff Seg b2 = dom p );

definition
let p be FinSequence;
:: original: dom
redefine func dom p -> Subset of NAT ;
coherence
dom p is Subset of NAT
proof end;
end;

theorem :: FINSEQ_1:13  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th14: :: FINSEQ_1:14  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
{} is FinSequence
proof end;

theorem :: FINSEQ_1:15  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for f being Function st ex k being Nat st dom f c= Seg k holds
ex p being FinSequence st f c= p
proof end;

scheme :: FINSEQ_1:sch 1
SeqEx{ F1() -> Nat, P1[ set , set ] } :
ex p being FinSequence st
( dom p = Seg F1() & ( for k being Nat st k in Seg F1() holds
P1[k,p . k] ) )
provided
A1: for k being Nat
for y1, y2 being set st k in Seg F1() & P1[k,y1] & P1[k,y2] holds
y1 = y2 and
A2: for k being Nat st k in Seg F1() holds
ex x being set st P1[k,x]
proof end;

scheme :: FINSEQ_1:sch 2
SeqLambda{ F1() -> Nat, F2( set ) -> set } :
ex p being FinSequence st
( len p = F1() & ( for k being Nat st k in Seg F1() holds
p . k = F2(k) ) )
proof end;

theorem :: FINSEQ_1:16  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for z being set
for p being FinSequence st z in p holds
ex k being Nat st
( k in dom p & z = [k,(p . k)] )
proof end;

theorem Th17: :: FINSEQ_1:17  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence st dom p = dom q & ( for k being Nat st k in dom p holds
p . k = q . k ) holds
p = q
proof end;

theorem :: FINSEQ_1:18  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence st len p = len q & ( for k being Nat st 1 <= k & k <= len p holds
p . k = q . k ) holds
p = q
proof end;

theorem Th19: :: FINSEQ_1:19  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a being natural number
for p being FinSequence holds p | (Seg a) is FinSequence
proof end;

theorem :: FINSEQ_1:20  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for f being Function
for p being FinSequence st rng p c= dom f holds
f * p is FinSequence
proof end;

theorem Th21: :: FINSEQ_1:21  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a being natural number
for p, q being FinSequence st a <= len p & q = p | (Seg a) holds
( len q = a & dom q = Seg a )
proof end;

definition
let D be set ;
mode FinSequence of D -> FinSequence means :Def4: :: FINSEQ_1:def 4
rng it c= D;
existence
ex b1 being FinSequence st rng b1 c= D
proof end;
end;

:: deftheorem Def4 defines FinSequence FINSEQ_1:def 4 :
for D being set
for b2 being FinSequence holds
( b2 is FinSequence of D iff rng b2 c= D );

Lm3: for D being set
for f being FinSequence of D holds f is PartFunc of NAT ,D
proof end;

registration
cluster {} -> FinSequence-like ;
coherence
{} is FinSequence-like
by Th14;
end;

registration
let D be set ;
cluster finite FinSequence-like M5( NAT ,D);
existence
ex b1 being PartFunc of NAT ,D st b1 is FinSequence-like
proof end;
end;

definition
let D be set ;
:: original: FinSequence
redefine mode FinSequence of D -> FinSequence-like PartFunc of NAT ,D;
coherence
for b1 being FinSequence of D holds b1 is FinSequence-like PartFunc of NAT ,D
by Lm3;
end;

theorem :: FINSEQ_1:22  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th23: :: FINSEQ_1:23  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a being natural number
for D being set
for p being FinSequence of D holds p | (Seg a) is FinSequence of D
proof end;

theorem :: FINSEQ_1:24  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for a being natural number
for D being non empty set ex p being FinSequence of D st len p = a
proof end;

Lm4: for q being FinSequence holds
( q = {} iff len q = 0 )
proof end;

registration
cluster empty finite set ;
existence
ex b1 being FinSequence st b1 is empty
by Th14;
end;

theorem :: FINSEQ_1:25  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p being FinSequence holds
( len p = 0 iff p = {} ) by Lm4;

theorem :: FINSEQ_1:26  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p being FinSequence holds
( p = {} iff dom p = {} ) by RELAT_1:60, RELAT_1:64;

theorem :: FINSEQ_1:27  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p being FinSequence holds
( p = {} iff rng p = {} ) by RELAT_1:60, RELAT_1:64;

theorem :: FINSEQ_1:28  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th29: :: FINSEQ_1:29  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for D being set holds {} is FinSequence of D
proof end;

registration
let D be set ;
cluster empty finite FinSequence-like FinSequence of D;
existence
ex b1 being FinSequence of D st b1 is empty
proof end;
end;

definition
let x be set ;
func <*x*> -> set equals :: FINSEQ_1:def 5
{[1,x]};
coherence
{[1,x]} is set
;
end;

:: deftheorem defines <* FINSEQ_1:def 5 :
for x being set holds <*x*> = {[1,x]};

definition
let D be set ;
func <*> D -> empty FinSequence of D equals :: FINSEQ_1:def 6
{} ;
coherence
{} is empty FinSequence of D
by Th29;
end;

:: deftheorem defines <*> FINSEQ_1:def 6 :
for D being set holds <*> D = {} ;

theorem :: FINSEQ_1:30  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem :: FINSEQ_1:31  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem :: FINSEQ_1:32  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p being FinSequence
for D being set holds
( p = <*> D iff len p = 0 ) by Lm4;

definition
let p, q be FinSequence;
func p ^ q -> FinSequence means :Def7: :: FINSEQ_1:def 7
( dom it = Seg ((len p) + (len q)) & ( for k being Nat st k in dom p holds
it . k = p . k ) & ( for k being Nat st k in dom q holds
it . ((len p) + k) = q . k ) );
existence
ex b1 being FinSequence st
( dom b1 = Seg ((len p) + (len q)) & ( for k being Nat st k in dom p holds
b1 . k = p . k ) & ( for k being Nat st k in dom q holds
b1 . ((len p) + k) = q . k ) )
proof end;
uniqueness
for b1, b2 being FinSequence st dom b1 = Seg ((len p) + (len q)) & ( for k being Nat st k in dom p holds
b1 . k = p . k ) & ( for k being Nat st k in dom q holds
b1 . ((len p) + k) = q . k ) & dom b2 = Seg ((len p) + (len q)) & ( for k being Nat st k in dom p holds
b2 . k = p . k ) & ( for k being Nat st k in dom q holds
b2 . ((len p) + k) = q . k ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines ^ FINSEQ_1:def 7 :
for p, q being FinSequence
for b3 being FinSequence holds
( b3 = p ^ q iff ( dom b3 = Seg ((len p) + (len q)) & ( for k being Nat st k in dom p holds
b3 . k = p . k ) & ( for k being Nat st k in dom q holds
b3 . ((len p) + k) = q . k ) ) );

theorem Th33: :: FINSEQ_1:33  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence holds p = (p ^ q) | (dom p)
proof end;

theorem :: FINSEQ_1:34  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th35: :: FINSEQ_1:35  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence holds len (p ^ q) = (len p) + (len q)
proof end;

theorem Th36: :: FINSEQ_1:36  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence
for k being natural number st (len p) + 1 <= k & k <= (len p) + (len q) holds
(p ^ q) . k = q . (k - (len p))
proof end;

theorem :: FINSEQ_1:37  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence
for k being natural number st len p < k & k <= len (p ^ q) holds
(p ^ q) . k = q . (k - (len p))
proof end;

theorem Th38: :: FINSEQ_1:38  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence
for k being Nat holds
( not k in dom (p ^ q) or k in dom p or ex n being Nat st
( n in dom q & k = (len p) + n ) )
proof end;

theorem Th39: :: FINSEQ_1:39  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence holds dom p c= dom (p ^ q)
proof end;

theorem Th40: :: FINSEQ_1:40  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x being set
for q, p being FinSequence st x in dom q holds
ex k being Nat st
( k = x & (len p) + k in dom (p ^ q) )
proof end;

theorem Th41: :: FINSEQ_1:41  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for k being Nat
for q, p being FinSequence st k in dom q holds
(len p) + k in dom (p ^ q)
proof end;

theorem Th42: :: FINSEQ_1:42  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence holds rng p c= rng (p ^ q)
proof end;

theorem Th43: :: FINSEQ_1:43  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for q, p being FinSequence holds rng q c= rng (p ^ q)
proof end;

theorem Th44: :: FINSEQ_1:44  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence holds rng (p ^ q) = (rng p) \/ (rng q)
proof end;

theorem Th45: :: FINSEQ_1:45  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q, r being FinSequence holds (p ^ q) ^ r = p ^ (q ^ r)
proof end;

theorem :: FINSEQ_1:46  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, r, q being FinSequence st ( p ^ r = q ^ r or r ^ p = r ^ q ) holds
p = q
proof end;

theorem Th47: :: FINSEQ_1:47  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p being FinSequence holds
( p ^ {} = p & {} ^ p = p )
proof end;

theorem Th48: :: FINSEQ_1:48  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence st p ^ q = {} holds
( p = {} & q = {} )
proof end;

definition
let D be set ;
let p, q be FinSequence of D;
:: original: ^
redefine func p ^ q -> FinSequence of D;
coherence
p ^ q is FinSequence of D
proof end;
end;

Lm5: for x, y being set holds {[x,y]} is Function
proof end;

Lm6: for x, y, x1, y1 being set st [x,y] in {[x1,y1]} holds
( x = x1 & y = y1 )
proof end;

definition
let x be set ;
:: original: <*
redefine func <*x*> -> Function means :Def8: :: FINSEQ_1:def 8
( dom it = Seg 1 & it . 1 = x );
coherence
<*x*> is Function
by Lm5;
compatibility
for b1 being Function holds
( b1 = <*x*> iff ( dom b1 = Seg 1 & b1 . 1 = x ) )
proof end;
end;

:: deftheorem Def8 defines <* FINSEQ_1:def 8 :
for x being set
for b2 being Function holds
( b2 = <*x*> iff ( dom b2 = Seg 1 & b2 . 1 = x ) );

registration
let x be set ;
cluster <*x*> -> Relation-like Function-like ;
coherence
( <*x*> is Function-like & <*x*> is Relation-like )
;
end;

registration
let x be set ;
cluster <*x*> -> Relation-like Function-like finite FinSequence-like ;
coherence
<*x*> is FinSequence-like
proof end;
end;

theorem :: FINSEQ_1:49  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th50: :: FINSEQ_1:50  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence
for D being set st p ^ q is FinSequence of D holds
( p is FinSequence of D & q is FinSequence of D )
proof end;

definition
let x, y be set ;
func <*x,y*> -> set equals :: FINSEQ_1:def 9
<*x*> ^ <*y*>;
correctness
coherence
<*x*> ^ <*y*> is set
;
;
let z be set ;
func <*x,y,z*> -> set equals :: FINSEQ_1:def 10
(<*x*> ^ <*y*>) ^ <*z*>;
correctness
coherence
(<*x*> ^ <*y*>) ^ <*z*> is set
;
;
end;

:: deftheorem defines <* FINSEQ_1:def 9 :
for x, y being set holds <*x,y*> = <*x*> ^ <*y*>;

:: deftheorem defines <* FINSEQ_1:def 10 :
for x, y, z being set holds <*x,y,z*> = (<*x*> ^ <*y*>) ^ <*z*>;

registration
let x, y be set ;
cluster <*x,y*> -> Relation-like Function-like ;
coherence
( <*x,y*> is Function-like & <*x,y*> is Relation-like )
;
let z be set ;
cluster <*x,y,z*> -> Relation-like Function-like ;
coherence
( <*x,y,z*> is Function-like & <*x,y,z*> is Relation-like )
;
end;

registration
let x, y be set ;
cluster <*x,y*> -> Relation-like Function-like finite FinSequence-like ;
coherence
<*x,y*> is FinSequence-like
;
let z be set ;
cluster <*x,y,z*> -> Relation-like Function-like finite FinSequence-like ;
coherence
<*x,y,z*> is FinSequence-like
;
end;

theorem :: FINSEQ_1:51  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem :: FINSEQ_1:52  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x being set holds <*x*> = {[1,x]} ;

theorem :: FINSEQ_1:53  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem :: FINSEQ_1:54  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th55: :: FINSEQ_1:55  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x being set
for p being FinSequence holds
( p = <*x*> iff ( dom p = Seg 1 & rng p = {x} ) )
proof end;

theorem Th56: :: FINSEQ_1:56  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x being set
for p being FinSequence holds
( p = <*x*> iff ( len p = 1 & rng p = {x} ) )
proof end;

theorem Th57: :: FINSEQ_1:57  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x being set
for p being FinSequence holds
( p = <*x*> iff ( len p = 1 & p . 1 = x ) )
proof end;

theorem :: FINSEQ_1:58  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x being set
for p being FinSequence holds (<*x*> ^ p) . 1 = x
proof end;

theorem Th59: :: FINSEQ_1:59  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x being set
for p being FinSequence holds (p ^ <*x*>) . ((len p) + 1) = x
proof end;

theorem Th60: :: FINSEQ_1:60  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x, y, z being set holds
( <*x,y,z*> = <*x*> ^ <*y,z*> & <*x,y,z*> = <*x,y*> ^ <*z*> ) by Th45;

theorem Th61: :: FINSEQ_1:61  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x, y being set
for p being FinSequence holds
( p = <*x,y*> iff ( len p = 2 & p . 1 = x & p . 2 = y ) )
proof end;

theorem :: FINSEQ_1:62  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for x, y, z being set
for p being FinSequence holds
( p = <*x,y,z*> iff ( len p = 3 & p . 1 = x & p . 2 = y & p . 3 = z ) )
proof end;

theorem Th63: :: FINSEQ_1:63  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p being FinSequence st p <> {} holds
ex q being FinSequence ex x being set st p = q ^ <*x*>
proof end;

definition
let D be non empty set ;
let x be Element of D;
:: original: <*
redefine func <*x*> -> FinSequence of D;
coherence
<*x*> is FinSequence of D
proof end;
end;

scheme :: FINSEQ_1:sch 3
IndSeq{ P1[ FinSequence] } :
for p being FinSequence holds P1[p]
provided
A1: P1[ {} ] and
A2: for p being FinSequence
for x being set st P1[p] holds
P1[p ^ <*x*>]
proof end;

theorem :: FINSEQ_1:64  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q, r, s being FinSequence st p ^ q = r ^ s & len p <= len r holds
ex t being FinSequence st p ^ t = r
proof end;

definition
let D be set ;
func D * -> set means :Def11: :: FINSEQ_1:def 11
for x being set holds
( x in it iff x is FinSequence of D );
existence
ex b1 being set st
for x being set holds
( x in b1 iff x is FinSequence of D )
proof end;
uniqueness
for b1, b2 being set st ( for x being set holds
( x in b1 iff x is FinSequence of D ) ) & ( for x being set holds
( x in b2 iff x is FinSequence of D ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def11 defines * FINSEQ_1:def 11 :
for D, b2 being set holds
( b2 = D * iff for x being set holds
( x in b2 iff x is FinSequence of D ) );

registration
let D be set ;
cluster D * -> non empty ;
coherence
not D * is empty
proof end;
end;

theorem :: FINSEQ_1:65  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence st rng p = rng q & p is one-to-one & q is one-to-one holds
len p = len q
proof end;

theorem :: FINSEQ_1:66  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for D being set holds {} in D *
proof end;

scheme :: FINSEQ_1:sch 4
SepSeq{ F1() -> non empty set , P1[ FinSequence] } :
ex X being set st
for x being set holds
( x in X iff ex p being FinSequence st
( p in F1() * & P1[p] & x = p ) )
proof end;

definition
let IT be Function;
attr IT is FinSubsequence-like means :Def12: :: FINSEQ_1:def 12
ex k being Nat st dom IT c= Seg k;
end;

:: deftheorem Def12 defines FinSubsequence-like FINSEQ_1:def 12 :
for IT being Function holds
( IT is FinSubsequence-like iff ex k being Nat st dom IT c= Seg k );

registration
cluster FinSubsequence-like set ;
existence
ex b1 being Function st b1 is FinSubsequence-like
proof end;
end;

definition
mode FinSubsequence is FinSubsequence-like Function;
end;

theorem :: FINSEQ_1:67  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem :: FINSEQ_1:68  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p being FinSequence holds p is FinSubsequence
proof end;

theorem :: FINSEQ_1:69  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for X being set
for p being FinSequence holds
( p | X is FinSubsequence & X | p is FinSubsequence )
proof end;

definition
let X be set ;
given k being natural number such that A1: X c= Seg k ;
func Sgm X -> FinSequence of NAT means :Def13: :: FINSEQ_1:def 13
( rng it = X & ( for l, m, k1, k2 being natural number st 1 <= l & l < m & m <= len it & k1 = it . l & k2 = it . m holds
k1 < k2 ) );
existence
ex b1 being FinSequence of NAT st
( rng b1 = X & ( for l, m, k1, k2 being natural number st 1 <= l & l < m & m <= len b1 & k1 = b1 . l & k2 = b1 . m holds
k1 < k2 ) )
proof end;
uniqueness
for b1, b2 being FinSequence of NAT st rng b1 = X & ( for l, m, k1, k2 being natural number st 1 <= l & l < m & m <= len b1 & k1 = b1 . l & k2 = b1 . m holds
k1 < k2 ) & rng b2 = X & ( for l, m, k1, k2 being natural number st 1 <= l & l < m & m <= len b2 & k1 = b2 . l & k2 = b2 . m holds
k1 < k2 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines Sgm FINSEQ_1:def 13 :
for X being set st ex k being natural number st X c= Seg k holds
for b2 being FinSequence of NAT holds
( b2 = Sgm X iff ( rng b2 = X & ( for l, m, k1, k2 being natural number st 1 <= l & l < m & m <= len b2 & k1 = b2 . l & k2 = b2 . m holds
k1 < k2 ) ) );

theorem :: FINSEQ_1:70  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th71: :: FINSEQ_1:71  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p' being FinSubsequence holds rng (Sgm (dom p')) = dom p'
proof end;

definition
let p' be FinSubsequence;
func Seq p' -> Function equals :: FINSEQ_1:def 14
p' * (Sgm (dom p'));
coherence
p' * (Sgm (dom p')) is Function
;
end;

:: deftheorem defines Seq FINSEQ_1:def 14 :
for p' being FinSubsequence holds Seq p' = p' * (Sgm (dom p'));

registration
let p' be FinSubsequence;
cluster Seq p' -> finite FinSequence-like ;
coherence
Seq p' is FinSequence-like
proof end;
end;

theorem :: FINSEQ_1:72  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for X being set st ex k being Nat st X c= Seg k holds
( Sgm X = {} iff X = {} )
proof end;

theorem :: FINSEQ_1:73  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for D being set holds
( D is finite iff ex p being FinSequence st D = rng p )
proof end;

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

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

registration
let R be finite Relation;
cluster rng R -> finite ;
coherence
rng R is finite
proof end;
end;

theorem :: FINSEQ_1:74  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for n, m being Nat st Seg n, Seg m are_equipotent holds
n = m
proof end;

theorem :: FINSEQ_1:75  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for n being Nat holds Seg n,n are_equipotent by Lm1;

theorem :: FINSEQ_1:76  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for n being Nat holds Card (Seg n) = Card n by Lm2;

theorem :: FINSEQ_1:77  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for X being set st X is finite holds
ex n being Nat st X, Seg n are_equipotent
proof end;

theorem :: FINSEQ_1:78  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
( ( for n being natural number holds card (Seg n) = n ) & ( for n being Nat holds
( card n = n & card (Card n) = n ) ) )
proof end;

registration
let x be set ;
cluster <*x*> -> non empty Relation-like Function-like finite FinSequence-like ;
coherence
not <*x*> is empty
;
end;

registration
cluster non empty finite set ;
existence
not for b1 being FinSequence holds b1 is empty
proof end;
end;

registration
let f1 be FinSequence;
let f2 be non empty FinSequence;
cluster f1 ^ f2 -> non empty finite ;
coherence
not f1 ^ f2 is empty
by Th48;
cluster f2 ^ f1 -> non empty finite ;
coherence
not f2 ^ f1 is empty
by Th48;
end;

scheme :: FINSEQ_1:sch 5
SeqDEx{ F1() -> non empty set , F2() -> Nat, P1[ set , set ] } :
ex p being FinSequence of F1() st
( dom p = Seg F2() & ( for k being Nat st k in Seg F2() holds
P1[k,p . k] ) )
provided
A1: for k being Nat st k in Seg F2() holds
ex x being Element of F1() st P1[k,x]
proof end;

definition
let D be set ;
let p be FinSequence of D;
let m be natural number ;
func p | m -> FinSequence of D equals :: FINSEQ_1:def 15
p | (Seg m);
coherence
p | (Seg m) is FinSequence of D
by Th23;
end;

:: deftheorem defines | FINSEQ_1:def 15 :
for D being set
for p being FinSequence of D
for m being natural number holds p | m = p | (Seg m);

registration
let D be set ;
let f be FinSequence of D;
cluster f | 0 -> empty finite FinSequence-like ;
coherence
f | 0 is empty
by Th4, RELAT_1:110;
end;

theorem :: FINSEQ_1:79  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for D being set
for p being FinSequence of D
for m being natural number st len p <= m holds
p | m = p
proof end;

theorem :: FINSEQ_1:80  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for D being set
for p being FinSequence of D
for m being natural number st m <= len p holds
len (p | m) = m
proof end;

theorem :: FINSEQ_1:81  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for n being Nat
for i, m being natural number st i in Seg n holds
i + m in Seg (n + m)
proof end;

theorem :: FINSEQ_1:82  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for n being Nat
for i, m being natural number st i > 0 & i + m in Seg (n + m) holds
( i in Seg n & i in Seg (n + m) )
proof end;

definition
let R be Relation;
func R [*] -> Relation means :: FINSEQ_1:def 16
for x, y being set holds
( [x,y] in it iff ( x in field R & y in field R & ex p being FinSequence st
( len p >= 1 & p . 1 = x & p . (len p) = y & ( for i being Nat st i >= 1 & i < len p holds
[(p . i),(p . (i + 1))] in R ) ) ) );
existence
ex b1 being Relation st
for x, y being set holds
( [x,y] in b1 iff ( x in field R & y in field R & ex p being FinSequence st
( len p >= 1 & p . 1 = x & p . (len p) = y & ( for i being Nat st i >= 1 & i < len p holds
[(p . i),(p . (i + 1))] in R ) ) ) )
proof end;
uniqueness
for b1, b2 being Relation st ( for x, y being set holds
( [x,y] in b1 iff ( x in field R & y in field R & ex p being FinSequence st
( len p >= 1 & p . 1 = x & p . (len p) = y & ( for i being Nat st i >= 1 & i < len p holds
[(p . i),(p . (i + 1))] in R ) ) ) ) ) & ( for x, y being set holds
( [x,y] in b2 iff ( x in field R & y in field R & ex p being FinSequence st
( len p >= 1 & p . 1 = x & p . (len p) = y & ( for i being Nat st i >= 1 & i < len p holds
[(p . i),(p . (i + 1))] in R ) ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem defines [*] FINSEQ_1:def 16 :
for R, b2 being Relation holds
( b2 = R [*] iff for x, y being set holds
( [x,y] in b2 iff ( x in field R & y in field R & ex p being FinSequence st
( len p >= 1 & p . 1 = x & p . (len p) = y & ( for i being Nat st i >= 1 & i < len p holds
[(p . i),(p . (i + 1))] in R ) ) ) ) );

theorem :: FINSEQ_1:83  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for D1, D2 being set st D1 c= D2 holds
D1 * c= D2 *
proof end;

registration
let D be set ;
cluster D * -> non empty functional ;
coherence
D * is functional
proof end;
end;

registration
let f be finite Function;
cluster dom f -> finite ;
coherence
dom f is finite
by FINSET_1:29;
end;

registration
let f be finite Function;
let x be set ;
cluster f " x -> finite ;
coherence
f " x is finite
proof end;
end;

theorem Th8: :: FINSEQ_1:84  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence st p c= q holds
len p <= len q
proof end;

theorem Th9: :: FINSEQ_1:85  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence
for i being Nat st 1 <= i & i <= len p holds
(p ^ q) . i = p . i
proof end;

theorem Th10: :: FINSEQ_1:86  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for p, q being FinSequence
for i being Nat st 1 <= i & i <= len q holds
(p ^ q) . ((len p) + i) = q . i
proof end;