:: Construction of Finite Sequences over Ring and Left-, Right-, and Bi-Modules over a Ring
:: by Micha{\l} Muzalewski and Les{\l}aw W. Szczerba
::
:: Received September 13, 1990
:: Copyright (c) 1990-2021 Association of Mizar Users


definition
let R be non empty ZeroStr ;
let F be sequence of R;
redefine attr F is finite-Support means :Def1: :: ALGSEQ_1:def 1
ex n being Nat st
for i being Nat st i >= n holds
F . i = 0. R;
compatibility
( F is finite-Support iff ex n being Nat st
for i being Nat st i >= n holds
F . i = 0. R )
proof end;
end;

:: deftheorem Def1 defines finite-Support ALGSEQ_1:def 1 :
for R being non empty ZeroStr
for F being sequence of R holds
( F is finite-Support iff ex n being Nat st
for i being Nat st i >= n holds
F . i = 0. R );

registration
let R be non empty ZeroStr ;
cluster Relation-like NAT -defined the carrier of R -valued Function-like V18( NAT , the carrier of R) finite-Support for Element of K19(K20(NAT, the carrier of R));
existence
ex b1 being sequence of R st b1 is finite-Support
proof end;
end;

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

definition
let R be non empty ZeroStr ;
let p be AlgSequence of R;
let k be Nat;
pred k is_at_least_length_of p means :Def2: :: ALGSEQ_1:def 2
for i being Nat st i >= k holds
p . i = 0. R;
end;

:: deftheorem Def2 defines is_at_least_length_of ALGSEQ_1:def 2 :
for R being non empty ZeroStr
for p being AlgSequence of R
for k being Nat holds
( k is_at_least_length_of p iff for i being Nat st i >= k holds
p . i = 0. R );

Lm1: for R being non empty ZeroStr
for p being AlgSequence of R ex m being Nat st m is_at_least_length_of p

proof end;

definition
let R be non empty ZeroStr ;
let p be AlgSequence of R;
func len p -> Element of NAT means :Def3: :: ALGSEQ_1:def 3
( it is_at_least_length_of p & ( for m being Nat st m is_at_least_length_of p holds
it <= m ) );
existence
ex b1 being Element of NAT st
( b1 is_at_least_length_of p & ( for m being Nat st m is_at_least_length_of p holds
b1 <= m ) )
proof end;
uniqueness
for b1, b2 being Element of NAT st b1 is_at_least_length_of p & ( for m being Nat st m is_at_least_length_of p holds
b1 <= m ) & b2 is_at_least_length_of p & ( for m being Nat st m is_at_least_length_of p holds
b2 <= m ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines len ALGSEQ_1:def 3 :
for R being non empty ZeroStr
for p being AlgSequence of R
for b3 being Element of NAT holds
( b3 = len p iff ( b3 is_at_least_length_of p & ( for m being Nat st m is_at_least_length_of p holds
b3 <= m ) ) );

theorem :: ALGSEQ_1:1
canceled;

theorem :: ALGSEQ_1:2
canceled;

theorem :: ALGSEQ_1:3
canceled;

theorem :: ALGSEQ_1:4
canceled;

theorem :: ALGSEQ_1:5
canceled;

theorem :: ALGSEQ_1:6
canceled;

theorem :: ALGSEQ_1:7
canceled;

::$CT 7
theorem Th1: :: ALGSEQ_1:8
for i being Nat
for R being non empty ZeroStr
for p being AlgSequence of R st i >= len p holds
p . i = 0. R
proof end;

theorem Th2: :: ALGSEQ_1:9
for k being Nat
for R being non empty ZeroStr
for p being AlgSequence of R st ( for i being Nat st i < k holds
p . i <> 0. R ) holds
len p >= k
proof end;

theorem Th3: :: ALGSEQ_1:10
for k being Nat
for R being non empty ZeroStr
for p being AlgSequence of R st len p = k + 1 holds
p . k <> 0. R
proof end;

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

theorem :: ALGSEQ_1:11
canceled;

::$CT
theorem Th4: :: ALGSEQ_1:12
for R being non empty ZeroStr
for p, q being AlgSequence of R st len p = len q & ( for k being Nat st k < len p holds
p . k = q . k ) holds
p = q
proof end;

theorem :: ALGSEQ_1:13
for R being non empty ZeroStr st the carrier of R <> {(0. R)} holds
for k being Nat ex p being AlgSequence of R st len p = k
proof end;

definition
let R be non empty ZeroStr ;
let x be Element of R;
func <%x%> -> AlgSequence of R means :Def4: :: ALGSEQ_1:def 5
( len it <= 1 & it . 0 = x );
existence
ex b1 being AlgSequence of R st
( len b1 <= 1 & b1 . 0 = x )
proof end;
uniqueness
for b1, b2 being AlgSequence of R st len b1 <= 1 & b1 . 0 = x & len b2 <= 1 & b2 . 0 = x holds
b1 = b2
proof end;
end;

:: deftheorem ALGSEQ_1:def 4 :
canceled;

:: deftheorem Def4 defines <% ALGSEQ_1:def 5 :
for R being non empty ZeroStr
for x being Element of R
for b3 being AlgSequence of R holds
( b3 = <%x%> iff ( len b3 <= 1 & b3 . 0 = x ) );

Lm2: for R being non empty ZeroStr
for p being AlgSequence of R st p = <%(0. R)%> holds
len p = 0

proof end;

theorem Th6: :: ALGSEQ_1:14
for R being non empty ZeroStr
for p being AlgSequence of R holds
( p = <%(0. R)%> iff len p = 0 )
proof end;

theorem :: ALGSEQ_1:15
canceled;

::$CT
theorem Th7: :: ALGSEQ_1:16
for i being Nat
for R being non empty ZeroStr holds <%(0. R)%> . i = 0. R
proof end;

theorem :: ALGSEQ_1:17
for R being non empty ZeroStr
for p being AlgSequence of R holds
( p = <%(0. R)%> iff rng p = {(0. R)} )
proof end;