Metamath Proof Explorer


Theorem ballotlemsi

Description: The image by S of the first tie pick is the first pick. (Contributed by Thierry Arnoux, 14-Apr-2017)

Ref Expression
Hypotheses ballotth.m 𝑀 ∈ ℕ
ballotth.n 𝑁 ∈ ℕ
ballotth.o 𝑂 = { 𝑐 ∈ 𝒫 ( 1 ... ( 𝑀 + 𝑁 ) ) ∣ ( ♯ ‘ 𝑐 ) = 𝑀 }
ballotth.p 𝑃 = ( 𝑥 ∈ 𝒫 𝑂 ↦ ( ( ♯ ‘ 𝑥 ) / ( ♯ ‘ 𝑂 ) ) )
ballotth.f 𝐹 = ( 𝑐𝑂 ↦ ( 𝑖 ∈ ℤ ↦ ( ( ♯ ‘ ( ( 1 ... 𝑖 ) ∩ 𝑐 ) ) − ( ♯ ‘ ( ( 1 ... 𝑖 ) ∖ 𝑐 ) ) ) ) )
ballotth.e 𝐸 = { 𝑐𝑂 ∣ ∀ 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) 0 < ( ( 𝐹𝑐 ) ‘ 𝑖 ) }
ballotth.mgtn 𝑁 < 𝑀
ballotth.i 𝐼 = ( 𝑐 ∈ ( 𝑂𝐸 ) ↦ inf ( { 𝑘 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ∣ ( ( 𝐹𝑐 ) ‘ 𝑘 ) = 0 } , ℝ , < ) )
ballotth.s 𝑆 = ( 𝑐 ∈ ( 𝑂𝐸 ) ↦ ( 𝑖 ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ↦ if ( 𝑖 ≤ ( 𝐼𝑐 ) , ( ( ( 𝐼𝑐 ) + 1 ) − 𝑖 ) , 𝑖 ) ) )
Assertion ballotlemsi ( 𝐶 ∈ ( 𝑂𝐸 ) → ( ( 𝑆𝐶 ) ‘ ( 𝐼𝐶 ) ) = 1 )

Proof

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 1 2 3 4 5 6 7 8 ballotlemiex ( 𝐶 ∈ ( 𝑂𝐸 ) → ( ( 𝐼𝐶 ) ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ∧ ( ( 𝐹𝐶 ) ‘ ( 𝐼𝐶 ) ) = 0 ) )
11 10 simpld ( 𝐶 ∈ ( 𝑂𝐸 ) → ( 𝐼𝐶 ) ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) )
12 1 2 3 4 5 6 7 8 9 ballotlemsv ( ( 𝐶 ∈ ( 𝑂𝐸 ) ∧ ( 𝐼𝐶 ) ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) ) → ( ( 𝑆𝐶 ) ‘ ( 𝐼𝐶 ) ) = if ( ( 𝐼𝐶 ) ≤ ( 𝐼𝐶 ) , ( ( ( 𝐼𝐶 ) + 1 ) − ( 𝐼𝐶 ) ) , ( 𝐼𝐶 ) ) )
13 11 12 mpdan ( 𝐶 ∈ ( 𝑂𝐸 ) → ( ( 𝑆𝐶 ) ‘ ( 𝐼𝐶 ) ) = if ( ( 𝐼𝐶 ) ≤ ( 𝐼𝐶 ) , ( ( ( 𝐼𝐶 ) + 1 ) − ( 𝐼𝐶 ) ) , ( 𝐼𝐶 ) ) )
14 elfzelz ( ( 𝐼𝐶 ) ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) → ( 𝐼𝐶 ) ∈ ℤ )
15 14 zred ( ( 𝐼𝐶 ) ∈ ( 1 ... ( 𝑀 + 𝑁 ) ) → ( 𝐼𝐶 ) ∈ ℝ )
16 11 15 syl ( 𝐶 ∈ ( 𝑂𝐸 ) → ( 𝐼𝐶 ) ∈ ℝ )
17 16 leidd ( 𝐶 ∈ ( 𝑂𝐸 ) → ( 𝐼𝐶 ) ≤ ( 𝐼𝐶 ) )
18 17 iftrued ( 𝐶 ∈ ( 𝑂𝐸 ) → if ( ( 𝐼𝐶 ) ≤ ( 𝐼𝐶 ) , ( ( ( 𝐼𝐶 ) + 1 ) − ( 𝐼𝐶 ) ) , ( 𝐼𝐶 ) ) = ( ( ( 𝐼𝐶 ) + 1 ) − ( 𝐼𝐶 ) ) )
19 16 recnd ( 𝐶 ∈ ( 𝑂𝐸 ) → ( 𝐼𝐶 ) ∈ ℂ )
20 1cnd ( 𝐶 ∈ ( 𝑂𝐸 ) → 1 ∈ ℂ )
21 19 20 pncan2d ( 𝐶 ∈ ( 𝑂𝐸 ) → ( ( ( 𝐼𝐶 ) + 1 ) − ( 𝐼𝐶 ) ) = 1 )
22 13 18 21 3eqtrd ( 𝐶 ∈ ( 𝑂𝐸 ) → ( ( 𝑆𝐶 ) ‘ ( 𝐼𝐶 ) ) = 1 )