let X, Y be finite set ; ( not X is empty & not Y is empty implies ex F being XFinSequence of st
( dom F = card Y & ((card Y) |^ (card X)) - (Sum F) = card { f where f is Function of X,Y : f is onto } & ( for n being Nat st n in dom F holds
F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X)) ) ) )
assume that
A1:
not X is empty
and
A2:
not Y is empty
; ex F being XFinSequence of st
( dom F = card Y & ((card Y) |^ (card X)) - (Sum F) = card { f where f is Function of X,Y : f is onto } & ( for n being Nat st n in dom F holds
F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X)) ) )
defpred S1[ set , set ] means for n being Nat st n = $1 holds
$2 = (((card Y) - n) - 1) |^ (card X);
A3:
for x being set st x in card Y holds
ex y being set st
( y in NAT & S1[x,y] )
consider XF being Function of (card Y),NAT such that
A5:
for x being set st x in card Y holds
S1[x,XF . x]
from FUNCT_2:sch 1(A3);
set Onto = { f where f is Function of X,Y : f is onto } ;
deffunc H1( set ) -> set = { f where f is Function of X,Y : not $1 in rng f } ;
A6:
for x being set st x in Y holds
H1(x) in bool (Funcs X,Y)
consider Fy9 being Function of Y,(bool (Funcs X,Y)) such that
A8:
for x being set st x in Y holds
Fy9 . x = H1(x)
from FUNCT_2:sch 2(A6);
for y being set holds Fy9 . y is finite
then reconsider Fy = Fy9 as finite-yielding Function by Def3;
union (rng Fy9) c= union (bool (Funcs X,Y))
by ZFMISC_1:95;
then A9:
union (rng Fy) c= Funcs X,Y
by ZFMISC_1:99;
then reconsider u = union (rng Fy) as finite set ;
A10:
dom XF = card Y
by FUNCT_2:def 1;
then reconsider XF = XF as XFinSequence by AFINSQ_1:7;
reconsider XF = XF as XFinSequence of ;
A11:
for n being Nat st n in dom XF holds
ex x, y being set st
( x <> y & ( for f being Function st f in Choose Y,(n + 1),x,y holds
card (Intersection Fy,f,x) = XF . n ) )
proof
let n be
Nat;
( n in dom XF implies ex x, y being set st
( x <> y & ( for f being Function st f in Choose Y,(n + 1),x,y holds
card (Intersection Fy,f,x) = XF . n ) ) )
assume A12:
n in dom XF
;
ex x, y being set st
( x <> y & ( for f being Function st f in Choose Y,(n + 1),x,y holds
card (Intersection Fy,f,x) = XF . n ) )
take
0
;
ex y being set st
( 0 <> y & ( for f being Function st f in Choose Y,(n + 1),0 ,y holds
card (Intersection Fy,f,0 ) = XF . n ) )
take
1
;
( 0 <> 1 & ( for f being Function st f in Choose Y,(n + 1),0 ,1 holds
card (Intersection Fy,f,0 ) = XF . n ) )
thus
0 <> 1
;
for f being Function st f in Choose Y,(n + 1),0 ,1 holds
card (Intersection Fy,f,0 ) = XF . n
let f9 be
Function;
( f9 in Choose Y,(n + 1),0 ,1 implies card (Intersection Fy,f9,0 ) = XF . n )
assume
f9 in Choose Y,
(n + 1),
0 ,1
;
card (Intersection Fy,f9,0 ) = XF . n
then consider f being
Function of
Y,
{0 ,1} such that A13:
f = f9
and A14:
card (f " {0 }) = n + 1
by Def1;
A15:
Intersection Fy,
f,
0 c= Funcs X,
(Y \ (f " {0 }))
proof
let z be
set ;
TARSKI:def 3 ( not z in Intersection Fy,f,0 or z in Funcs X,(Y \ (f " {0 })) )
assume A16:
z in Intersection Fy,
f,
0
;
z in Funcs X,(Y \ (f " {0 }))
0 in rng f
by A14, CARD_1:47, FUNCT_1:142;
then consider x1 being
set such that A17:
x1 in dom f
and
f . x1 = 0
and A18:
z in Fy . x1
by A16, Th24;
z in H1(
x1)
by A8, A17, A18;
then consider g being
Function of
X,
Y such that A19:
z = g
and
not
x1 in rng g
;
A20:
rng g c= Y \ (f " {0 })
dom g = X
by A17, FUNCT_2:def 1;
hence
z in Funcs X,
(Y \ (f " {0 }))
by A19, A20, FUNCT_2:def 2;
verum
end;
then reconsider I =
Intersection Fy,
f,
0 as
finite set ;
A24:
card (Y \ (f " {0 })) = (card Y) - (n + 1)
by A14, CARD_2:63;
Funcs X,
(Y \ (f " {0 })) c= Intersection Fy,
f,
0
proof
let g9 be
set ;
TARSKI:def 3 ( not g9 in Funcs X,(Y \ (f " {0 })) or g9 in Intersection Fy,f,0 )
assume
g9 in Funcs X,
(Y \ (f " {0 }))
;
g9 in Intersection Fy,f,0
then consider g being
Function such that A25:
g9 = g
and A26:
dom g = X
and A27:
rng g c= Y \ (f " {0 })
by FUNCT_2:def 2;
reconsider gg =
g as
Function of
X,
Y by A26, A27, FUNCT_2:4, XBOOLE_1:1;
consider y being
set such that A28:
y in f " {0 }
by A14, CARD_1:47, XBOOLE_0:def 1;
not
y in rng g
by A27, A28, XBOOLE_0:def 5;
then A29:
gg in H1(
y)
;
dom Fy = Y
by FUNCT_2:def 1;
then A30:
Fy9 . y in rng Fy9
by A28, FUNCT_1:def 5;
A31:
for
z being
set st
z in dom f &
f . z = 0 holds
g in Fy . z
H1(
y)
= Fy9 . y
by A8, A28;
then
g in union (rng Fy)
by A30, A29, TARSKI:def 4;
hence
g9 in Intersection Fy,
f,
0
by A25, A31, Def2;
verum
end;
then A35:
Funcs X,
(Y \ (f " {0 })) = Intersection Fy,
f,
0
by A15, XBOOLE_0:def 10;
now per cases
( Y \ (f " {0 }) = {} or Y \ (f " {0 }) <> {} )
;
suppose
Y \ (f " {0 }) = {}
;
card (Intersection Fy,f9,0 ) = XF . nthen
(
card I = 0 &
(((card Y) - n) - 1) |^ (card X) = 0 )
by A1, A15, A24, CARD_1:47, NAT_1:14, NEWTON:16;
hence
card (Intersection Fy,f9,0 ) = XF . n
by A5, A10, A12, A13;
verum end; end; end;
hence
card (Intersection Fy,f9,0 ) = XF . n
;
verum
end;
( dom XF = card Y & dom Fy = Y )
by FUNCT_2:def 1;
then consider F being XFinSequence of such that
A37:
dom F = card Y
and
A38:
card (union (rng Fy)) = Sum F
and
A39:
for n being Nat st n in dom F holds
F . n = (((- 1) |^ n) * (XF . n)) * ((card Y) choose (n + 1))
by A11, Th69;
take
F
; ( dom F = card Y & ((card Y) |^ (card X)) - (Sum F) = card { f where f is Function of X,Y : f is onto } & ( for n being Nat st n in dom F holds
F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X)) ) )
thus
dom F = card Y
by A37; ( ((card Y) |^ (card X)) - (Sum F) = card { f where f is Function of X,Y : f is onto } & ( for n being Nat st n in dom F holds
F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X)) ) )
A40:
card ((Funcs X,Y) \ u) = (card (Funcs X,Y)) - (card u)
by A9, CARD_2:63;
A41:
{ f where f is Function of X,Y : f is onto } c= (Funcs X,Y) \ (union (rng Fy))
proof
let x be
set ;
TARSKI:def 3 ( not x in { f where f is Function of X,Y : f is onto } or x in (Funcs X,Y) \ (union (rng Fy)) )
assume
x in { f where f is Function of X,Y : f is onto }
;
x in (Funcs X,Y) \ (union (rng Fy))
then consider f being
Function of
X,
Y such that A42:
x = f
and A43:
f is
onto
;
assume A44:
not
x in (Funcs X,Y) \ (union (rng Fy))
;
contradiction
f in Funcs X,
Y
by A2, FUNCT_2:11;
then
f in union (rng Fy)
by A42, A44, XBOOLE_0:def 5;
then consider Fyy being
set such that A45:
f in Fyy
and A46:
Fyy in rng Fy
by TARSKI:def 4;
consider y being
set such that A47:
y in dom Fy
and A48:
Fy . y = Fyy
by A46, FUNCT_1:def 5;
y in Y
by A47, FUNCT_2:def 1;
then
f in H1(
y)
by A8, A45, A48;
then A49:
ex
g being
Function of
X,
Y st
(
f = g & not
y in rng g )
;
y in Y
by A47, FUNCT_2:def 1;
hence
contradiction
by A43, A49, FUNCT_2:def 3;
verum
end;
A50:
(Funcs X,Y) \ (union (rng Fy)) c= { f where f is Function of X,Y : f is onto }
proof
let x be
set ;
TARSKI:def 3 ( not x in (Funcs X,Y) \ (union (rng Fy)) or x in { f where f is Function of X,Y : f is onto } )
assume A51:
x in (Funcs X,Y) \ (union (rng Fy))
;
x in { f where f is Function of X,Y : f is onto }
consider f being
Function such that A52:
x = f
and A53:
(
dom f = X &
rng f c= Y )
by A51, FUNCT_2:def 2;
reconsider f =
f as
Function of
X,
Y by A53, FUNCT_2:4;
assume
not
x in { f where f is Function of X,Y : f is onto }
;
contradiction
then
not
f is
onto
by A52;
then
rng f <> Y
by FUNCT_2:def 3;
then
not
Y c= rng f
by XBOOLE_0:def 10;
then consider y being
set such that A54:
y in Y
and A55:
not
y in rng f
by TARSKI:def 3;
y in dom Fy9
by A54, FUNCT_2:def 1;
then
Fy9 . y in rng Fy9
by FUNCT_1:def 5;
then A56:
H1(
y)
in rng Fy9
by A8, A54;
f in H1(
y)
by A55;
then
f in union (rng Fy)
by A56, TARSKI:def 4;
hence
contradiction
by A51, A52, XBOOLE_0:def 5;
verum
end;
card (Funcs X,Y) = (card Y) |^ (card X)
by A2, Th4;
hence
card { f where f is Function of X,Y : f is onto } = ((card Y) |^ (card X)) - (Sum F)
by A38, A50, A41, A40, XBOOLE_0:def 10; for n being Nat st n in dom F holds
F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X))
let n be Nat; ( n in dom F implies F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X)) )
assume A57:
n in dom F
; F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X))
A58:
F . n = (((- 1) |^ n) * (XF . n)) * ((card Y) choose (n + 1))
by A39, A57;
XF . n = (((card Y) - n) - 1) |^ (card X)
by A5, A37, A57;
hence
F . n = (((- 1) |^ n) * ((card Y) choose (n + 1))) * ((((card Y) - n) - 1) |^ (card X))
by A58; verum