:: FINSEQ_4 semantic presentation

definition
let c1 be Function;
let c2 be set ;
pred c1 is_one-to-one_at c2 means :Def1: :: FINSEQ_4:def 1
a1 " (a1 .: {a2}) = {a2};
end;

:: deftheorem Def1 defines is_one-to-one_at FINSEQ_4:def 1 :
for b1 being Function
for b2 being set holds
( b1 is_one-to-one_at b2 iff b1 " (b1 .: {b2}) = {b2} );

theorem Th1: :: FINSEQ_4:1
canceled;

theorem Th2: :: FINSEQ_4:2
for b1 being Function
for b2 being set st b1 is_one-to-one_at b2 holds
b2 in dom b1
proof end;

theorem Th3: :: FINSEQ_4:3
for b1 being Function
for b2 being set holds
( b1 is_one-to-one_at b2 iff ( b2 in dom b1 & b1 " {(b1 . b2)} = {b2} ) )
proof end;

theorem Th4: :: FINSEQ_4:4
for b1 being Function
for b2 being set holds
( b1 is_one-to-one_at b2 iff ( b2 in dom b1 & ( for b3 being set st b3 in dom b1 & b2 <> b3 holds
b1 . b2 <> b1 . b3 ) ) )
proof end;

theorem Th5: :: FINSEQ_4:5
for b1 being Function holds
( ( for b2 being set st b2 in dom b1 holds
b1 is_one-to-one_at b2 ) iff b1 is one-to-one )
proof end;

definition
let c1 be Function;
let c2 be set ;
pred c1 just_once_values c2 means :Def2: :: FINSEQ_4:def 2
ex b1 being finite set st
( b1 = a1 " {a2} & card b1 = 1 );
end;

:: deftheorem Def2 defines just_once_values FINSEQ_4:def 2 :
for b1 being Function
for b2 being set holds
( b1 just_once_values b2 iff ex b3 being finite set st
( b3 = b1 " {b2} & card b3 = 1 ) );

theorem Th6: :: FINSEQ_4:6
canceled;

theorem Th7: :: FINSEQ_4:7
for b1 being Function
for b2 being set st b1 just_once_values b2 holds
b2 in rng b1
proof end;

theorem Th8: :: FINSEQ_4:8
for b1 being Function
for b2 being set holds
( b1 just_once_values b2 iff ex b3 being set st {b3} = b1 " {b2} )
proof end;

theorem Th9: :: FINSEQ_4:9
for b1 being Function
for b2 being set holds
( b1 just_once_values b2 iff ex b3 being set st
( b3 in dom b1 & b2 = b1 . b3 & ( for b4 being set st b4 in dom b1 & b4 <> b3 holds
b1 . b4 <> b2 ) ) )
proof end;

theorem Th10: :: FINSEQ_4:10
for b1 being Function holds
( b1 is one-to-one iff for b2 being set st b2 in rng b1 holds
b1 just_once_values b2 )
proof end;

theorem Th11: :: FINSEQ_4:11
for b1 being Function
for b2 being set holds
( b1 is_one-to-one_at b2 iff ( b2 in dom b1 & b1 just_once_values b1 . b2 ) )
proof end;

definition
let c1 be Function;
let c2 be set ;
assume E11: c1 just_once_values c2 ;
func c1 <- c2 -> set means :Def3: :: FINSEQ_4:def 3
( a3 in dom a1 & a1 . a3 = a2 );
existence
ex b1 being set st
( b1 in dom c1 & c1 . b1 = c2 )
proof end;
uniqueness
for b1, b2 being set st b1 in dom c1 & c1 . b1 = c2 & b2 in dom c1 & c1 . b2 = c2 holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines <- FINSEQ_4:def 3 :
for b1 being Function
for b2 being set st b1 just_once_values b2 holds
for b3 being set holds
( b3 = b1 <- b2 iff ( b3 in dom b1 & b1 . b3 = b2 ) );

theorem Th12: :: FINSEQ_4:12
canceled;

theorem Th13: :: FINSEQ_4:13
canceled;

theorem Th14: :: FINSEQ_4:14
canceled;

theorem Th15: :: FINSEQ_4:15
canceled;

theorem Th16: :: FINSEQ_4:16
for b1 being Function
for b2 being set st b1 just_once_values b2 holds
b1 .: {(b1 <- b2)} = {b2}
proof end;

theorem Th17: :: FINSEQ_4:17
for b1 being Function
for b2 being set st b1 just_once_values b2 holds
b1 " {b2} = {(b1 <- b2)}
proof end;

theorem Th18: :: FINSEQ_4:18
for b1 being Function
for b2 being set st b1 is one-to-one & b2 in rng b1 holds
(b1 " ) . b2 = b1 <- b2
proof end;

theorem Th19: :: FINSEQ_4:19
canceled;

theorem Th20: :: FINSEQ_4:20
for b1 being Function
for b2 being set st b1 is_one-to-one_at b2 holds
b1 <- (b1 . b2) = b2
proof end;

theorem Th21: :: FINSEQ_4:21
for b1 being Function
for b2 being set st b1 just_once_values b2 holds
b1 is_one-to-one_at b1 <- b2
proof end;

definition
let c1 be non empty set ;
let c2, c3 be Element of c1;
redefine func <* as <*c2,c3*> -> FinSequence of a1;
coherence
<*c2,c3*> is FinSequence of c1
by FINSEQ_2:15;
end;

definition
let c1 be non empty set ;
let c2, c3, c4 be Element of c1;
redefine func <* as <*c2,c3,c4*> -> FinSequence of a1;
coherence
<*c2,c3,c4*> is FinSequence of c1
by FINSEQ_2:16;
end;

definition
let c1, c2 be set ;
let c3 be PartFunc of c1,c2;
let c4 be set ;
assume E13: c4 in dom c3 ;
func c3 /. c4 -> Element of a2 equals :Def4: :: FINSEQ_4:def 4
a3 . a4;
coherence
c3 . c4 is Element of c2
by E13, PARTFUN1:27;
end;

:: deftheorem Def4 defines /. FINSEQ_4:def 4 :
for b1, b2 being set
for b3 being PartFunc of b1,b2
for b4 being set st b4 in dom b3 holds
b3 /. b4 = b3 . b4;

theorem Th22: :: FINSEQ_4:22
for b1, b2 being non empty set
for b3 being Function of b1,b2
for b4 being Element of b1 holds b3 /. b4 = b3 . b4
proof end;

theorem Th23: :: FINSEQ_4:23
canceled;

theorem Th24: :: FINSEQ_4:24
for b1 being set
for b2 being FinSequence of b1
for b3 being Nat st 1 <= b3 & b3 <= len b2 holds
b2 /. b3 = b2 . b3
proof end;

theorem Th25: :: FINSEQ_4:25
for b1 being non empty set
for b2 being Element of b1 holds <*b2*> /. 1 = b2
proof end;

theorem Th26: :: FINSEQ_4:26
for b1 being non empty set
for b2, b3 being Element of b1 holds
( <*b2,b3*> /. 1 = b2 & <*b2,b3*> /. 2 = b3 )
proof end;

theorem Th27: :: FINSEQ_4:27
for b1 being non empty set
for b2, b3, b4 being Element of b1 holds
( <*b2,b3,b4*> /. 1 = b2 & <*b2,b3,b4*> /. 2 = b3 & <*b2,b3,b4*> /. 3 = b4 )
proof end;

definition
let c1 be FinSequence;
let c2 be set ;
func c2 .. c1 -> Nat equals :: FINSEQ_4:def 5
(Sgm (a1 " {a2})) . 1;
coherence
(Sgm (c1 " {c2})) . 1 is Nat
proof end;
end;

:: deftheorem Def5 defines .. FINSEQ_4:def 5 :
for b1 being FinSequence
for b2 being set holds b2 .. b1 = (Sgm (b1 " {b2})) . 1;

theorem Th28: :: FINSEQ_4:28
canceled;

theorem Th29: :: FINSEQ_4:29
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
b1 . (b2 .. b1) = b2
proof end;

theorem Th30: :: FINSEQ_4:30
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
b2 .. b1 in dom b1
proof end;

theorem Th31: :: FINSEQ_4:31
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
( 1 <= b2 .. b1 & b2 .. b1 <= len b1 )
proof end;

theorem Th32: :: FINSEQ_4:32
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
( (b2 .. b1) - 1 is Nat & (len b1) - (b2 .. b1) is Nat )
proof end;

theorem Th33: :: FINSEQ_4:33
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
b2 .. b1 in b1 " {b2}
proof end;

theorem Th34: :: FINSEQ_4:34
for b1 being FinSequence
for b2 being set
for b3 being Nat st b3 in dom b1 & b3 < b2 .. b1 holds
b1 . b3 <> b2
proof end;

theorem Th35: :: FINSEQ_4:35
for b1 being FinSequence
for b2 being set st b1 just_once_values b2 holds
b1 <- b2 = b2 .. b1
proof end;

theorem Th36: :: FINSEQ_4:36
for b1 being FinSequence
for b2 being set st b1 just_once_values b2 holds
for b3 being Nat st b3 in dom b1 & b3 <> b2 .. b1 holds
b1 . b3 <> b2
proof end;

theorem Th37: :: FINSEQ_4:37
for b1 being FinSequence
for b2 being set st b2 in rng b1 & ( for b3 being Nat st b3 in dom b1 & b3 <> b2 .. b1 holds
b1 . b3 <> b2 ) holds
b1 just_once_values b2
proof end;

theorem Th38: :: FINSEQ_4:38
for b1 being FinSequence
for b2 being set holds
( b1 just_once_values b2 iff ( b2 in rng b1 & {(b2 .. b1)} = b1 " {b2} ) )
proof end;

theorem Th39: :: FINSEQ_4:39
for b1 being FinSequence
for b2 being set st b1 is one-to-one & b2 in rng b1 holds
{(b2 .. b1)} = b1 " {b2}
proof end;

theorem Th40: :: FINSEQ_4:40
for b1 being FinSequence
for b2 being set holds
( b1 just_once_values b2 iff len (b1 - {b2}) = (len b1) - 1 )
proof end;

theorem Th41: :: FINSEQ_4:41
for b1 being FinSequence
for b2 being set st b1 just_once_values b2 holds
for b3 being Nat st b3 in dom (b1 - {b2}) holds
( ( b3 < b2 .. b1 implies (b1 - {b2}) . b3 = b1 . b3 ) & ( b2 .. b1 <= b3 implies (b1 - {b2}) . b3 = b1 . (b3 + 1) ) )
proof end;

theorem Th42: :: FINSEQ_4:42
for b1 being FinSequence
for b2 being set st b1 is one-to-one & b2 in rng b1 holds
for b3 being Nat st b3 in dom (b1 - {b2}) holds
( ( (b1 - {b2}) . b3 = b1 . b3 implies b3 < b2 .. b1 ) & ( b3 < b2 .. b1 implies (b1 - {b2}) . b3 = b1 . b3 ) & ( (b1 - {b2}) . b3 = b1 . (b3 + 1) implies b2 .. b1 <= b3 ) & ( b2 .. b1 <= b3 implies (b1 - {b2}) . b3 = b1 . (b3 + 1) ) )
proof end;

definition
let c1 be FinSequence;
let c2 be set ;
assume E26: c2 in rng c1 ;
func c1 -| c2 -> FinSequence means :Def6: :: FINSEQ_4:def 6
ex b1 being Nat st
( b1 = (a2 .. a1) - 1 & a3 = a1 | (Seg b1) );
existence
ex b1 being FinSequenceex b2 being Nat st
( b2 = (c2 .. c1) - 1 & b1 = c1 | (Seg b2) )
proof end;
uniqueness
for b1, b2 being FinSequence st ex b3 being Nat st
( b3 = (c2 .. c1) - 1 & b1 = c1 | (Seg b3) ) & ex b3 being Nat st
( b3 = (c2 .. c1) - 1 & b2 = c1 | (Seg b3) ) holds
b1 = b2
;
end;

:: deftheorem Def6 defines -| FINSEQ_4:def 6 :
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
for b3 being FinSequence holds
( b3 = b1 -| b2 iff ex b4 being Nat st
( b4 = (b2 .. b1) - 1 & b3 = b1 | (Seg b4) ) );

theorem Th43: :: FINSEQ_4:43
canceled;

theorem Th44: :: FINSEQ_4:44
canceled;

theorem Th45: :: FINSEQ_4:45
for b1 being FinSequence
for b2 being set
for b3 being Nat st b2 in rng b1 & b3 = (b2 .. b1) - 1 holds
b1 | (Seg b3) = b1 -| b2
proof end;

theorem Th46: :: FINSEQ_4:46
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
len (b1 -| b2) = (b2 .. b1) - 1
proof end;

theorem Th47: :: FINSEQ_4:47
for b1 being FinSequence
for b2 being set
for b3 being Nat st b2 in rng b1 & b3 = (b2 .. b1) - 1 holds
dom (b1 -| b2) = Seg b3
proof end;

theorem Th48: :: FINSEQ_4:48
for b1 being FinSequence
for b2 being set
for b3 being Nat st b2 in rng b1 & b3 in dom (b1 -| b2) holds
b1 . b3 = (b1 -| b2) . b3
proof end;

theorem Th49: :: FINSEQ_4:49
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
not b2 in rng (b1 -| b2)
proof end;

theorem Th50: :: FINSEQ_4:50
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
rng (b1 -| b2) misses {b2}
proof end;

theorem Th51: :: FINSEQ_4:51
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
rng (b1 -| b2) c= rng b1
proof end;

theorem Th52: :: FINSEQ_4:52
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
( b2 .. b1 = 1 iff b1 -| b2 = {} )
proof end;

theorem Th53: :: FINSEQ_4:53
for b1 being FinSequence
for b2 being set
for b3 being non empty set st b2 in rng b1 & b1 is FinSequence of b3 holds
b1 -| b2 is FinSequence of b3
proof end;

definition
let c1 be FinSequence;
let c2 be set ;
assume E32: c2 in rng c1 ;
func c1 |-- c2 -> FinSequence means :Def7: :: FINSEQ_4:def 7
( len a3 = (len a1) - (a2 .. a1) & ( for b1 being Nat st b1 in dom a3 holds
a3 . b1 = a1 . (b1 + (a2 .. a1)) ) );
existence
ex b1 being FinSequence st
( len b1 = (len c1) - (c2 .. c1) & ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 = c1 . (b2 + (c2 .. c1)) ) )
proof end;
uniqueness
for b1, b2 being FinSequence st len b1 = (len c1) - (c2 .. c1) & ( for b3 being Nat st b3 in dom b1 holds
b1 . b3 = c1 . (b3 + (c2 .. c1)) ) & len b2 = (len c1) - (c2 .. c1) & ( for b3 being Nat st b3 in dom b2 holds
b2 . b3 = c1 . (b3 + (c2 .. c1)) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines |-- FINSEQ_4:def 7 :
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
for b3 being FinSequence holds
( b3 = b1 |-- b2 iff ( len b3 = (len b1) - (b2 .. b1) & ( for b4 being Nat st b4 in dom b3 holds
b3 . b4 = b1 . (b4 + (b2 .. b1)) ) ) );

theorem Th54: :: FINSEQ_4:54
canceled;

theorem Th55: :: FINSEQ_4:55
canceled;

theorem Th56: :: FINSEQ_4:56
canceled;

theorem Th57: :: FINSEQ_4:57
for b1 being FinSequence
for b2 being set
for b3 being Nat st b2 in rng b1 & b3 = (len b1) - (b2 .. b1) holds
dom (b1 |-- b2) = Seg b3
proof end;

theorem Th58: :: FINSEQ_4:58
for b1 being FinSequence
for b2 being set
for b3 being Nat st b2 in rng b1 & b3 in dom (b1 |-- b2) holds
b3 + (b2 .. b1) in dom b1
proof end;

theorem Th59: :: FINSEQ_4:59
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
rng (b1 |-- b2) c= rng b1
proof end;

theorem Th60: :: FINSEQ_4:60
for b1 being FinSequence
for b2 being set holds
( b1 just_once_values b2 iff ( b2 in rng b1 & not b2 in rng (b1 |-- b2) ) )
proof end;

theorem Th61: :: FINSEQ_4:61
for b1 being FinSequence
for b2 being set st b2 in rng b1 & b1 is one-to-one holds
not b2 in rng (b1 |-- b2)
proof end;

theorem Th62: :: FINSEQ_4:62
for b1 being FinSequence
for b2 being set holds
( b1 just_once_values b2 iff ( b2 in rng b1 & rng (b1 |-- b2) misses {b2} ) )
proof end;

theorem Th63: :: FINSEQ_4:63
for b1 being FinSequence
for b2 being set st b2 in rng b1 & b1 is one-to-one holds
rng (b1 |-- b2) misses {b2}
proof end;

theorem Th64: :: FINSEQ_4:64
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
( b2 .. b1 = len b1 iff b1 |-- b2 = {} )
proof end;

theorem Th65: :: FINSEQ_4:65
for b1 being FinSequence
for b2 being set
for b3 being non empty set st b2 in rng b1 & b1 is FinSequence of b3 holds
b1 |-- b2 is FinSequence of b3
proof end;

theorem Th66: :: FINSEQ_4:66
for b1 being FinSequence
for b2 being set st b2 in rng b1 holds
b1 = ((b1 -| b2) ^ <*b2*>) ^ (b1 |-- b2)
proof end;

theorem Th67: :: FINSEQ_4:67
for b1 being FinSequence
for b2 being set st b2 in rng b1 & b1 is one-to-one holds
b1 -| b2 is one-to-one
proof end;

theorem Th68: :: FINSEQ_4:68
for b1 being FinSequence
for b2 being set st b2 in rng b1 & b1 is one-to-one holds
b1 |-- b2 is one-to-one
proof end;

theorem Th69: :: FINSEQ_4:69
for b1 being FinSequence
for b2 being set holds
( b1 just_once_values b2 iff ( b2 in rng b1 & b1 - {b2} = (b1 -| b2) ^ (b1 |-- b2) ) )
proof end;

theorem Th70: :: FINSEQ_4:70
for b1 being FinSequence
for b2 being set st b2 in rng b1 & b1 is one-to-one holds
b1 - {b2} = (b1 -| b2) ^ (b1 |-- b2)
proof end;

theorem Th71: :: FINSEQ_4:71
for b1 being FinSequence
for b2 being set st b2 in rng b1 & b1 - {b2} is one-to-one & b1 - {b2} = (b1 -| b2) ^ (b1 |-- b2) holds
b1 is one-to-one
proof end;

theorem Th72: :: FINSEQ_4:72
for b1 being FinSequence
for b2 being set st b2 in rng b1 & b1 is one-to-one holds
rng (b1 -| b2) misses rng (b1 |-- b2)
proof end;

theorem Th73: :: FINSEQ_4:73
for b1 being set st b1 is finite holds
ex b2 being FinSequence st
( rng b2 = b1 & b2 is one-to-one )
proof end;

theorem Th74: :: FINSEQ_4:74
for b1 being FinSequence st rng b1 c= dom b1 & b1 is one-to-one holds
rng b1 = dom b1
proof end;

theorem Th75: :: FINSEQ_4:75
for b1 being FinSequence st rng b1 = dom b1 holds
b1 is one-to-one
proof end;

theorem Th76: :: FINSEQ_4:76
for b1, b2 being FinSequence st rng b1 = rng b2 & len b1 = len b2 & b2 is one-to-one holds
b1 is one-to-one
proof end;

Lemma43: for b1, b2 being finite set
for b3 being Function of b1,b2 st card b1 = card b2 & rng b3 = b2 holds
b3 is one-to-one
proof end;

theorem Th77: :: FINSEQ_4:77
for b1 being FinSequence holds
( b1 is one-to-one iff card (rng b1) = len b1 )
proof end;

theorem Th78: :: FINSEQ_4:78
for b1, b2 being finite set
for b3 being Function of b1,b2 st card b1 = card b2 & b3 is one-to-one holds
rng b3 = b2
proof end;

theorem Th79: :: FINSEQ_4:79
for b1, b2 being finite set
for b3 being Function of b1,b2 st card b1 = card b2 & rng b3 = b2 holds
b3 is one-to-one by Lemma43;

theorem Th80: :: FINSEQ_4:80
for b1, b2 being set
for b3 being Function of b2,b1 st Card b1 <` Card b2 & b1 <> {} holds
ex b4, b5 being set st
( b4 in b2 & b5 in b2 & b4 <> b5 & b3 . b4 = b3 . b5 )
proof end;

theorem Th81: :: FINSEQ_4:81
for b1, b2 being set
for b3 being Function of b1,b2 st Card b1 <` Card b2 holds
ex b4 being set st
( b4 in b2 & ( for b5 being set st b5 in b1 holds
b3 . b5 <> b4 ) )
proof end;

theorem Th82: :: FINSEQ_4:82
for b1 being non empty set
for b2 being FinSequence of b1
for b3 being Element of b1 holds (b2 ^ <*b3*>) /. ((len b2) + 1) = b3
proof end;

theorem Th83: :: FINSEQ_4:83
for b1 being Nat
for b2 being non empty set
for b3, b4 being FinSequence of b2 st b1 in dom b3 holds
(b3 ^ b4) /. b1 = b3 /. b1
proof end;

theorem Th84: :: FINSEQ_4:84
for b1 being Nat
for b2 being non empty set
for b3, b4 being FinSequence of b2 st b1 in dom b4 holds
(b3 ^ b4) /. ((len b3) + b1) = b4 /. b1
proof end;

theorem Th85: :: FINSEQ_4:85
for b1 being Nat
for b2 being natural number
for b3 being set
for b4 being FinSequence of b3 st b2 in dom (b4 | b1) holds
(b4 | b1) /. b2 = b4 /. b2
proof end;

theorem Th86: :: FINSEQ_4:86
for b1 being set
for b2 being FinSequence of b1
for b3, b4 being Nat st b3 in dom b2 & b4 in Seg b3 holds
( b4 in dom b2 & (b2 | b3) /. b4 = b2 /. b4 )
proof end;