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

Theorem ballotlemsv 24720
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 24719 . . . 4  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( i  e.  ( 1 ... ( M  +  N )
)  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
11 breq1 4175 . . . . . 6  |-  ( i  =  j  ->  (
i  <_  ( I `  C )  <->  j  <_  ( I `  C ) ) )
12 oveq2 6048 . . . . . 6  |-  ( i  =  j  ->  (
( ( I `  C )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  j ) )
13 id 20 . . . . . 6  |-  ( i  =  j  ->  i  =  j )
1411, 12, 13ifbieq12d 3721 . . . . 5  |-  ( i  =  j  ->  if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i )  =  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) )
1514cbvmptv 4260 . . . 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 ) )
1610, 15syl6eq 2452 . . 3  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( j  e.  ( 1 ... ( M  +  N )
)  |->  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) ) )
1716adantr 452 . 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 ) ) )
18 simpr 448 . . . . 5  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  j  =  J )
1918breq1d 4182 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( j  <_  (
I `  C )  <->  J  <_  ( I `  C ) ) )
2018oveq2d 6056 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( ( ( I `
 C )  +  1 )  -  j
)  =  ( ( ( I `  C
)  +  1 )  -  J ) )
2119, 20, 18ifbieq12d 3721 . . 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
) )
2221adantlr 696 . 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 ) )
23 simpr 448 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  J  e.  ( 1 ... ( M  +  N ) ) )
24 ovex 6065 . . . 4  |-  ( ( ( I `  C
)  +  1 )  -  J )  e. 
_V
2524a1i 11 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  J  <_ 
( I `  C
) )  ->  (
( ( I `  C )  +  1 )  -  J )  e.  _V )
26 elex 2924 . . . 4  |-  ( J  e.  ( 1 ... ( M  +  N
) )  ->  J  e.  _V )
2726ad2antlr 708 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  -.  J  <_  ( I `  C
) )  ->  J  e.  _V )
2825, 27ifclda 3726 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  if ( J  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  J ) ,  J )  e. 
_V )
2917, 22, 23, 28fvmptd 5769 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 359    = wceq 1649    e. wcel 1721   A.wral 2666   {crab 2670   _Vcvv 2916    \ cdif 3277    i^i cin 3279   ifcif 3699   ~Pcpw 3759   class class class wbr 4172    e. cmpt 4226   `'ccnv 4836   ` cfv 5413  (class class class)co 6040   supcsup 7403   RRcr 8945   0cc0 8946   1c1 8947    + caddc 8949    < clt 9076    <_ cle 9077    - cmin 9247    / cdiv 9633   NNcn 9956   ZZcz 10238   ...cfz 10999   #chash 11573
This theorem is referenced by:  ballotlemsgt1  24721  ballotlemsdom  24722  ballotlemsel1i  24723  ballotlemsf1o  24724  ballotlemsi  24725  ballotlemsima  24726  ballotlemrv  24730
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1662  ax-8 1683  ax-14 1725  ax-6 1740  ax-7 1745  ax-11 1757  ax-12 1946  ax-ext 2385  ax-rep 4280  ax-sep 4290  ax-nul 4298  ax-pr 4363
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2258  df-mo 2259  df-clab 2391  df-cleq 2397  df-clel 2400  df-nfc 2529  df-ne 2569  df-ral 2671  df-rex 2672  df-reu 2673  df-rab 2675  df-v 2918  df-sbc 3122  df-csb 3212  df-dif 3283  df-un 3285  df-in 3287  df-ss 3294  df-nul 3589  df-if 3700  df-sn 3780  df-pr 3781  df-op 3783  df-uni 3976  df-iun 4055  df-br 4173  df-opab 4227  df-mpt 4228  df-id 4458  df-xp 4843  df-rel 4844  df-cnv 4845  df-co 4846  df-dm 4847  df-rn 4848  df-res 4849  df-ima 4850  df-iota 5377  df-fun 5415  df-fn 5416  df-f 5417  df-f1 5418  df-fo 5419  df-f1o 5420  df-fv 5421  df-ov 6043
  Copyright terms: Public domain W3C validator