Metamath Proof Explorer


Theorem ballotlem2

Description: The probability that the first vote picked in a count is a B. (Contributed by Thierry Arnoux, 23-Nov-2016)

Ref Expression
Hypotheses ballotth.m M
ballotth.n N
ballotth.o O = c 𝒫 1 M + N | c = M
ballotth.p P = x 𝒫 O x O
Assertion ballotlem2 P c O | ¬ 1 c = N M + N

Proof

Step Hyp Ref Expression
1 ballotth.m M
2 ballotth.n N
3 ballotth.o O = c 𝒫 1 M + N | c = M
4 ballotth.p P = x 𝒫 O x O
5 1 2 3 ballotlemoex O V
6 ssrab2 c O | ¬ 1 c O
7 5 6 elpwi2 c O | ¬ 1 c 𝒫 O
8 fveq2 x = c O | ¬ 1 c x = c O | ¬ 1 c
9 8 oveq1d x = c O | ¬ 1 c x O = c O | ¬ 1 c O
10 ovex c O | ¬ 1 c O V
11 9 4 10 fvmpt c O | ¬ 1 c 𝒫 O P c O | ¬ 1 c = c O | ¬ 1 c O
12 7 11 ax-mp P c O | ¬ 1 c = c O | ¬ 1 c O
13 an32 c 𝒫 1 M + N ¬ 1 c c = M c 𝒫 1 M + N c = M ¬ 1 c
14 2eluzge1 2 1
15 fzss1 2 1 2 M + N 1 M + N
16 14 15 ax-mp 2 M + N 1 M + N
17 16 sspwi 𝒫 2 M + N 𝒫 1 M + N
18 17 sseli c 𝒫 2 M + N c 𝒫 1 M + N
19 1lt2 1 < 2
20 1re 1
21 2re 2
22 20 21 ltnlei 1 < 2 ¬ 2 1
23 19 22 mpbi ¬ 2 1
24 elfzle1 1 2 M + N 2 1
25 23 24 mto ¬ 1 2 M + N
26 elelpwi 1 c c 𝒫 2 M + N 1 2 M + N
27 25 26 mto ¬ 1 c c 𝒫 2 M + N
28 ancom 1 c c 𝒫 2 M + N c 𝒫 2 M + N 1 c
29 27 28 mtbi ¬ c 𝒫 2 M + N 1 c
30 29 imnani c 𝒫 2 M + N ¬ 1 c
31 18 30 jca c 𝒫 2 M + N c 𝒫 1 M + N ¬ 1 c
32 ssin c 1 M + N c i | ¬ i = 1 c 1 M + N i | ¬ i = 1
33 1le2 1 2
34 1p1e2 1 + 1 = 2
35 nnge1 M 1 M
36 1 35 ax-mp 1 M
37 nnge1 N 1 N
38 2 37 ax-mp 1 N
39 1 nnrei M
40 2 nnrei N
41 20 20 39 40 le2addi 1 M 1 N 1 + 1 M + N
42 36 38 41 mp2an 1 + 1 M + N
43 34 42 eqbrtrri 2 M + N
44 39 40 readdcli M + N
45 20 21 44 letri 1 2 2 M + N 1 M + N
46 33 43 45 mp2an 1 M + N
47 1z 1
48 nnaddcl M N M + N
49 1 2 48 mp2an M + N
50 49 nnzi M + N
51 eluz 1 M + N M + N 1 1 M + N
52 47 50 51 mp2an M + N 1 1 M + N
53 46 52 mpbir M + N 1
54 elfzp12 M + N 1 i 1 M + N i = 1 i 1 + 1 M + N
55 53 54 ax-mp i 1 M + N i = 1 i 1 + 1 M + N
56 55 biimpi i 1 M + N i = 1 i 1 + 1 M + N
57 56 orcanai i 1 M + N ¬ i = 1 i 1 + 1 M + N
58 34 oveq1i 1 + 1 M + N = 2 M + N
59 57 58 eleqtrdi i 1 M + N ¬ i = 1 i 2 M + N
60 59 ss2abi i | i 1 M + N ¬ i = 1 i | i 2 M + N
61 inab i | i 1 M + N i | ¬ i = 1 = i | i 1 M + N ¬ i = 1
62 abid2 i | i 1 M + N = 1 M + N
63 62 ineq1i i | i 1 M + N i | ¬ i = 1 = 1 M + N i | ¬ i = 1
64 61 63 eqtr3i i | i 1 M + N ¬ i = 1 = 1 M + N i | ¬ i = 1
65 abid2 i | i 2 M + N = 2 M + N
66 60 64 65 3sstr3i 1 M + N i | ¬ i = 1 2 M + N
67 sstr c 1 M + N i | ¬ i = 1 1 M + N i | ¬ i = 1 2 M + N c 2 M + N
68 66 67 mpan2 c 1 M + N i | ¬ i = 1 c 2 M + N
69 32 68 sylbi c 1 M + N c i | ¬ i = 1 c 2 M + N
70 velpw c 𝒫 1 M + N c 1 M + N
71 ssab c i | ¬ i = 1 i i c ¬ i = 1
72 df-ex i i = 1 i c ¬ i ¬ i = 1 i c
73 72 bicomi ¬ i ¬ i = 1 i c i i = 1 i c
74 73 con1bii ¬ i i = 1 i c i ¬ i = 1 i c
75 dfclel 1 c i i = 1 i c
76 75 notbii ¬ 1 c ¬ i i = 1 i c
77 imnang i i c ¬ i = 1 i ¬ i c i = 1
78 ancom i = 1 i c i c i = 1
79 78 notbii ¬ i = 1 i c ¬ i c i = 1
80 79 albii i ¬ i = 1 i c i ¬ i c i = 1
81 77 80 bitr4i i i c ¬ i = 1 i ¬ i = 1 i c
82 74 76 81 3bitr4ri i i c ¬ i = 1 ¬ 1 c
83 71 82 bitr2i ¬ 1 c c i | ¬ i = 1
84 70 83 anbi12i c 𝒫 1 M + N ¬ 1 c c 1 M + N c i | ¬ i = 1
85 velpw c 𝒫 2 M + N c 2 M + N
86 69 84 85 3imtr4i c 𝒫 1 M + N ¬ 1 c c 𝒫 2 M + N
87 31 86 impbii c 𝒫 2 M + N c 𝒫 1 M + N ¬ 1 c
88 87 anbi1i c 𝒫 2 M + N c = M c 𝒫 1 M + N ¬ 1 c c = M
89 3 rabeq2i c O c 𝒫 1 M + N c = M
90 89 anbi1i c O ¬ 1 c c 𝒫 1 M + N c = M ¬ 1 c
91 13 88 90 3bitr4i c 𝒫 2 M + N c = M c O ¬ 1 c
92 91 rabbia2 c 𝒫 2 M + N | c = M = c O | ¬ 1 c
93 92 fveq2i c 𝒫 2 M + N | c = M = c O | ¬ 1 c
94 fzfi 2 M + N Fin
95 1 nnzi M
96 hashbc 2 M + N Fin M ( 2 M + N M) = c 𝒫 2 M + N | c = M
97 94 95 96 mp2an ( 2 M + N M) = c 𝒫 2 M + N | c = M
98 2z 2
99 98 eluz1i M + N 2 M + N 2 M + N
100 50 43 99 mpbir2an M + N 2
101 hashfz M + N 2 2 M + N = M + N - 2 + 1
102 100 101 ax-mp 2 M + N = M + N - 2 + 1
103 1 nncni M
104 2 nncni N
105 103 104 addcli M + N
106 2cn 2
107 ax-1cn 1
108 subadd23 M + N 2 1 M + N - 2 + 1 = M + N + 1 2
109 105 106 107 108 mp3an M + N - 2 + 1 = M + N + 1 2
110 106 107 negsubdi2i 2 1 = 1 2
111 2m1e1 2 1 = 1
112 111 negeqi 2 1 = 1
113 110 112 eqtr3i 1 2 = 1
114 113 oveq2i M + N + 1 2 = M + N + -1
115 102 109 114 3eqtri 2 M + N = M + N + -1
116 105 107 negsubi M + N + -1 = M + N - 1
117 115 116 eqtri 2 M + N = M + N - 1
118 117 oveq1i ( 2 M + N M) = ( M + N - 1 M)
119 97 118 eqtr3i c 𝒫 2 M + N | c = M = ( M + N - 1 M)
120 93 119 eqtr3i c O | ¬ 1 c = ( M + N - 1 M)
121 1 2 3 ballotlem1 O = ( M + N M)
122 120 121 oveq12i c O | ¬ 1 c O = ( M + N - 1 M) ( M + N M)
123 12 122 eqtri P c O | ¬ 1 c = ( M + N - 1 M) ( M + N M)
124 0le1 0 1
125 0re 0
126 125 20 39 letri 0 1 1 M 0 M
127 124 36 126 mp2an 0 M
128 2 nngt0i 0 < N
129 40 128 elrpii N +
130 ltaddrp M N + M < M + N
131 39 129 130 mp2an M < M + N
132 0z 0
133 elfzm11 0 M + N M 0 M + N - 1 M 0 M M < M + N
134 132 50 133 mp2an M 0 M + N - 1 M 0 M M < M + N
135 95 127 131 134 mpbir3an M 0 M + N - 1
136 bcm1n M 0 M + N - 1 M + N ( M + N - 1 M) ( M + N M) = M + N - M M + N
137 135 49 136 mp2an ( M + N - 1 M) ( M + N M) = M + N - M M + N
138 pncan2 M N M + N - M = N
139 103 104 138 mp2an M + N - M = N
140 139 oveq1i M + N - M M + N = N M + N
141 123 137 140 3eqtri P c O | ¬ 1 c = N M + N