:: ALGSEQ_1 semantic presentation

definition
let c1 be Nat;
func PSeg c1 -> set equals :: ALGSEQ_1:def 1
{ b1 where B is Nat : b1 < a1 } ;
coherence
{ b1 where B is Nat : b1 < c1 } is set
;
end;

:: deftheorem Def1 defines PSeg ALGSEQ_1:def 1 :
for b1 being Nat holds PSeg b1 = { b2 where B is Nat : b2 < b1 } ;

definition
let c1 be Nat;
redefine func PSeg as PSeg c1 -> Subset of NAT ;
coherence
PSeg c1 is Subset of NAT
proof end;
end;

Lemma1: for b1 being Nat
for b2 being set st b2 in PSeg b1 holds
b2 is Nat
;

theorem Th1: :: ALGSEQ_1:1
canceled;

theorem Th2: :: ALGSEQ_1:2
canceled;

theorem Th3: :: ALGSEQ_1:3
canceled;

theorem Th4: :: ALGSEQ_1:4
canceled;

theorem Th5: :: ALGSEQ_1:5
canceled;

theorem Th6: :: ALGSEQ_1:6
canceled;

theorem Th7: :: ALGSEQ_1:7
canceled;

theorem Th8: :: ALGSEQ_1:8
canceled;

theorem Th9: :: ALGSEQ_1:9
canceled;

theorem Th10: :: ALGSEQ_1:10
for b1, b2 being Nat holds
( b1 in PSeg b2 iff b1 < b2 )
proof end;

theorem Th11: :: ALGSEQ_1:11
( PSeg 0 = {} & PSeg 1 = {0} & PSeg 2 = {0,1} )
proof end;

theorem Th12: :: ALGSEQ_1:12
for b1 being Nat holds b1 in PSeg (b1 + 1)
proof end;

theorem Th13: :: ALGSEQ_1:13
for b1, b2 being Nat holds
( b1 <= b2 iff PSeg b1 c= PSeg b2 )
proof end;

theorem Th14: :: ALGSEQ_1:14
for b1, b2 being Nat st PSeg b1 = PSeg b2 holds
b1 = b2
proof end;

theorem Th15: :: ALGSEQ_1:15
for b1, b2 being Nat st b1 <= b2 holds
( PSeg b1 = (PSeg b1) /\ (PSeg b2) & PSeg b1 = (PSeg b2) /\ (PSeg b1) )
proof end;

theorem Th16: :: ALGSEQ_1:16
for b1, b2 being Nat st ( PSeg b1 = (PSeg b1) /\ (PSeg b2) or PSeg b1 = (PSeg b2) /\ (PSeg b1) ) holds
b1 <= b2
proof end;

theorem Th17: :: ALGSEQ_1:17
for b1 being Nat holds (PSeg b1) \/ {b1} = PSeg (b1 + 1)
proof end;

definition
let c1 be non empty ZeroStr ;
let c2 be sequence of c1;
attr a2 is finite-Support means :Def2: :: ALGSEQ_1:def 2
ex b1 being Nat st
for b2 being Nat st b2 >= b1 holds
a2 . b2 = 0. a1;
end;

:: deftheorem Def2 defines finite-Support ALGSEQ_1:def 2 :
for b1 being non empty ZeroStr
for b2 being sequence of b1 holds
( b2 is finite-Support iff ex b3 being Nat st
for b4 being Nat st b4 >= b3 holds
b2 . b4 = 0. b1 );

registration
let c1 be non empty ZeroStr ;
cluster finite-Support M5( NAT ,the carrier of a1);
existence
ex b1 being sequence of c1 st b1 is finite-Support
proof end;
end;

definition
let c1 be non empty ZeroStr ;
mode AlgSequence of a1 is finite-Support sequence of a1;
end;

definition
let c1 be non empty ZeroStr ;
let c2 be AlgSequence of c1;
let c3 be Nat;
pred c3 is_at_least_length_of c2 means :Def3: :: ALGSEQ_1:def 3
for b1 being Nat st b1 >= a3 holds
a2 . b1 = 0. a1;
end;

:: deftheorem Def3 defines is_at_least_length_of ALGSEQ_1:def 3 :
for b1 being non empty ZeroStr
for b2 being AlgSequence of b1
for b3 being Nat holds
( b3 is_at_least_length_of b2 iff for b4 being Nat st b4 >= b3 holds
b2 . b4 = 0. b1 );

Lemma10: for b1 being non empty ZeroStr
for b2 being AlgSequence of b1 ex b3 being Nat st b3 is_at_least_length_of b2
proof end;

Lemma11: for b1 being non empty ZeroStr
for b2 being AlgSequence of b1 ex b3 being Nat st
( b3 is_at_least_length_of b2 & ( for b4 being Nat st b4 is_at_least_length_of b2 holds
b3 <= b4 ) )
proof end;

Lemma12: for b1, b2 being Nat
for b3 being non empty ZeroStr
for b4 being AlgSequence of b3 st b1 is_at_least_length_of b4 & ( for b5 being Nat st b5 is_at_least_length_of b4 holds
b1 <= b5 ) & b2 is_at_least_length_of b4 & ( for b5 being Nat st b5 is_at_least_length_of b4 holds
b2 <= b5 ) holds
b1 = b2
proof end;

definition
let c1 be non empty ZeroStr ;
let c2 be AlgSequence of c1;
func len c2 -> Nat means :Def4: :: ALGSEQ_1:def 4
( a3 is_at_least_length_of a2 & ( for b1 being Nat st b1 is_at_least_length_of a2 holds
a3 <= b1 ) );
existence
ex b1 being Nat st
( b1 is_at_least_length_of c2 & ( for b2 being Nat st b2 is_at_least_length_of c2 holds
b1 <= b2 ) )
by Lemma11;
uniqueness
for b1, b2 being Nat st b1 is_at_least_length_of c2 & ( for b3 being Nat st b3 is_at_least_length_of c2 holds
b1 <= b3 ) & b2 is_at_least_length_of c2 & ( for b3 being Nat st b3 is_at_least_length_of c2 holds
b2 <= b3 ) holds
b1 = b2
by Lemma12;
end;

:: deftheorem Def4 defines len ALGSEQ_1:def 4 :
for b1 being non empty ZeroStr
for b2 being AlgSequence of b1
for b3 being Nat holds
( b3 = len b2 iff ( b3 is_at_least_length_of b2 & ( for b4 being Nat st b4 is_at_least_length_of b2 holds
b3 <= b4 ) ) );

theorem Th18: :: ALGSEQ_1:18
canceled;

theorem Th19: :: ALGSEQ_1:19
canceled;

theorem Th20: :: ALGSEQ_1:20
canceled;

theorem Th21: :: ALGSEQ_1:21
canceled;

theorem Th22: :: ALGSEQ_1:22
for b1 being Nat
for b2 being non empty ZeroStr
for b3 being AlgSequence of b2 st b1 >= len b3 holds
b3 . b1 = 0. b2
proof end;

theorem Th23: :: ALGSEQ_1:23
canceled;

theorem Th24: :: ALGSEQ_1:24
for b1 being Nat
for b2 being non empty ZeroStr
for b3 being AlgSequence of b2 st ( for b4 being Nat st b4 < b1 holds
b3 . b4 <> 0. b2 ) holds
len b3 >= b1
proof end;

theorem Th25: :: ALGSEQ_1:25
for b1 being Nat
for b2 being non empty ZeroStr
for b3 being AlgSequence of b2 st len b3 = b1 + 1 holds
b3 . b1 <> 0. b2
proof end;

definition
let c1 be non empty ZeroStr ;
let c2 be AlgSequence of c1;
func support c2 -> Subset of NAT equals :: ALGSEQ_1:def 5
PSeg (len a2);
coherence
PSeg (len c2) is Subset of NAT
;
end;

:: deftheorem Def5 defines support ALGSEQ_1:def 5 :
for b1 being non empty ZeroStr
for b2 being AlgSequence of b1 holds support b2 = PSeg (len b2);

theorem Th26: :: ALGSEQ_1:26
canceled;

theorem Th27: :: ALGSEQ_1:27
for b1 being Nat
for b2 being non empty ZeroStr
for b3 being AlgSequence of b2 holds
( b1 = len b3 iff PSeg b1 = support b3 ) by Th14;

scheme :: ALGSEQ_1:sch 1
s1{ F1() -> non empty ZeroStr , F2() -> Nat, F3( Nat) -> Element of F1() } :
ex b1 being AlgSequence of F1() st
( len b1 <= F2() & ( for b2 being Nat st b2 < F2() holds
b1 . b2 = F3(b2) ) )
proof end;

theorem Th28: :: ALGSEQ_1:28
for b1 being non empty ZeroStr
for b2, b3 being AlgSequence of b1 st len b2 = len b3 & ( for b4 being Nat st b4 < len b2 holds
b2 . b4 = b3 . b4 ) holds
b2 = b3
proof end;

theorem Th29: :: ALGSEQ_1:29
for b1 being non empty ZeroStr st the carrier of b1 <> {(0. b1)} holds
for b2 being Nat ex b3 being AlgSequence of b1 st len b3 = b2
proof end;

definition
let c1 be non empty ZeroStr ;
let c2 be Element of c1;
func <%c2%> -> AlgSequence of a1 means :Def6: :: ALGSEQ_1:def 6
( len a3 <= 1 & a3 . 0 = a2 );
existence
ex b1 being AlgSequence of c1 st
( len b1 <= 1 & b1 . 0 = c2 )
proof end;
uniqueness
for b1, b2 being AlgSequence of c1 st len b1 <= 1 & b1 . 0 = c2 & len b2 <= 1 & b2 . 0 = c2 holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines <% ALGSEQ_1:def 6 :
for b1 being non empty ZeroStr
for b2 being Element of b1
for b3 being AlgSequence of b1 holds
( b3 = <%b2%> iff ( len b3 <= 1 & b3 . 0 = b2 ) );

Lemma19: for b1 being non empty ZeroStr
for b2 being AlgSequence of b1 st b2 = <%(0. b1)%> holds
len b2 = 0
proof end;

theorem Th30: :: ALGSEQ_1:30
canceled;

theorem Th31: :: ALGSEQ_1:31
for b1 being non empty ZeroStr
for b2 being AlgSequence of b1 holds
( b2 = <%(0. b1)%> iff len b2 = 0 )
proof end;

theorem Th32: :: ALGSEQ_1:32
for b1 being non empty ZeroStr
for b2 being AlgSequence of b1 holds
( b2 = <%(0. b1)%> iff support b2 = {} )
proof end;

theorem Th33: :: ALGSEQ_1:33
for b1 being Nat
for b2 being non empty ZeroStr holds <%(0. b2)%> . b1 = 0. b2
proof end;

theorem Th34: :: ALGSEQ_1:34
for b1 being non empty ZeroStr
for b2 being AlgSequence of b1 holds
( b2 = <%(0. b1)%> iff rng b2 = {(0. b1)} )
proof end;