Metamath Proof Explorer


Theorem birthdaylem3

Description: For general N and K , upper-bound the fraction of injective functions from 1 ... K to 1 ... N . (Contributed by Mario Carneiro, 17-Apr-2015)

Ref Expression
Hypotheses birthday.s S = f | f : 1 K 1 N
birthday.t T = f | f : 1 K 1-1 1 N
Assertion birthdaylem3 K 0 N T S e K 2 K 2 N

Proof

Step Hyp Ref Expression
1 birthday.s S = f | f : 1 K 1 N
2 birthday.t T = f | f : 1 K 1-1 1 N
3 abn0 f | f : 1 K 1-1 1 N f f : 1 K 1-1 1 N
4 ovex 1 N V
5 4 brdom 1 K 1 N f f : 1 K 1-1 1 N
6 3 5 bitr4i f | f : 1 K 1-1 1 N 1 K 1 N
7 hashfz1 K 0 1 K = K
8 nnnn0 N N 0
9 hashfz1 N 0 1 N = N
10 8 9 syl N 1 N = N
11 7 10 breqan12d K 0 N 1 K 1 N K N
12 fzfid K 0 N 1 K Fin
13 fzfid K 0 N 1 N Fin
14 hashdom 1 K Fin 1 N Fin 1 K 1 N 1 K 1 N
15 12 13 14 syl2anc K 0 N 1 K 1 N 1 K 1 N
16 nn0re K 0 K
17 nnre N N
18 lenlt K N K N ¬ N < K
19 16 17 18 syl2an K 0 N K N ¬ N < K
20 11 15 19 3bitr3d K 0 N 1 K 1 N ¬ N < K
21 6 20 syl5bb K 0 N f | f : 1 K 1-1 1 N ¬ N < K
22 21 necon4abid K 0 N f | f : 1 K 1-1 1 N = N < K
23 22 biimpar K 0 N N < K f | f : 1 K 1-1 1 N =
24 2 23 eqtrid K 0 N N < K T =
25 24 fveq2d K 0 N N < K T =
26 hash0 = 0
27 25 26 eqtrdi K 0 N N < K T = 0
28 27 oveq1d K 0 N N < K T S = 0 S
29 1 2 birthdaylem1 T S S Fin N S
30 29 simp3i N S
31 30 ad2antlr K 0 N N < K S
32 29 simp2i S Fin
33 hashnncl S Fin S S
34 32 33 ax-mp S S
35 31 34 sylibr K 0 N N < K S
36 35 nncnd K 0 N N < K S
37 35 nnne0d K 0 N N < K S 0
38 36 37 div0d K 0 N N < K 0 S = 0
39 28 38 eqtrd K 0 N N < K T S = 0
40 16 adantr K 0 N K
41 40 resqcld K 0 N K 2
42 41 40 resubcld K 0 N K 2 K
43 42 rehalfcld K 0 N K 2 K 2
44 nndivre K 2 K 2 N K 2 K 2 N
45 43 44 sylancom K 0 N K 2 K 2 N
46 45 renegcld K 0 N K 2 K 2 N
47 46 adantr K 0 N N < K K 2 K 2 N
48 47 rpefcld K 0 N N < K e K 2 K 2 N +
49 48 rpge0d K 0 N N < K 0 e K 2 K 2 N
50 39 49 eqbrtrd K 0 N N < K T S e K 2 K 2 N
51 simplr K 0 N K N N
52 simpr K 0 N K N K N
53 simpll K 0 N K N K 0
54 nn0uz 0 = 0
55 53 54 eleqtrdi K 0 N K N K 0
56 nnz N N
57 56 ad2antlr K 0 N K N N
58 elfz5 K 0 N K 0 N K N
59 55 57 58 syl2anc K 0 N K N K 0 N K N
60 52 59 mpbird K 0 N K N K 0 N
61 1 2 birthdaylem2 N K 0 N T S = e k = 0 K 1 log 1 k N
62 51 60 61 syl2anc K 0 N K N T S = e k = 0 K 1 log 1 k N
63 fzfid K 0 N K N 0 K 1 Fin
64 elfznn0 k 0 K 1 k 0
65 64 adantl K 0 N K N k 0 K 1 k 0
66 65 nn0red K 0 N K N k 0 K 1 k
67 53 nn0red K 0 N K N K
68 peano2rem K K 1
69 67 68 syl K 0 N K N K 1
70 69 adantr K 0 N K N k 0 K 1 K 1
71 51 adantr K 0 N K N k 0 K 1 N
72 71 nnred K 0 N K N k 0 K 1 N
73 elfzle2 k 0 K 1 k K 1
74 73 adantl K 0 N K N k 0 K 1 k K 1
75 51 nnred K 0 N K N N
76 67 ltm1d K 0 N K N K 1 < K
77 69 67 75 76 52 ltletrd K 0 N K N K 1 < N
78 77 adantr K 0 N K N k 0 K 1 K 1 < N
79 66 70 72 74 78 lelttrd K 0 N K N k 0 K 1 k < N
80 71 nncnd K 0 N K N k 0 K 1 N
81 80 mulid1d K 0 N K N k 0 K 1 N 1 = N
82 79 81 breqtrrd K 0 N K N k 0 K 1 k < N 1
83 1red K 0 N K N k 0 K 1 1
84 71 nngt0d K 0 N K N k 0 K 1 0 < N
85 ltdivmul k 1 N 0 < N k N < 1 k < N 1
86 66 83 72 84 85 syl112anc K 0 N K N k 0 K 1 k N < 1 k < N 1
87 82 86 mpbird K 0 N K N k 0 K 1 k N < 1
88 66 71 nndivred K 0 N K N k 0 K 1 k N
89 1re 1
90 difrp k N 1 k N < 1 1 k N +
91 88 89 90 sylancl K 0 N K N k 0 K 1 k N < 1 1 k N +
92 87 91 mpbid K 0 N K N k 0 K 1 1 k N +
93 92 relogcld K 0 N K N k 0 K 1 log 1 k N
94 88 renegcld K 0 N K N k 0 K 1 k N
95 elfzle1 k 0 K 1 0 k
96 95 adantl K 0 N K N k 0 K 1 0 k
97 divge0 k 0 k N 0 < N 0 k N
98 66 96 72 84 97 syl22anc K 0 N K N k 0 K 1 0 k N
99 88 98 87 eflegeo K 0 N K N k 0 K 1 e k N 1 1 k N
100 88 reefcld K 0 N K N k 0 K 1 e k N
101 efgt0 k N 0 < e k N
102 88 101 syl K 0 N K N k 0 K 1 0 < e k N
103 92 rpregt0d K 0 N K N k 0 K 1 1 k N 0 < 1 k N
104 lerec2 e k N 0 < e k N 1 k N 0 < 1 k N e k N 1 1 k N 1 k N 1 e k N
105 100 102 103 104 syl21anc K 0 N K N k 0 K 1 e k N 1 1 k N 1 k N 1 e k N
106 99 105 mpbid K 0 N K N k 0 K 1 1 k N 1 e k N
107 92 reeflogd K 0 N K N k 0 K 1 e log 1 k N = 1 k N
108 88 recnd K 0 N K N k 0 K 1 k N
109 efneg k N e k N = 1 e k N
110 108 109 syl K 0 N K N k 0 K 1 e k N = 1 e k N
111 106 107 110 3brtr4d K 0 N K N k 0 K 1 e log 1 k N e k N
112 efle log 1 k N k N log 1 k N k N e log 1 k N e k N
113 93 94 112 syl2anc K 0 N K N k 0 K 1 log 1 k N k N e log 1 k N e k N
114 111 113 mpbird K 0 N K N k 0 K 1 log 1 k N k N
115 63 93 94 114 fsumle K 0 N K N k = 0 K 1 log 1 k N k = 0 K 1 k N
116 63 108 fsumneg K 0 N K N k = 0 K 1 k N = k = 0 K 1 k N
117 51 nncnd K 0 N K N N
118 66 recnd K 0 N K N k 0 K 1 k
119 nnne0 N N 0
120 119 ad2antlr K 0 N K N N 0
121 63 117 118 120 fsumdivc K 0 N K N k = 0 K 1 k N = k = 0 K 1 k N
122 arisum2 K 0 k = 0 K 1 k = K 2 K 2
123 53 122 syl K 0 N K N k = 0 K 1 k = K 2 K 2
124 123 oveq1d K 0 N K N k = 0 K 1 k N = K 2 K 2 N
125 121 124 eqtr3d K 0 N K N k = 0 K 1 k N = K 2 K 2 N
126 125 negeqd K 0 N K N k = 0 K 1 k N = K 2 K 2 N
127 116 126 eqtrd K 0 N K N k = 0 K 1 k N = K 2 K 2 N
128 115 127 breqtrd K 0 N K N k = 0 K 1 log 1 k N K 2 K 2 N
129 63 93 fsumrecl K 0 N K N k = 0 K 1 log 1 k N
130 46 adantr K 0 N K N K 2 K 2 N
131 efle k = 0 K 1 log 1 k N K 2 K 2 N k = 0 K 1 log 1 k N K 2 K 2 N e k = 0 K 1 log 1 k N e K 2 K 2 N
132 129 130 131 syl2anc K 0 N K N k = 0 K 1 log 1 k N K 2 K 2 N e k = 0 K 1 log 1 k N e K 2 K 2 N
133 128 132 mpbid K 0 N K N e k = 0 K 1 log 1 k N e K 2 K 2 N
134 62 133 eqbrtrd K 0 N K N T S e K 2 K 2 N
135 17 adantl K 0 N N
136 50 134 135 40 ltlecasei K 0 N T S e K 2 K 2 N