Metamath Proof Explorer


Theorem ballotlemrval

Description: Value of R . (Contributed by Thierry Arnoux, 14-Apr-2017)

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
ballotth.f ⊢ F = c ∈ O ⟼ i ∈ ℤ ⟼ 1 … i ∩ c − 1 … i ∖ c
ballotth.e ⊢ E = c ∈ O | ∀ i ∈ 1 … M + N 0 < F ⁡ c ⁡ i
ballotth.mgtn ⊢ N < M
ballotth.i ⊢ I = c ∈ O ∖ E ⟼ inf k ∈ 1 … M + N | F ⁡ c ⁡ k = 0 ℝ <
ballotth.s ⊢ S = c ∈ O ∖ E ⟼ i ∈ 1 … M + N ⟼ if i ≤ I ⁡ c I ⁡ c + 1 - i i
ballotth.r ⊢ R = c ∈ O ∖ E ⟼ S ⁡ c c
Assertion ballotlemrval ⊢ C ∈ O ∖ E → R ⁡ C = S ⁡ C C

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 ballotth.f ⊢ F = c ∈ O ⟼ i ∈ ℤ ⟼ 1 … i ∩ c − 1 … i ∖ c
6 ballotth.e ⊢ E = c ∈ O | ∀ i ∈ 1 … M + N 0 < F ⁡ c ⁡ i
7 ballotth.mgtn ⊢ N < M
8 ballotth.i ⊢ I = c ∈ O ∖ E ⟼ inf k ∈ 1 … M + N | F ⁡ c ⁡ k = 0 ℝ <
9 ballotth.s ⊢ S = c ∈ O ∖ E ⟼ i ∈ 1 … M + N ⟼ if i ≤ I ⁡ c I ⁡ c + 1 - i i
10 ballotth.r ⊢ R = c ∈ O ∖ E ⟼ S ⁡ c c
11 fveq2 ⊢ d = C → S ⁡ d = S ⁡ C
12 id ⊢ d = C → d = C
13 11 12 imaeq12d ⊢ d = C → S ⁡ d d = S ⁡ C C
14 fveq2 ⊢ c = d → S ⁡ c = S ⁡ d
15 id ⊢ c = d → c = d
16 14 15 imaeq12d ⊢ c = d → S ⁡ c c = S ⁡ d d
17 16 cbvmptv ⊢ c ∈ O ∖ E ⟼ S ⁡ c c = d ∈ O ∖ E ⟼ S ⁡ d d
18 10 17 eqtri ⊢ R = d ∈ O ∖ E ⟼ S ⁡ d d
19 fvex ⊢ S ⁡ C ∈ V
20 imaexg ⊢ S ⁡ C ∈ V → S ⁡ C C ∈ V
21 19 20 ax-mp ⊢ S ⁡ C C ∈ V
22 13 18 21 fvmpt ⊢ C ∈ O ∖ E → R ⁡ C = S ⁡ C C