:: Pigeon Hole Principle
:: by Wojciech A. Trybulec
::
:: Received April 8, 1990
:: Copyright (c) 1990-2021 Association of Mizar Users


definition
let f be Function;
let x be object ;
pred f is_one-to-one_at x means :: FINSEQ_4:def 1
f " (Im (f,x)) = {x};
end;

:: deftheorem defines is_one-to-one_at FINSEQ_4:def 1 :
for f being Function
for x being object holds
( f is_one-to-one_at x iff f " (Im (f,x)) = {x} );

theorem Th1: :: FINSEQ_4:1
for f being Function
for x being object st f is_one-to-one_at x holds
x in dom f
proof end;

theorem Th2: :: FINSEQ_4:2
for f being Function
for x being object holds
( f is_one-to-one_at x iff ( x in dom f & f " {(f . x)} = {x} ) )
proof end;

theorem Th3: :: FINSEQ_4:3
for f being Function
for x being object holds
( f is_one-to-one_at x iff ( x in dom f & ( for z being object st z in dom f & x <> z holds
f . x <> f . z ) ) )
proof end;

theorem :: FINSEQ_4:4
for f being Function holds
( ( for x being object st x in dom f holds
f is_one-to-one_at x ) iff f is one-to-one )
proof end;

definition
let R be Relation;
let y be object ;
pred R just_once_values y means :Def2: :: FINSEQ_4:def 2
card (Coim (R,y)) = 1;
end;

:: deftheorem Def2 defines just_once_values FINSEQ_4:def 2 :
for R being Relation
for y being object holds
( R just_once_values y iff card (Coim (R,y)) = 1 );

theorem Th5: :: FINSEQ_4:5
for f being Function
for y being object st f just_once_values y holds
y in rng f
proof end;

theorem Th6: :: FINSEQ_4:6
for f being Function
for y being object holds
( f just_once_values y iff ex x being object st {x} = f " {y} ) by CARD_2:42;

theorem Th7: :: FINSEQ_4:7
for f being Function
for y being object holds
( f just_once_values y iff ex x being object st
( x in dom f & y = f . x & ( for z being object st z in dom f & z <> x holds
f . z <> y ) ) )
proof end;

theorem Th8: :: FINSEQ_4:8
for f being Function holds
( f is one-to-one iff for y being object st y in rng f holds
f just_once_values y )
proof end;

theorem Th9: :: FINSEQ_4:9
for f being Function
for x being object holds
( f is_one-to-one_at x iff ( x in dom f & f just_once_values f . x ) )
proof end;

definition
let f be Function;
let y be object ;
assume A1: f just_once_values y ;
func f <- y -> set means :Def3: :: FINSEQ_4:def 3
( it in dom f & f . it = y );
existence
ex b1 being set st
( b1 in dom f & f . b1 = y )
proof end;
uniqueness
for b1, b2 being set st b1 in dom f & f . b1 = y & b2 in dom f & f . b2 = y holds
b1 = b2
proof end;
end;

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

theorem :: FINSEQ_4:10
for f being Function
for y being object st f just_once_values y holds
Im (f,(f <- y)) = {y}
proof end;

theorem Th11: :: FINSEQ_4:11
for f being Function
for y being object st f just_once_values y holds
f " {y} = {(f <- y)}
proof end;

theorem :: FINSEQ_4:12
for f being Function
for y being object st f is one-to-one & y in rng f holds
(f ") . y = f <- y
proof end;

theorem :: FINSEQ_4:13
for f being Function
for x being object st f is_one-to-one_at x holds
f <- (f . x) = x
proof end;

theorem :: FINSEQ_4:14
for f being Function
for y being object st f just_once_values y holds
f is_one-to-one_at f <- y
proof end;

definition
let D be non empty set ;
let d1, d2 be Element of D;
:: original: <*
redefine func <*d1,d2*> -> FinSequence of D;
coherence
<*d1,d2*> is FinSequence of D
by FINSEQ_2:13;
end;

definition
let D be non empty set ;
let d1, d2, d3 be Element of D;
:: original: <*
redefine func <*d1,d2,d3*> -> FinSequence of D;
coherence
<*d1,d2,d3*> is FinSequence of D
by FINSEQ_2:14;
end;

theorem :: FINSEQ_4:15
for i being Nat
for D being set
for P being FinSequence of D st 1 <= i & i <= len P holds
P /. i = P . i
proof end;

theorem :: FINSEQ_4:16
for D being non empty set
for d being Element of D holds <*d*> /. 1 = d
proof end;

theorem :: FINSEQ_4:17
for D being non empty set
for d1, d2 being Element of D holds
( <*d1,d2*> /. 1 = d1 & <*d1,d2*> /. 2 = d2 )
proof end;

theorem :: FINSEQ_4:18
for D being non empty set
for d1, d2, d3 being Element of D holds
( <*d1,d2,d3*> /. 1 = d1 & <*d1,d2,d3*> /. 2 = d2 & <*d1,d2,d3*> /. 3 = d3 )
proof end;

definition
let p be FinSequence;
let x be object ;
func x .. p -> Element of NAT equals :: FINSEQ_4:def 4
(Sgm (p " {x})) . 1;
coherence
(Sgm (p " {x})) . 1 is Element of NAT
proof end;
end;

:: deftheorem defines .. FINSEQ_4:def 4 :
for p being FinSequence
for x being object holds x .. p = (Sgm (p " {x})) . 1;

theorem Th19: :: FINSEQ_4:19
for p being FinSequence
for x being object st x in rng p holds
p . (x .. p) = x
proof end;

theorem Th20: :: FINSEQ_4:20
for p being FinSequence
for x being object st x in rng p holds
x .. p in dom p
proof end;

theorem Th21: :: FINSEQ_4:21
for p being FinSequence
for x being object st x in rng p holds
( 1 <= x .. p & x .. p <= len p )
proof end;

theorem Th22: :: FINSEQ_4:22
for p being FinSequence
for x being object st x in rng p holds
( (x .. p) - 1 is Element of NAT & (len p) - (x .. p) is Element of NAT )
proof end;

theorem Th23: :: FINSEQ_4:23
for p being FinSequence
for x being object st x in rng p holds
x .. p in p " {x}
proof end;

theorem Th24: :: FINSEQ_4:24
for p being FinSequence
for x being object
for k being Nat st k in dom p & k < x .. p holds
p . k <> x
proof end;

theorem Th25: :: FINSEQ_4:25
for p being FinSequence
for x being object st p just_once_values x holds
p <- x = x .. p
proof end;

theorem Th26: :: FINSEQ_4:26
for p being FinSequence
for x being object st p just_once_values x holds
for k being Nat st k in dom p & k <> x .. p holds
p . k <> x
proof end;

theorem Th27: :: FINSEQ_4:27
for p being FinSequence
for x being object st x in rng p & ( for k being Nat st k in dom p & k <> x .. p holds
p . k <> x ) holds
p just_once_values x
proof end;

theorem :: FINSEQ_4:28
for p being FinSequence
for x being object holds
( p just_once_values x iff ( x in rng p & {(x .. p)} = p " {x} ) )
proof end;

theorem :: FINSEQ_4:29
for p being FinSequence
for x being object st p is one-to-one & x in rng p holds
{(x .. p)} = p " {x}
proof end;

theorem Th30: :: FINSEQ_4:30
for p being FinSequence
for x being object holds
( p just_once_values x iff len (p - {x}) = (len p) - 1 )
proof end;

theorem Th31: :: FINSEQ_4:31
for p being FinSequence
for x being object st p just_once_values x holds
for k being Nat st k in dom (p - {x}) holds
( ( k < x .. p implies (p - {x}) . k = p . k ) & ( x .. p <= k implies (p - {x}) . k = p . (k + 1) ) )
proof end;

theorem :: FINSEQ_4:32
for p being FinSequence
for x being object st p is one-to-one & x in rng p holds
for k being Nat st k in dom (p - {x}) holds
( ( (p - {x}) . k = p . k implies k < x .. p ) & ( k < x .. p implies (p - {x}) . k = p . k ) & ( (p - {x}) . k = p . (k + 1) implies x .. p <= k ) & ( x .. p <= k implies (p - {x}) . k = p . (k + 1) ) )
proof end;

definition
let p be FinSequence;
let x be object ;
assume A1: x in rng p ;
func p -| x -> FinSequence means :Def5: :: FINSEQ_4:def 5
ex n being Nat st
( n = (x .. p) - 1 & it = p | (Seg n) );
existence
ex b1 being FinSequence ex n being Nat st
( n = (x .. p) - 1 & b1 = p | (Seg n) )
proof end;
uniqueness
for b1, b2 being FinSequence st ex n being Nat st
( n = (x .. p) - 1 & b1 = p | (Seg n) ) & ex n being Nat st
( n = (x .. p) - 1 & b2 = p | (Seg n) ) holds
b1 = b2
;
end;

:: deftheorem Def5 defines -| FINSEQ_4:def 5 :
for p being FinSequence
for x being object st x in rng p holds
for b3 being FinSequence holds
( b3 = p -| x iff ex n being Nat st
( n = (x .. p) - 1 & b3 = p | (Seg n) ) );

theorem Th33: :: FINSEQ_4:33
for p being FinSequence
for x being object
for n being Nat st x in rng p & n = (x .. p) - 1 holds
p | (Seg n) = p -| x
proof end;

theorem Th34: :: FINSEQ_4:34
for p being FinSequence
for x being object st x in rng p holds
len (p -| x) = (x .. p) - 1
proof end;

theorem Th35: :: FINSEQ_4:35
for p being FinSequence
for x being object
for n being Nat st x in rng p & n = (x .. p) - 1 holds
dom (p -| x) = Seg n
proof end;

theorem Th36: :: FINSEQ_4:36
for p being FinSequence
for x being object
for k being Nat st x in rng p & k in dom (p -| x) holds
p . k = (p -| x) . k
proof end;

theorem Th37: :: FINSEQ_4:37
for p being FinSequence
for x being object st x in rng p holds
not x in rng (p -| x)
proof end;

theorem :: FINSEQ_4:38
for p being FinSequence
for x being object st x in rng p holds
rng (p -| x) misses {x}
proof end;

theorem :: FINSEQ_4:39
for p being FinSequence
for x being object st x in rng p holds
rng (p -| x) c= rng p
proof end;

theorem :: FINSEQ_4:40
for p being FinSequence
for x being object st x in rng p holds
( x .. p = 1 iff p -| x = {} )
proof end;

theorem :: FINSEQ_4:41
for p being FinSequence
for x being object
for D being non empty set st x in rng p & p is FinSequence of D holds
p -| x is FinSequence of D
proof end;

definition
let p be FinSequence;
let x be object ;
assume A1: x in rng p ;
func p |-- x -> FinSequence means :Def6: :: FINSEQ_4:def 6
( len it = (len p) - (x .. p) & ( for k being Nat st k in dom it holds
it . k = p . (k + (x .. p)) ) );
existence
ex b1 being FinSequence st
( len b1 = (len p) - (x .. p) & ( for k being Nat st k in dom b1 holds
b1 . k = p . (k + (x .. p)) ) )
proof end;
uniqueness
for b1, b2 being FinSequence st len b1 = (len p) - (x .. p) & ( for k being Nat st k in dom b1 holds
b1 . k = p . (k + (x .. p)) ) & len b2 = (len p) - (x .. p) & ( for k being Nat st k in dom b2 holds
b2 . k = p . (k + (x .. p)) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines |-- FINSEQ_4:def 6 :
for p being FinSequence
for x being object st x in rng p holds
for b3 being FinSequence holds
( b3 = p |-- x iff ( len b3 = (len p) - (x .. p) & ( for k being Nat st k in dom b3 holds
b3 . k = p . (k + (x .. p)) ) ) );

theorem Th42: :: FINSEQ_4:42
for p being FinSequence
for x being object
for n being Nat st x in rng p & n = (len p) - (x .. p) holds
dom (p |-- x) = Seg n
proof end;

theorem Th43: :: FINSEQ_4:43
for p being FinSequence
for x being object
for n being Nat st x in rng p & n in dom (p |-- x) holds
n + (x .. p) in dom p
proof end;

theorem :: FINSEQ_4:44
for p being FinSequence
for x being object st x in rng p holds
rng (p |-- x) c= rng p
proof end;

theorem Th45: :: FINSEQ_4:45
for p being FinSequence
for x being object holds
( p just_once_values x iff ( x in rng p & not x in rng (p |-- x) ) )
proof end;

theorem Th46: :: FINSEQ_4:46
for p being FinSequence
for x being object st x in rng p & p is one-to-one holds
not x in rng (p |-- x)
proof end;

theorem :: FINSEQ_4:47
for p being FinSequence
for x being object holds
( p just_once_values x iff ( x in rng p & rng (p |-- x) misses {x} ) )
proof end;

theorem :: FINSEQ_4:48
for p being FinSequence
for x being object st x in rng p & p is one-to-one holds
rng (p |-- x) misses {x}
proof end;

theorem :: FINSEQ_4:49
for p being FinSequence
for x being object st x in rng p holds
( x .. p = len p iff p |-- x = {} )
proof end;

theorem :: FINSEQ_4:50
for p being FinSequence
for x being object
for D being non empty set st x in rng p & p is FinSequence of D holds
p |-- x is FinSequence of D
proof end;

theorem Th51: :: FINSEQ_4:51
for p being FinSequence
for x being object st x in rng p holds
p = ((p -| x) ^ <*x*>) ^ (p |-- x)
proof end;

theorem :: FINSEQ_4:52
for p being FinSequence
for x being object st x in rng p & p is one-to-one holds
p -| x is one-to-one
proof end;

theorem :: FINSEQ_4:53
for p being FinSequence
for x being object st x in rng p & p is one-to-one holds
p |-- x is one-to-one
proof end;

theorem Th54: :: FINSEQ_4:54
for p being FinSequence
for x being object holds
( p just_once_values x iff ( x in rng p & p - {x} = (p -| x) ^ (p |-- x) ) )
proof end;

theorem :: FINSEQ_4:55
for p being FinSequence
for x being object st x in rng p & p is one-to-one holds
p - {x} = (p -| x) ^ (p |-- x)
proof end;

theorem Th56: :: FINSEQ_4:56
for p being FinSequence
for x being object st x in rng p & p - {x} is one-to-one & p - {x} = (p -| x) ^ (p |-- x) holds
p is one-to-one
proof end;

theorem :: FINSEQ_4:57
for p being FinSequence
for x being object st x in rng p & p is one-to-one holds
rng (p -| x) misses rng (p |-- x)
proof end;

theorem Th58: :: FINSEQ_4:58
for A being set st A is finite holds
ex p being FinSequence st
( rng p = A & p is one-to-one )
proof end;

theorem Th59: :: FINSEQ_4:59
for p being FinSequence st rng p c= dom p & p is one-to-one holds
rng p = dom p
proof end;

theorem Th60: :: FINSEQ_4:60
for p being FinSequence st rng p = dom p holds
p is one-to-one
proof end;

theorem :: FINSEQ_4:61
for p, q being FinSequence st rng p = rng q & len p = len q & q is one-to-one holds
p is one-to-one
proof end;

Lm1: for A, B being finite set
for f being Function of A,B st card A = card B & f is onto holds
f is one-to-one

proof end;

theorem Th62: :: FINSEQ_4:62
for p being FinSequence holds
( p is one-to-one iff card (rng p) = len p )
proof end;

Lemacik: for A, B being finite set
for f being Function of A,B st card A = card B & f is one-to-one holds
f is onto

proof end;

theorem :: FINSEQ_4:63
for A, B being finite set
for f being Function of A,B st card A = card B holds
( f is one-to-one iff f is onto ) by Lemacik, Lm1;

theorem :: FINSEQ_4:64
canceled;

::$CT
:: WP: Dirichlet Principle
:: WP: Pigeon Hole Principle
theorem :: FINSEQ_4:65
for A, B being set
for f being Function of A,B st card B in card A & B <> {} holds
ex x, y being object st
( x in A & y in A & x <> y & f . x = f . y )
proof end;

theorem Th66: :: FINSEQ_4:66
for A, B being set
for f being Function of A,B st card A in card B holds
ex x being object st
( x in B & ( for y being object st y in A holds
f . y <> x ) )
proof end;

:: from TOPREAL4
theorem :: FINSEQ_4:67
for D being non empty set
for f being FinSequence of D
for p being Element of D holds (f ^ <*p*>) /. ((len f) + 1) = p
proof end;

:: from GROUP_5
theorem :: FINSEQ_4:68
for k being Nat
for E being non empty set
for p, q being FinSequence of E st k in dom p holds
(p ^ q) /. k = p /. k
proof end;

theorem :: FINSEQ_4:69
for k being Nat
for E being non empty set
for p, q being FinSequence of E st k in dom q holds
(p ^ q) /. ((len p) + k) = q /. k
proof end;

:: from TOPREAL1
theorem :: FINSEQ_4:70
for a, m being Nat
for D being set
for p being FinSequence of D st a in dom (p | m) holds
(p | m) /. a = p /. a
proof end;

:: from GOBOARD1
theorem Th71: :: FINSEQ_4:71
for D being set
for f being FinSequence of D
for n, m being Nat st n in dom f & m in Seg n holds
( m in dom f & (f | n) /. m = f /. m )
proof end;

:: from VECTSP_9, 2006.01.06, A.T.
theorem :: FINSEQ_4:72
for n being Nat
for X being finite set st n <= card X holds
ex A being finite Subset of X st card A = n
proof end;

theorem :: FINSEQ_4:73
for x being object
for f being Function st f is one-to-one & x in rng f holds
card (Coim (f,x)) = 1 by Th8, Def2;

:: form SCMPDS_1, 2006.03.24, A.T.
definition
let x1, x2, x3, x4 be object ;
func <*x1,x2,x3,x4*> -> set equals :: FINSEQ_4:def 7
<*x1,x2,x3*> ^ <*x4*>;
correctness
coherence
<*x1,x2,x3*> ^ <*x4*> is set
;
;
let x5 be object ;
func <*x1,x2,x3,x4,x5*> -> set equals :: FINSEQ_4:def 8
<*x1,x2,x3*> ^ <*x4,x5*>;
correctness
coherence
<*x1,x2,x3*> ^ <*x4,x5*> is set
;
;
end;

:: deftheorem defines <* FINSEQ_4:def 7 :
for x1, x2, x3, x4 being object holds <*x1,x2,x3,x4*> = <*x1,x2,x3*> ^ <*x4*>;

:: deftheorem defines <* FINSEQ_4:def 8 :
for x1, x2, x3, x4, x5 being object holds <*x1,x2,x3,x4,x5*> = <*x1,x2,x3*> ^ <*x4,x5*>;

registration
let x1, x2, x3, x4 be object ;
cluster <*x1,x2,x3,x4*> -> Relation-like Function-like non empty ;
coherence
( not <*x1,x2,x3,x4*> is empty & <*x1,x2,x3,x4*> is Function-like & <*x1,x2,x3,x4*> is Relation-like )
;
let x5 be object ;
cluster <*x1,x2,x3,x4,x5*> -> Relation-like Function-like non empty ;
coherence
( not <*x1,x2,x3,x4,x5*> is empty & <*x1,x2,x3,x4,x5*> is Function-like & <*x1,x2,x3,x4,x5*> is Relation-like )
;
end;

registration
let x1, x2, x3, x4 be object ;
cluster <*x1,x2,x3,x4*> -> FinSequence-like ;
coherence
<*x1,x2,x3,x4*> is FinSequence-like
;
let x5 be object ;
cluster <*x1,x2,x3,x4,x5*> -> FinSequence-like ;
coherence
<*x1,x2,x3,x4,x5*> is FinSequence-like
;
end;

definition
let D be non empty set ;
let x1, x2, x3, x4 be Element of D;
:: original: <*
redefine func <*x1,x2,x3,x4*> -> FinSequence of D;
coherence
<*x1,x2,x3,x4*> is FinSequence of D
proof end;
end;

definition
let D be non empty set ;
let x1, x2, x3, x4, x5 be Element of D;
:: original: <*
redefine func <*x1,x2,x3,x4,x5*> -> FinSequence of D;
coherence
<*x1,x2,x3,x4,x5*> is FinSequence of D
proof end;
end;

theorem Th74: :: FINSEQ_4:74
for x1, x2, x3, x4 being object holds
( <*x1,x2,x3,x4*> = <*x1,x2,x3*> ^ <*x4*> & <*x1,x2,x3,x4*> = <*x1,x2*> ^ <*x3,x4*> & <*x1,x2,x3,x4*> = <*x1*> ^ <*x2,x3,x4*> & <*x1,x2,x3,x4*> = ((<*x1*> ^ <*x2*>) ^ <*x3*>) ^ <*x4*> )
proof end;

theorem Th75: :: FINSEQ_4:75
for x1, x2, x3, x4, x5 being object holds
( <*x1,x2,x3,x4,x5*> = <*x1,x2,x3*> ^ <*x4,x5*> & <*x1,x2,x3,x4,x5*> = <*x1,x2,x3,x4*> ^ <*x5*> & <*x1,x2,x3,x4,x5*> = (((<*x1*> ^ <*x2*>) ^ <*x3*>) ^ <*x4*>) ^ <*x5*> & <*x1,x2,x3,x4,x5*> = <*x1,x2*> ^ <*x3,x4,x5*> & <*x1,x2,x3,x4,x5*> = <*x1*> ^ <*x2,x3,x4,x5*> )
proof end;

theorem Th76: :: FINSEQ_4:76
for x1, x2, x3, x4 being object
for p being FinSequence holds
( p = <*x1,x2,x3,x4*> iff ( len p = 4 & p . 1 = x1 & p . 2 = x2 & p . 3 = x3 & p . 4 = x4 ) )
proof end;

theorem :: FINSEQ_4:77
canceled;

::$CT
theorem Th77: :: FINSEQ_4:78
for x1, x2, x3, x4, x5 being object
for p being FinSequence holds
( p = <*x1,x2,x3,x4,x5*> iff ( len p = 5 & p . 1 = x1 & p . 2 = x2 & p . 3 = x3 & p . 4 = x4 & p . 5 = x5 ) )
proof end;

theorem :: FINSEQ_4:79
canceled;

::$CT
theorem :: FINSEQ_4:80
for ND being non empty set
for y1, y2, y3, y4 being Element of ND holds
( <*y1,y2,y3,y4*> /. 1 = y1 & <*y1,y2,y3,y4*> /. 2 = y2 & <*y1,y2,y3,y4*> /. 3 = y3 & <*y1,y2,y3,y4*> /. 4 = y4 )
proof end;

theorem :: FINSEQ_4:81
for ND being non empty set
for y1, y2, y3, y4, y5 being Element of ND holds
( <*y1,y2,y3,y4,y5*> /. 1 = y1 & <*y1,y2,y3,y4,y5*> /. 2 = y2 & <*y1,y2,y3,y4,y5*> /. 3 = y3 & <*y1,y2,y3,y4,y5*> /. 4 = y4 & <*y1,y2,y3,y4,y5*> /. 5 = y5 )
proof end;

:: form GOBOARD1, 2007.07.22, A.T.
scheme :: FINSEQ_4:sch 1
Sch1{ F1() -> non empty set , F2() -> Nat, P1[ object , object ] } :
ex f being FinSequence of F1() st
( len f = F2() & ( for n being Nat st n in Seg F2() holds
P1[n,f /. n] ) )
provided
A1: for n being Nat st n in Seg F2() holds
ex d being Element of F1() st P1[n,d]
proof end;

:: form SCMFSA_7, 2007.07.22, A.T.
theorem Th80: :: FINSEQ_4:82
for D being non empty set
for p, q being FinSequence of D st p c= q holds
ex p9 being FinSequence of D st p ^ p9 = q
proof end;

theorem :: FINSEQ_4:83
for D being non empty set
for p, q being FinSequence of D
for i being Element of NAT st p c= q & 1 <= i & i <= len p holds
q . i = p . i
proof end;

:: form GOBOARD2, 2008.03.08, A.T.
scheme :: FINSEQ_4:sch 2
PiLambdaD{ F1() -> non empty set , F2() -> Nat, F3( set ) -> Element of F1() } :
ex g being FinSequence of F1() st
( len g = F2() & ( for n being Nat st n in dom g holds
g /. n = F3(n) ) )
proof end;

:: from CIRCCMB3, 2009.02.16, A.T.
registration
let x1, x2, x3, x4 be object ;
cluster <*x1,x2,x3,x4*> -> 4 -element ;
coherence
<*x1,x2,x3,x4*> is 4 -element
;
let x5 be object ;
cluster <*x1,x2,x3,x4,x5*> -> 5 -element ;
coherence
<*x1,x2,x3,x4,x5*> is 5 -element
;
end;

theorem :: FINSEQ_4:84
for m, n being Nat st m < n holds
ex p being Element of NAT st
( n = m + p & 1 <= p )
proof end;

theorem :: FINSEQ_4:85
for S being set
for D1, D2 being non empty set
for f1 being Function of S,D1
for f2 being Function of D1,D2 st f1 is bijective & f2 is bijective holds
f2 * f1 is bijective
proof end;

:: Partitions & Equivalence Relations
theorem :: FINSEQ_4:86
for Y being set
for E1, E2 being Equivalence_Relation of Y st Class E1 = Class E2 holds
E1 = E2
proof end;

registration
let Z be finite set ;
cluster -> finite for a_partition of Z;
coherence
for b1 being a_partition of Z holds b1 is finite
;
end;

registration
let X be non empty finite set ;
cluster V16() non empty finite V45() with_non-empty_elements for a_partition of X;
existence
ex b1 being a_partition of X st
( not b1 is empty & b1 is finite )
proof end;
end;

theorem Th85: :: FINSEQ_4:87
for X being non empty set
for PX being a_partition of X
for Pi being set st Pi in PX holds
ex x being Element of X st x in Pi
proof end;

theorem :: FINSEQ_4:88
for X being non empty finite set
for PX being a_partition of X holds card PX <= card X
proof end;

theorem :: FINSEQ_4:89
for A being non empty finite set
for PA1, PA2 being a_partition of A st PA1 is_finer_than PA2 holds
card PA2 <= card PA1
proof end;

theorem Th88: :: FINSEQ_4:90
for A being non empty finite set
for PA1, PA2 being a_partition of A st PA1 is_finer_than PA2 holds
for p2 being Element of PA2 ex p1 being Element of PA1 st p1 c= p2
proof end;

theorem :: FINSEQ_4:91
for A being non empty finite set
for PA1, PA2 being a_partition of A st PA1 is_finer_than PA2 & card PA1 = card PA2 holds
PA1 = PA2
proof end;

registration
let D be set ;
let M be FinSequence of D * ;
let k be Nat;
cluster M /. k -> Relation-like Function-like ;
coherence
( M /. k is Function-like & M /. k is Relation-like )
;
end;

registration
let D be set ;
let M be FinSequence of D * ;
let k be Nat;
cluster M /. k -> D -valued FinSequence-like for Function;
coherence
for b1 being Function st b1 = M /. k holds
( b1 is FinSequence-like & b1 is D -valued )
by FINSEQ_1:def 11;
end;

theorem :: FINSEQ_4:92
for m being Nat
for D being non empty set
for f being FinSequence of D st m in dom f holds
f /. 1 = (f | m) /. 1
proof end;

theorem :: FINSEQ_4:93
for m being Nat
for D being non empty set
for f being FinSequence of D st m in dom f holds
f /. m = (f | m) /. (len (f | m))
proof end;