Article FINSEQ_7, MML version 4.99.1005
:: FINSEQ_7:th 1
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set
st 1 <= b3 & b4 <= len b2 & b3 < b4
holds b2 = ((((b2 | (b3 -' 1)) ^ <*b2 . b3*>) ^ ((b2 /^ b3) | ((b4 -' b3) -' 1))) ^ <*b2 . b4*>) ^ (b2 /^ b4);
:: FINSEQ_7:th 2
theorem
for b1 being natural set
for b2, b3, b4 being Relation-like Function-like FinSequence-like set
st len b3 = len b4 & len b3 < b1 & b1 <= len (b3 ^ b2)
holds (b3 ^ b2) . b1 = (b4 ^ b2) . b1;
:: FINSEQ_7:th 3
theorem
for b1 being natural set
for b2, b3 being Relation-like Function-like FinSequence-like set
st 1 <= b1 & b1 <= len b2
holds b2 . b1 = (b3 ^ b2) . ((len b3) + b1);
:: FINSEQ_7:th 4
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set
st b3 in dom (b2 /^ b4)
holds (b2 /^ b4) . b3 = b2 . (b4 + b3);
:: FINSEQ_7:funcnot 1 => FUNCT_7:func 2
notation
let a1 be non empty set;
let a2 be FinSequence of a1;
let a3 be natural set;
let a4 be Element of a1;
synonym Replace(a2,a3,a4) for a1 +*(a2,a3);
end;
:: FINSEQ_7:funcnot 2 => FINSEQ_7:func 1
definition
let a1 be non empty set;
let a2 be FinSequence of a1;
let a3 be natural set;
let a4 be Element of a1;
redefine func Replace(A2,A3,A4) -> FinSequence of a1 equals
((a2 | (a3 -' 1)) ^ <*a4*>) ^ (a2 /^ a3)
if 1 <= a3 & a3 <= len a2
otherwise a2;
end;
:: FINSEQ_7:def 1
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being natural set
for b4 being Element of b1 holds
(1 <= b3 & b3 <= len b2 implies Replace(b2,b3,b4) = ((b2 | (b3 -' 1)) ^ <*b4*>) ^ (b2 /^ b3)) &
(1 <= b3 & b3 <= len b2 or Replace(b2,b3,b4) = b2);
:: FINSEQ_7:th 7
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4 being natural set holds
len Replace(b2,b4,b3) = len b2;
:: FINSEQ_7:th 8
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4 being natural set holds
proj2 Replace(b2,b4,b3) c= (proj2 b2) \/ {b3};
:: FINSEQ_7:th 9
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4 being natural set
st 1 <= b4 & b4 <= len b2
holds b3 in proj2 Replace(b2,b4,b3);
:: FINSEQ_7:th 10
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4 being natural set
st 1 <= b4 & b4 <= len b2
holds (Replace(b2,b4,b3)) /. b4 = b3;
:: FINSEQ_7:th 11
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4 being natural set
st 1 <= b4 & b4 <= len b2
for b5 being natural set
st 0 < b5 & b5 <= (len b2) - b4
holds (Replace(b2,b4,b3)) . (b4 + b5) = (b2 /^ b4) . b5;
:: FINSEQ_7:th 12
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4, b5 being natural set
st 1 <= b4 & b4 <= len b2 & b4 <> b5
holds (Replace(b2,b5,b3)) /. b4 = b2 /. b4;
:: FINSEQ_7:th 13
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being Element of b1
for b5, b6 being natural set
st 1 <= b5 & b5 < b6 & b6 <= len b2
holds Replace(Replace(b2,b6,b3),b5,b4) = ((((b2 | (b5 -' 1)) ^ <*b4*>) ^ ((b2 /^ b5) | ((b6 -' b5) -' 1))) ^ <*b3*>) ^ (b2 /^ b6);
:: FINSEQ_7:th 14
theorem
for b1 being non empty set
for b2, b3 being Element of b1 holds
Replace(<*b2*>,1,b3) = <*b3*>;
:: FINSEQ_7:th 15
theorem
for b1 being non empty set
for b2, b3, b4 being Element of b1 holds
Replace(<*b2,b3*>,1,b4) = <*b4,b3*>;
:: FINSEQ_7:th 16
theorem
for b1 being non empty set
for b2, b3, b4 being Element of b1 holds
Replace(<*b2,b3*>,2,b4) = <*b2,b4*>;
:: FINSEQ_7:th 17
theorem
for b1 being non empty set
for b2, b3, b4, b5 being Element of b1 holds
Replace(<*b2,b3,b4*>,1,b5) = <*b5,b3,b4*>;
:: FINSEQ_7:th 18
theorem
for b1 being non empty set
for b2, b3, b4, b5 being Element of b1 holds
Replace(<*b2,b3,b4*>,2,b5) = <*b2,b5,b4*>;
:: FINSEQ_7:th 19
theorem
for b1 being non empty set
for b2, b3, b4, b5 being Element of b1 holds
Replace(<*b2,b3,b4*>,3,b5) = <*b2,b3,b5*>;
:: FINSEQ_7:funcreg 1
registration
let a1 be Relation-like Function-like FinSequence-like set;
let a2, a3 be natural set;
cluster Swap(a1,a2,a3) -> FinSequence-like;
end;
:: FINSEQ_7:funcnot 3 => FINSEQ_7:func 2
definition
let a1 be non empty set;
let a2 be FinSequence of a1;
let a3, a4 be natural set;
redefine func Swap(A2,A3,A4) -> FinSequence of a1 equals
Replace(Replace(a2,a3,a2 /. a4),a4,a2 /. a3)
if 1 <= a3 & a3 <= len a2 & 1 <= a4 & a4 <= len a2
otherwise a2;
end;
:: FINSEQ_7:def 2
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set holds
(1 <= b3 & b3 <= len b2 & 1 <= b4 & b4 <= len b2 implies Swap(b2,b3,b4) = Replace(Replace(b2,b3,b2 /. b4),b4,b2 /. b3)) &
(1 <= b3 & b3 <= len b2 & 1 <= b4 & b4 <= len b2 or Swap(b2,b3,b4) = b2);
:: FINSEQ_7:th 20
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set holds
len Swap(b2,b3,b4) = len b2;
:: FINSEQ_7:th 21
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being natural set holds
Swap(b2,b3,b3) = b2;
:: FINSEQ_7:th 22
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set holds
Swap(Swap(b2,b3,b4),b4,b3) = b2;
:: FINSEQ_7:th 23
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set holds
Swap(b2,b3,b4) = Swap(b2,b4,b3);
:: FINSEQ_7:th 24
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set holds
proj2 Swap(b2,b3,b4) = proj2 b2;
:: FINSEQ_7:th 25
theorem
for b1 being non empty set
for b2, b3 being Element of b1 holds
Swap(<*b2,b3*>,1,2) = <*b3,b2*>;
:: FINSEQ_7:th 26
theorem
for b1 being non empty set
for b2, b3, b4 being Element of b1 holds
Swap(<*b2,b3,b4*>,1,2) = <*b3,b2,b4*>;
:: FINSEQ_7:th 27
theorem
for b1 being non empty set
for b2, b3, b4 being Element of b1 holds
Swap(<*b2,b3,b4*>,1,3) = <*b4,b3,b2*>;
:: FINSEQ_7:th 28
theorem
for b1 being non empty set
for b2, b3, b4 being Element of b1 holds
Swap(<*b2,b3,b4*>,2,3) = <*b2,b4,b3*>;
:: FINSEQ_7:th 29
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set
st 1 <= b3 & b3 < b4 & b4 <= len b2
holds Swap(b2,b3,b4) = ((((b2 | (b3 -' 1)) ^ <*b2 /. b4*>) ^ ((b2 /^ b3) | ((b4 -' b3) -' 1))) ^ <*b2 /. b3*>) ^ (b2 /^ b4);
:: FINSEQ_7:th 30
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being natural set
st 1 < b3 & b3 <= len b2
holds Swap(b2,1,b3) = ((<*b2 /. b3*> ^ ((b2 /^ 1) | (b3 -' 2))) ^ <*b2 /. 1*>) ^ (b2 /^ b3);
:: FINSEQ_7:th 31
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being natural set
st 1 <= b3 & b3 < len b2
holds Swap(b2,b3,len b2) = (((b2 | (b3 -' 1)) ^ <*b2 /. len b2*>) ^ ((b2 /^ b3) | (((len b2) -' b3) -' 1))) ^ <*b2 /. b3*>;
:: FINSEQ_7:th 32
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4, b5 being natural set
st b3 <> b4 & b5 <> b4 & 1 <= b4 & b4 <= len b2
holds (Swap(b2,b3,b5)) /. b4 = b2 /. b4;
:: FINSEQ_7:th 33
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4 being natural set
st 1 <= b3 & b3 <= len b2 & 1 <= b4 & b4 <= len b2
holds (Swap(b2,b3,b4)) /. b3 = b2 /. b4 & (Swap(b2,b3,b4)) /. b4 = b2 /. b3;
:: FINSEQ_7:th 34
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4, b5 being natural set
st 1 <= b4 & b4 <= len b2 & 1 <= b5 & b5 <= len b2
holds Replace(Swap(b2,b4,b5),b4,b3) = Swap(Replace(b2,b5,b3),b4,b5);
:: FINSEQ_7:th 35
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1
for b4, b5, b6 being natural set
st b4 <> b5 & b6 <> b5 & 1 <= b4 & b4 <= len b2 & 1 <= b6 & b6 <= len b2 & 1 <= b5 & b5 <= len b2
holds Swap(Replace(b2,b5,b3),b4,b6) = Replace(Swap(b2,b4,b6),b5,b3);
:: FINSEQ_7:th 36
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4, b5 being natural set
st b3 <> b4 & b5 <> b4 & 1 <= b3 & b3 <= len b2 & 1 <= b5 & b5 <= len b2 & 1 <= b4 & b4 <= len b2
holds Swap(Swap(b2,b3,b5),b5,b4) = Swap(Swap(b2,b3,b4),b3,b5);
:: FINSEQ_7:th 37
theorem
for b1 being non empty set
for b2 being FinSequence of b1
for b3, b4, b5, b6 being natural set
st b3 <> b4 & b5 <> b4 & b6 <> b3 & b6 <> b5 & 1 <= b3 & b3 <= len b2 & 1 <= b5 & b5 <= len b2 & 1 <= b4 & b4 <= len b2 & 1 <= b6 & b6 <= len b2
holds Swap(Swap(b2,b3,b5),b4,b6) = Swap(Swap(b2,b4,b6),b3,b5);