Users' Mathboxes Mathbox for Thierry Arnoux < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  ballotlemsv Unicode version

Theorem ballotlemsv 23068
Description: Value of  S evaluated at  J for a given counting  C. (Contributed by Thierry Arnoux, 12-Apr-2017.)
Hypotheses
Ref Expression
ballotth.m  |-  M  e.  NN
ballotth.n  |-  N  e.  NN
ballotth.o  |-  O  =  { c  e.  ~P ( 1 ... ( M  +  N )
)  |  ( # `  c )  =  M }
ballotth.p  |-  P  =  ( x  e.  ~P O  |->  ( ( # `  x )  /  ( # `
 O ) ) )
ballotth.f  |-  F  =  ( c  e.  O  |->  ( i  e.  ZZ  |->  ( ( # `  (
( 1 ... i
)  i^i  c )
)  -  ( # `  ( ( 1 ... i )  \  c
) ) ) ) )
ballotth.e  |-  E  =  { c  e.  O  |  A. i  e.  ( 1 ... ( M  +  N ) ) 0  <  ( ( F `  c ) `
 i ) }
ballotth.mgtn  |-  N  < 
M
ballotth.i  |-  I  =  ( c  e.  ( O  \  E ) 
|->  sup ( { k  e.  ( 1 ... ( M  +  N
) )  |  ( ( F `  c
) `  k )  =  0 } ,  RR ,  `'  <  ) )
ballotth.s  |-  S  =  ( c  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  c
) ,  ( ( ( I `  c
)  +  1 )  -  i ) ,  i ) ) )
Assertion
Ref Expression
ballotlemsv  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( S `
 C ) `  J )  =  if ( J  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J
) )
Distinct variable groups:    M, c    N, c    O, c    i, M   
i, N    i, O    k, M    k, N    k, O    i, c, F, k    C, i, k    i, E, k    C, k    k, I, c    E, c    i, I, c
Allowed substitution hints:    C( x, c)    P( x, i, k, c)    S( x, i, k, c)    E( x)    F( x)    I( x)    J( x, i, k, c)    M( x)    N( x)    O( x)

Proof of Theorem ballotlemsv
Dummy variable  j is distinct from all other variables.
StepHypRef Expression
1 ballotth.m . . . . 5  |-  M  e.  NN
2 ballotth.n . . . . 5  |-  N  e.  NN
3 ballotth.o . . . . 5  |-  O  =  { c  e.  ~P ( 1 ... ( M  +  N )
)  |  ( # `  c )  =  M }
4 ballotth.p . . . . 5  |-  P  =  ( x  e.  ~P O  |->  ( ( # `  x )  /  ( # `
 O ) ) )
5 ballotth.f . . . . 5  |-  F  =  ( c  e.  O  |->  ( i  e.  ZZ  |->  ( ( # `  (
( 1 ... i
)  i^i  c )
)  -  ( # `  ( ( 1 ... i )  \  c
) ) ) ) )
6 ballotth.e . . . . 5  |-  E  =  { c  e.  O  |  A. i  e.  ( 1 ... ( M  +  N ) ) 0  <  ( ( F `  c ) `
 i ) }
7 ballotth.mgtn . . . . 5  |-  N  < 
M
8 ballotth.i . . . . 5  |-  I  =  ( c  e.  ( O  \  E ) 
|->  sup ( { k  e.  ( 1 ... ( M  +  N
) )  |  ( ( F `  c
) `  k )  =  0 } ,  RR ,  `'  <  ) )
9 ballotth.s . . . . 5  |-  S  =  ( c  e.  ( O  \  E ) 
|->  ( i  e.  ( 1 ... ( M  +  N ) ) 
|->  if ( i  <_ 
( I `  c
) ,  ( ( ( I `  c
)  +  1 )  -  i ) ,  i ) ) )
101, 2, 3, 4, 5, 6, 7, 8, 9ballotlemsval 23067 . . . 4  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( i  e.  ( 1 ... ( M  +  N )
)  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
11 nfcv 2419 . . . . 5  |-  F/_ j if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i )
12 nfcv 2419 . . . . 5  |-  F/_ i if ( j  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j )
13 breq1 4026 . . . . . 6  |-  ( i  =  j  ->  (
i  <_  ( I `  C )  <->  j  <_  ( I `  C ) ) )
14 oveq2 5866 . . . . . 6  |-  ( i  =  j  ->  (
( ( I `  C )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  j ) )
15 id 19 . . . . . 6  |-  ( i  =  j  ->  i  =  j )
1613, 14, 15ifbieq12d 3587 . . . . 5  |-  ( i  =  j  ->  if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i )  =  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) )
1711, 12, 16cbvmpt 4110 . . . 4  |-  ( i  e.  ( 1 ... ( M  +  N
) )  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) )  =  ( j  e.  ( 1 ... ( M  +  N )
)  |->  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) )
1810, 17syl6eq 2331 . . 3  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( j  e.  ( 1 ... ( M  +  N )
)  |->  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) ) )
1918adantr 451 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  ( S `  C )  =  ( j  e.  ( 1 ... ( M  +  N ) )  |->  if ( j  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) ) )
20 simpr 447 . . . . 5  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  j  =  J )
2120breq1d 4033 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( j  <_  (
I `  C )  <->  J  <_  ( I `  C ) ) )
2220oveq2d 5874 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( ( ( I `
 C )  +  1 )  -  j
)  =  ( ( ( I `  C
)  +  1 )  -  J ) )
2321, 22, 20ifbieq12d 3587 . . 3  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  if ( j  <_ 
( I `  C
) ,  ( ( ( I `  C
)  +  1 )  -  j ) ,  j )  =  if ( J  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J
) )
2423adantlr 695 . 2  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  j  =  J )  ->  if ( j  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j )  =  if ( J  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J ) )
25 simpr 447 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  J  e.  ( 1 ... ( M  +  N ) ) )
26 ovex 5883 . . . 4  |-  ( ( ( I `  C
)  +  1 )  -  J )  e. 
_V
2726a1i 10 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  J  <_ 
( I `  C
) )  ->  (
( ( I `  C )  +  1 )  -  J )  e.  _V )
28 simplr 731 . . . 4  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  -.  J  <_  ( I `  C
) )  ->  J  e.  ( 1 ... ( M  +  N )
) )
29 elex 2796 . . . 4  |-  ( J  e.  ( 1 ... ( M  +  N
) )  ->  J  e.  _V )
3028, 29syl 15 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  -.  J  <_  ( I `  C
) )  ->  J  e.  _V )
3127, 30ifclda 3592 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  if ( J  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J )  e. 
_V )
3219, 24, 25, 31fvmptd 5606 1  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  ( ( S `
 C ) `  J )  =  if ( J  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J
) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 358    = wceq 1623    e. wcel 1684   A.wral 2543   {crab 2547   _Vcvv 2788    \ cdif 3149    i^i cin 3151   ifcif 3565   ~Pcpw 3625   class class class wbr 4023    e. cmpt 4077   `'ccnv 4688   ` cfv 5255  (class class class)co 5858   supcsup 7193   RRcr 8736   0cc0 8737   1c1 8738    + caddc 8740    < clt 8867    <_ cle 8868    - cmin 9037    / cdiv 9423   NNcn 9746   ZZcz 10024   ...cfz 10782   #chash 11337
This theorem is referenced by:  ballotlemsgt1  23069  ballotlemsdom  23070  ballotlemsel1i  23071  ballotlemsf1o  23072  ballotlemsi  23073  ballotlemsima  23074  ballotlemrv  23078
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pr 4214
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-ral 2548  df-rex 2549  df-reu 2550  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-nul 3456  df-if 3566  df-sn 3646  df-pr 3647  df-op 3649  df-uni 3828  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-id 4309  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-ov 5861
  Copyright terms: Public domain W3C validator