Mathbox for Thierry Arnoux < Previous   Next > Nearby theorems Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  ballotlemsv Structured version   Visualization version   GIF version

Theorem ballotlemsv 29898
 Description: Value of 𝑆 evaluated at 𝐽 for a given counting 𝐶. (Contributed by Thierry Arnoux, 12-Apr-2017.)
Hypotheses
Ref Expression
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
Ref Expression
ballotlemsv ((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) → ((𝑆𝐶)‘𝐽) = if(𝐽 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝐽), 𝐽))
Distinct variable groups:   𝑀,𝑐   𝑁,𝑐   𝑂,𝑐   𝑖,𝑀   𝑖,𝑁   𝑖,𝑂   𝑘,𝑀   𝑘,𝑁   𝑘,𝑂   𝑖,𝑐,𝐹,𝑘   𝐶,𝑖,𝑘   𝑖,𝐸,𝑘   𝐶,𝑘   𝑘,𝐼,𝑐   𝐸,𝑐   𝑖,𝐼,𝑐
Allowed substitution hints:   𝐶(𝑥,𝑐)   𝑃(𝑥,𝑖,𝑘,𝑐)   𝑆(𝑥,𝑖,𝑘,𝑐)   𝐸(𝑥)   𝐹(𝑥)   𝐼(𝑥)   𝐽(𝑥,𝑖,𝑘,𝑐)   𝑀(𝑥)   𝑁(𝑥)   𝑂(𝑥)

Proof of Theorem ballotlemsv
Dummy variable 𝑗 is distinct from all other variables.
StepHypRef Expression
1 ballotth.m . . . . 5 𝑀 ∈ ℕ
2 ballotth.n . . . . 5 𝑁 ∈ ℕ
3 ballotth.o . . . . 5 𝑂 = {𝑐 ∈ 𝒫 (1...(𝑀 + 𝑁)) ∣ (#‘𝑐) = 𝑀}
4 ballotth.p . . . . 5 𝑃 = (𝑥 ∈ 𝒫 𝑂 ↦ ((#‘𝑥) / (#‘𝑂)))
5 ballotth.f . . . . 5 𝐹 = (𝑐𝑂 ↦ (𝑖 ∈ ℤ ↦ ((#‘((1...𝑖) ∩ 𝑐)) − (#‘((1...𝑖) ∖ 𝑐)))))
6 ballotth.e . . . . 5 𝐸 = {𝑐𝑂 ∣ ∀𝑖 ∈ (1...(𝑀 + 𝑁))0 < ((𝐹𝑐)‘𝑖)}
7 ballotth.mgtn . . . . 5 𝑁 < 𝑀
8 ballotth.i . . . . 5 𝐼 = (𝑐 ∈ (𝑂𝐸) ↦ inf({𝑘 ∈ (1...(𝑀 + 𝑁)) ∣ ((𝐹𝑐)‘𝑘) = 0}, ℝ, < ))
9 ballotth.s . . . . 5 𝑆 = (𝑐 ∈ (𝑂𝐸) ↦ (𝑖 ∈ (1...(𝑀 + 𝑁)) ↦ if(𝑖 ≤ (𝐼𝑐), (((𝐼𝑐) + 1) − 𝑖), 𝑖)))
101, 2, 3, 4, 5, 6, 7, 8, 9ballotlemsval 29897 . . . 4 (𝐶 ∈ (𝑂𝐸) → (𝑆𝐶) = (𝑖 ∈ (1...(𝑀 + 𝑁)) ↦ if(𝑖 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑖), 𝑖)))
11 breq1 4586 . . . . . 6 (𝑖 = 𝑗 → (𝑖 ≤ (𝐼𝐶) ↔ 𝑗 ≤ (𝐼𝐶)))
12 oveq2 6557 . . . . . 6 (𝑖 = 𝑗 → (((𝐼𝐶) + 1) − 𝑖) = (((𝐼𝐶) + 1) − 𝑗))
13 id 22 . . . . . 6 (𝑖 = 𝑗𝑖 = 𝑗)
1411, 12, 13ifbieq12d 4063 . . . . 5 (𝑖 = 𝑗 → if(𝑖 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑖), 𝑖) = if(𝑗 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑗), 𝑗))
1514cbvmptv 4678 . . . 4 (𝑖 ∈ (1...(𝑀 + 𝑁)) ↦ if(𝑖 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑖), 𝑖)) = (𝑗 ∈ (1...(𝑀 + 𝑁)) ↦ if(𝑗 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑗), 𝑗))
1610, 15syl6eq 2660 . . 3 (𝐶 ∈ (𝑂𝐸) → (𝑆𝐶) = (𝑗 ∈ (1...(𝑀 + 𝑁)) ↦ if(𝑗 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑗), 𝑗)))
1716adantr 480 . 2 ((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) → (𝑆𝐶) = (𝑗 ∈ (1...(𝑀 + 𝑁)) ↦ if(𝑗 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑗), 𝑗)))
18 simpr 476 . . . . 5 ((𝐶 ∈ (𝑂𝐸) ∧ 𝑗 = 𝐽) → 𝑗 = 𝐽)
1918breq1d 4593 . . . 4 ((𝐶 ∈ (𝑂𝐸) ∧ 𝑗 = 𝐽) → (𝑗 ≤ (𝐼𝐶) ↔ 𝐽 ≤ (𝐼𝐶)))
2018oveq2d 6565 . . . 4 ((𝐶 ∈ (𝑂𝐸) ∧ 𝑗 = 𝐽) → (((𝐼𝐶) + 1) − 𝑗) = (((𝐼𝐶) + 1) − 𝐽))
2119, 20, 18ifbieq12d 4063 . . 3 ((𝐶 ∈ (𝑂𝐸) ∧ 𝑗 = 𝐽) → if(𝑗 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑗), 𝑗) = if(𝐽 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝐽), 𝐽))
2221adantlr 747 . 2 (((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) ∧ 𝑗 = 𝐽) → if(𝑗 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝑗), 𝑗) = if(𝐽 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝐽), 𝐽))
23 simpr 476 . 2 ((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) → 𝐽 ∈ (1...(𝑀 + 𝑁)))
24 ovex 6577 . . . 4 (((𝐼𝐶) + 1) − 𝐽) ∈ V
2524a1i 11 . . 3 (((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) ∧ 𝐽 ≤ (𝐼𝐶)) → (((𝐼𝐶) + 1) − 𝐽) ∈ V)
26 elex 3185 . . . 4 (𝐽 ∈ (1...(𝑀 + 𝑁)) → 𝐽 ∈ V)
2726ad2antlr 759 . . 3 (((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) ∧ ¬ 𝐽 ≤ (𝐼𝐶)) → 𝐽 ∈ V)
2825, 27ifclda 4070 . 2 ((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) → if(𝐽 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝐽), 𝐽) ∈ V)
2917, 22, 23, 28fvmptd 6197 1 ((𝐶 ∈ (𝑂𝐸) ∧ 𝐽 ∈ (1...(𝑀 + 𝑁))) → ((𝑆𝐶)‘𝐽) = if(𝐽 ≤ (𝐼𝐶), (((𝐼𝐶) + 1) − 𝐽), 𝐽))
 Colors of variables: wff setvar class Syntax hints:  ¬ wn 3   → wi 4   ∧ wa 383   = wceq 1475   ∈ wcel 1977  ∀wral 2896  {crab 2900  Vcvv 3173   ∖ cdif 3537   ∩ cin 3539  ifcif 4036  𝒫 cpw 4108   class class class wbr 4583   ↦ cmpt 4643  ‘cfv 5804  (class class class)co 6549  infcinf 8230  ℝcr 9814  0cc0 9815  1c1 9816   + caddc 9818   < clt 9953   ≤ cle 9954   − cmin 10145   / cdiv 10563  ℕcn 10897  ℤcz 11254  ...cfz 12197  #chash 12979 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1713  ax-4 1728  ax-5 1827  ax-6 1875  ax-7 1922  ax-9 1986  ax-10 2006  ax-11 2021  ax-12 2034  ax-13 2234  ax-ext 2590  ax-rep 4699  ax-sep 4709  ax-nul 4717  ax-pr 4833 This theorem depends on definitions:  df-bi 196  df-or 384  df-an 385  df-3an 1033  df-tru 1478  df-ex 1696  df-nf 1701  df-sb 1868  df-eu 2462  df-mo 2463  df-clab 2597  df-cleq 2603  df-clel 2606  df-nfc 2740  df-ne 2782  df-ral 2901  df-rex 2902  df-reu 2903  df-rab 2905  df-v 3175  df-sbc 3403  df-csb 3500  df-dif 3543  df-un 3545  df-in 3547  df-ss 3554  df-nul 3875  df-if 4037  df-sn 4126  df-pr 4128  df-op 4132  df-uni 4373  df-iun 4457  df-br 4584  df-opab 4644  df-mpt 4645  df-id 4953  df-xp 5044  df-rel 5045  df-cnv 5046  df-co 5047  df-dm 5048  df-rn 5049  df-res 5050  df-ima 5051  df-iota 5768  df-fun 5806  df-fn 5807  df-f 5808  df-f1 5809  df-fo 5810  df-f1o 5811  df-fv 5812  df-ov 6552 This theorem is referenced by:  ballotlemsgt1  29899  ballotlemsdom  29900  ballotlemsel1i  29901  ballotlemsf1o  29902  ballotlemsi  29903  ballotlemsima  29904  ballotlemrv  29908
 Copyright terms: Public domain W3C validator