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 |
|
simpl |
⊢ ( ( 𝑑 = 𝐶 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → 𝑑 = 𝐶 ) |
11 |
10
|
fveq2d |
⊢ ( ( 𝑑 = 𝐶 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( 𝐼 ‘ 𝑑 ) = ( 𝐼 ‘ 𝐶 ) ) |
12 |
11
|
breq2d |
⊢ ( ( 𝑑 = 𝐶 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) ↔ 𝑖 ≤ ( 𝐼 ‘ 𝐶 ) ) ) |
13 |
11
|
oveq1d |
⊢ ( ( 𝑑 = 𝐶 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( 𝐼 ‘ 𝑑 ) + 1 ) = ( ( 𝐼 ‘ 𝐶 ) + 1 ) ) |
14 |
13
|
oveq1d |
⊢ ( ( 𝑑 = 𝐶 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) = ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝑖 ) ) |
15 |
12 14
|
ifbieq1d |
⊢ ( ( 𝑑 = 𝐶 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → if ( 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) , ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) , 𝑖 ) = if ( 𝑖 ≤ ( 𝐼 ‘ 𝐶 ) , ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝑖 ) , 𝑖 ) ) |
16 |
15
|
mpteq2dva |
⊢ ( 𝑑 = 𝐶 → ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) , ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) , 𝑖 ) ) = ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝐶 ) , ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ) |
17 |
|
simpl |
⊢ ( ( 𝑐 = 𝑑 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → 𝑐 = 𝑑 ) |
18 |
17
|
fveq2d |
⊢ ( ( 𝑐 = 𝑑 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( 𝐼 ‘ 𝑐 ) = ( 𝐼 ‘ 𝑑 ) ) |
19 |
18
|
breq2d |
⊢ ( ( 𝑐 = 𝑑 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( 𝑖 ≤ ( 𝐼 ‘ 𝑐 ) ↔ 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) ) ) |
20 |
18
|
oveq1d |
⊢ ( ( 𝑐 = 𝑑 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( 𝐼 ‘ 𝑐 ) + 1 ) = ( ( 𝐼 ‘ 𝑑 ) + 1 ) ) |
21 |
20
|
oveq1d |
⊢ ( ( 𝑐 = 𝑑 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( ( 𝐼 ‘ 𝑐 ) + 1 ) − 𝑖 ) = ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) ) |
22 |
19 21
|
ifbieq1d |
⊢ ( ( 𝑐 = 𝑑 ∧ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → if ( 𝑖 ≤ ( 𝐼 ‘ 𝑐 ) , ( ( ( 𝐼 ‘ 𝑐 ) + 1 ) − 𝑖 ) , 𝑖 ) = if ( 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) , ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) , 𝑖 ) ) |
23 |
22
|
mpteq2dva |
⊢ ( 𝑐 = 𝑑 → ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝑐 ) , ( ( ( 𝐼 ‘ 𝑐 ) + 1 ) − 𝑖 ) , 𝑖 ) ) = ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) , ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ) |
24 |
23
|
cbvmptv |
⊢ ( 𝑐 ∈ ( 𝑂 ∖ 𝐸 ) ↦ ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝑐 ) , ( ( ( 𝐼 ‘ 𝑐 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ) = ( 𝑑 ∈ ( 𝑂 ∖ 𝐸 ) ↦ ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) , ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ) |
25 |
9 24
|
eqtri |
⊢ 𝑆 = ( 𝑑 ∈ ( 𝑂 ∖ 𝐸 ) ↦ ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝑑 ) , ( ( ( 𝐼 ‘ 𝑑 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ) |
26 |
|
ovex |
⊢ ( 1 ... ( 𝑀 + 𝑁 ) ) ∈ V |
27 |
26
|
mptex |
⊢ ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝐶 ) , ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ∈ V |
28 |
16 25 27
|
fvmpt |
⊢ ( 𝐶 ∈ ( 𝑂 ∖ 𝐸 ) → ( 𝑆 ‘ 𝐶 ) = ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼 ‘ 𝐶 ) , ( ( ( 𝐼 ‘ 𝐶 ) + 1 ) − 𝑖 ) , 𝑖 ) ) ) |