Step |
Hyp |
Ref |
Expression |
1 |
|
ballotth.m |
⊢ 𝑀 ∈ ℕ |
2 |
|
ballotth.n |
⊢ 𝑁 ∈ ℕ |
3 |
|
ballotth.o |
⊢ 𝑂 = { 𝑐 ∈ 𝒫 ( 1 ... ( 𝑀 + 𝑁 ) ) ∣ ( ♯ ‘ 𝑐 ) = 𝑀 } |
4 |
|
ballotth.p |
⊢ 𝑃 = ( 𝑥 ∈ 𝒫 𝑂 ↦ ( ( ♯ ‘ 𝑥 ) / ( ♯ ‘ 𝑂 ) ) ) |
5 |
|
ballotth.f |
⊢ 𝐹 = ( 𝑐 ∈ 𝑂 ↦ ( 𝑖 ∈ ℤ ↦ ( ( ♯ ‘ ( ( 1 ... 𝑖 ) ∩ 𝑐 ) ) − ( ♯ ‘ ( ( 1 ... 𝑖 ) ∖ 𝑐 ) ) ) ) ) |
6 |
|
ballotth.e |
⊢ 𝐸 = { 𝑐 ∈ 𝑂 ∣ ∀ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) 0 < ( ( 𝐹 ‘ 𝑐 ) ‘ 𝑖 ) } |
7 |
|
ballotth.mgtn |
⊢ 𝑁 < 𝑀 |
8 |
|
ballotth.i |
⊢ 𝐼 = ( 𝑐 ∈ ( 𝑂 ∖ 𝐸 ) ↦ inf ( { 𝑘 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ∣ ( ( 𝐹 ‘ 𝑐 ) ‘ 𝑘 ) = 0 } , ℝ , < ) ) |
9 |
|
ballotth.s |
⊢ 𝑆 = ( 𝑐 ∈ ( 𝑂 ∖ 𝐸 ) ↦ ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝑐 ) , ( ( ( 𝐼 ‘ 𝑐 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ) |
10 |
|
ballotth.r |
⊢ 𝑅 = ( 𝑐 ∈ ( 𝑂 ∖ 𝐸 ) ↦ ( ( 𝑆 ‘ 𝑐 ) “ 𝑐 ) ) |
11 |
|
simpl |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ) |
12 |
1 2 3 4 5 6 7 8 9
|
ballotlemsf1o |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ( ( 𝑆 ‘ 𝐶 ) : ( 1 ... ( 𝑀 + 𝑁 ) ) –1-1-onto→ ( 1 ... ( 𝑀 + 𝑁 ) ) ∧ ◡ ( 𝑆 ‘ 𝐶 ) = ( 𝑆 ‘ 𝐶 ) ) ) |
13 |
12
|
simpld |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ( 𝑆 ‘ 𝐶 ) : ( 1 ... ( 𝑀 + 𝑁 ) ) –1-1-onto→ ( 1 ... ( 𝑀 + 𝑁 ) ) ) |
14 |
|
f1ofun |
⊢ ( ( 𝑆 ‘ 𝐶 ) : ( 1 ... ( 𝑀 + 𝑁 ) ) –1-1-onto→ ( 1 ... ( 𝑀 + 𝑁 ) ) → Fun ( 𝑆 ‘ 𝐶 ) ) |
15 |
11 13 14
|
3syl |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → Fun ( 𝑆 ‘ 𝐶 ) ) |
16 |
|
simpr |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) |
17 |
|
f1odm |
⊢ ( ( 𝑆 ‘ 𝐶 ) : ( 1 ... ( 𝑀 + 𝑁 ) ) –1-1-onto→ ( 1 ... ( 𝑀 + 𝑁 ) ) → dom ( 𝑆 ‘ 𝐶 ) = ( 1 ... ( 𝑀 + 𝑁 ) ) ) |
18 |
11 13 17
|
3syl |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → dom ( 𝑆 ‘ 𝐶 ) = ( 1 ... ( 𝑀 + 𝑁 ) ) ) |
19 |
16 18
|
eleqtrrd |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → 𝐽 ∈ dom ( 𝑆 ‘ 𝐶 ) ) |
20 |
|
fvimacnv |
⊢ ( ( Fun ( 𝑆 ‘ 𝐶 ) ∧ 𝐽 ∈ dom ( 𝑆 ‘ 𝐶 ) ) → ( ( ( 𝑆 ‘ 𝐶 ) ‘ 𝐽 ) ∈ 𝐶 ↔ 𝐽 ∈ ( ◡ ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) ) ) |
21 |
15 19 20
|
syl2anc |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( ( 𝑆 ‘ 𝐶 ) ‘ 𝐽 ) ∈ 𝐶 ↔ 𝐽 ∈ ( ◡ ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) ) ) |
22 |
1 2 3 4 5 6 7 8 9
|
ballotlemsv |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( 𝑆 ‘ 𝐶 ) ‘ 𝐽 ) = if ( 𝐽 ≤ ( 𝐼 ‘ 𝐶 ) , ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝐽 ) , 𝐽 ) ) |
23 |
22
|
eleq1d |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( ( 𝑆 ‘ 𝐶 ) ‘ 𝐽 ) ∈ 𝐶 ↔ if ( 𝐽 ≤ ( 𝐼 ‘ 𝐶 ) , ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝐽 ) , 𝐽 ) ∈ 𝐶 ) ) |
24 |
12
|
simprd |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ◡ ( 𝑆 ‘ 𝐶 ) = ( 𝑆 ‘ 𝐶 ) ) |
25 |
24
|
imaeq1d |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ( ◡ ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) = ( ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) ) |
26 |
1 2 3 4 5 6 7 8 9 10
|
ballotlemrval |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ( 𝑅 ‘ 𝐶 ) = ( ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) ) |
27 |
25 26
|
eqtr4d |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ( ◡ ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) = ( 𝑅 ‘ 𝐶 ) ) |
28 |
27
|
eleq2d |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ( 𝐽 ∈ ( ◡ ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) ↔ 𝐽 ∈ ( 𝑅 ‘ 𝐶 ) ) ) |
29 |
11 28
|
syl |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( 𝐽 ∈ ( ◡ ( 𝑆 ‘ 𝐶 ) “ 𝐶 ) ↔ 𝐽 ∈ ( 𝑅 ‘ 𝐶 ) ) ) |
30 |
21 23 29
|
3bitr3rd |
⊢ ( ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) ∧ 𝐽 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( 𝐽 ∈ ( 𝑅 ‘ 𝐶 ) ↔ if ( 𝐽 ≤ ( 𝐼 ‘ 𝐶 ) , ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝐽 ) , 𝐽 ) ∈ 𝐶 ) ) |