Metamath Proof Explorer


Theorem birthday

Description: The Birthday Problem. There is a more than even chance that out of 23 people in a room, at least two of them have the same birthday. Mathematically, this is asserting that for K = 2 3 and N = 3 6 5 , fewer than half of the set of all functions from 1 ... K to 1 ... N are injective. This is Metamath 100 proof #93. (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
birthday.k K = 23
birthday.n N = 365
Assertion birthday T S < 1 2

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 birthday.k K = 23
4 birthday.n N = 365
5 2nn0 2 0
6 3nn0 3 0
7 5 6 deccl 23 0
8 3 7 eqeltri K 0
9 6nn0 6 0
10 6 9 deccl 36 0
11 5nn 5
12 10 11 decnncl 365
13 4 12 eqeltri N
14 1 2 birthdaylem3 K 0 N T S e K 2 K 2 N
15 8 13 14 mp2an T S e K 2 K 2 N
16 log2ub log 2 < 253 365
17 8 nn0cni K
18 17 sqvali K 2 = K K
19 17 mulid1i K 1 = K
20 19 eqcomi K = K 1
21 18 20 oveq12i K 2 K = K K K 1
22 ax-1cn 1
23 17 17 22 subdii K K 1 = K K K 1
24 21 23 eqtr4i K 2 K = K K 1
25 24 oveq1i K 2 K 2 = K K 1 2
26 17 22 subcli K 1
27 2cn 2
28 2ne0 2 0
29 17 26 27 28 divassi K K 1 2 = K K 1 2
30 1nn0 1 0
31 5 5 deccl 22 0
32 31 nn0cni 22
33 2p1e3 2 + 1 = 3
34 eqid 22 = 22
35 5 5 33 34 decsuc 22 + 1 = 23
36 3 35 eqtr4i K = 22 + 1
37 32 22 36 mvrraddi K 1 = 22
38 37 oveq1i K 1 2 = 22 2
39 5 11multnc 2 11 = 22
40 30 30 deccl 11 0
41 40 nn0cni 11
42 32 27 41 28 divmuli 22 2 = 11 2 11 = 22
43 39 42 mpbir 22 2 = 11
44 38 43 eqtri K 1 2 = 11
45 19 3 eqtri K 1 = 23
46 3p2e5 3 + 2 = 5
47 5 6 5 45 46 decaddi K 1 + 2 = 25
48 8 30 30 44 6 5 47 45 decmul2c K K 1 2 = 253
49 25 29 48 3eqtri K 2 K 2 = 253
50 49 4 oveq12i K 2 K 2 N = 253 365
51 16 50 breqtrri log 2 < K 2 K 2 N
52 2rp 2 +
53 relogcl 2 + log 2
54 52 53 ax-mp log 2
55 5nn0 5 0
56 5 55 deccl 25 0
57 56 6 deccl 253 0
58 49 57 eqeltri K 2 K 2 0
59 58 nn0rei K 2 K 2
60 nndivre K 2 K 2 N K 2 K 2 N
61 59 13 60 mp2an K 2 K 2 N
62 54 61 ltnegi log 2 < K 2 K 2 N K 2 K 2 N < log 2
63 51 62 mpbi K 2 K 2 N < log 2
64 61 renegcli K 2 K 2 N
65 54 renegcli log 2
66 eflt K 2 K 2 N log 2 K 2 K 2 N < log 2 e K 2 K 2 N < e log 2
67 64 65 66 mp2an K 2 K 2 N < log 2 e K 2 K 2 N < e log 2
68 63 67 mpbi e K 2 K 2 N < e log 2
69 54 recni log 2
70 efneg log 2 e log 2 = 1 e log 2
71 69 70 ax-mp e log 2 = 1 e log 2
72 reeflog 2 + e log 2 = 2
73 52 72 ax-mp e log 2 = 2
74 73 oveq2i 1 e log 2 = 1 2
75 71 74 eqtri e log 2 = 1 2
76 68 75 breqtri e K 2 K 2 N < 1 2
77 1 2 birthdaylem1 T S S Fin N S
78 77 simp2i S Fin
79 77 simp1i T S
80 ssfi S Fin T S T Fin
81 78 79 80 mp2an T Fin
82 hashcl T Fin T 0
83 81 82 ax-mp T 0
84 83 nn0rei T
85 77 simp3i N S
86 13 85 ax-mp S
87 hashnncl S Fin S S
88 78 87 ax-mp S S
89 86 88 mpbir S
90 nndivre T S T S
91 84 89 90 mp2an T S
92 reefcl K 2 K 2 N e K 2 K 2 N
93 64 92 ax-mp e K 2 K 2 N
94 halfre 1 2
95 91 93 94 lelttri T S e K 2 K 2 N e K 2 K 2 N < 1 2 T S < 1 2
96 15 76 95 mp2an T S < 1 2