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

Theorem ballotlemsv 26897
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 26896 . . . 4  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( i  e.  ( 1 ... ( M  +  N )
)  |->  if ( i  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i ) ) )
11 breq1 4300 . . . . . 6  |-  ( i  =  j  ->  (
i  <_  ( I `  C )  <->  j  <_  ( I `  C ) ) )
12 oveq2 6104 . . . . . 6  |-  ( i  =  j  ->  (
( ( I `  C )  +  1 )  -  i )  =  ( ( ( I `  C )  +  1 )  -  j ) )
13 id 22 . . . . . 6  |-  ( i  =  j  ->  i  =  j )
1411, 12, 13ifbieq12d 3821 . . . . 5  |-  ( i  =  j  ->  if ( i  <_  (
I `  C ) ,  ( ( ( I `  C )  +  1 )  -  i ) ,  i )  =  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) )
1514cbvmptv 4388 . . . 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 2491 . . 3  |-  ( C  e.  ( O  \  E )  ->  ( S `  C )  =  ( j  e.  ( 1 ... ( M  +  N )
)  |->  if ( j  <_  ( I `  C ) ,  ( ( ( I `  C )  +  1 )  -  j ) ,  j ) ) )
1716adantr 465 . 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 461 . . . . 5  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  j  =  J )
1918breq1d 4307 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( j  <_  (
I `  C )  <->  J  <_  ( I `  C ) ) )
2018oveq2d 6112 . . . 4  |-  ( ( C  e.  ( O 
\  E )  /\  j  =  J )  ->  ( ( ( I `
 C )  +  1 )  -  j
)  =  ( ( ( I `  C
)  +  1 )  -  J ) )
2119, 20, 18ifbieq12d 3821 . . 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 714 . 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 461 . 2  |-  ( ( C  e.  ( O 
\  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  ->  J  e.  ( 1 ... ( M  +  N ) ) )
24 ovex 6121 . . . 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 2986 . . . 4  |-  ( J  e.  ( 1 ... ( M  +  N
) )  ->  J  e.  _V )
2726ad2antlr 726 . . 3  |-  ( ( ( C  e.  ( O  \  E )  /\  J  e.  ( 1 ... ( M  +  N ) ) )  /\  -.  J  <_  ( I `  C
) )  ->  J  e.  _V )
2825, 27ifclda 3826 . 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 5784 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 setvar class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 369    = wceq 1369    e. wcel 1756   A.wral 2720   {crab 2724   _Vcvv 2977    \ cdif 3330    i^i cin 3332   ifcif 3796   ~Pcpw 3865   class class class wbr 4297    e. cmpt 4355   `'ccnv 4844   ` cfv 5423  (class class class)co 6096   supcsup 7695   RRcr 9286   0cc0 9287   1c1 9288    + caddc 9290    < clt 9423    <_ cle 9424    - cmin 9600    / cdiv 9998   NNcn 10327   ZZcz 10651   ...cfz 11442   #chash 12108
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2423  ax-rep 4408  ax-sep 4418  ax-nul 4426  ax-pr 4536
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2257  df-mo 2258  df-clab 2430  df-cleq 2436  df-clel 2439  df-nfc 2573  df-ne 2613  df-ral 2725  df-rex 2726  df-reu 2727  df-rab 2729  df-v 2979  df-sbc 3192  df-csb 3294  df-dif 3336  df-un 3338  df-in 3340  df-ss 3347  df-nul 3643  df-if 3797  df-sn 3883  df-pr 3885  df-op 3889  df-uni 4097  df-iun 4178  df-br 4298  df-opab 4356  df-mpt 4357  df-id 4641  df-xp 4851  df-rel 4852  df-cnv 4853  df-co 4854  df-dm 4855  df-rn 4856  df-res 4857  df-ima 4858  df-iota 5386  df-fun 5425  df-fn 5426  df-f 5427  df-f1 5428  df-fo 5429  df-f1o 5430  df-fv 5431  df-ov 6099
This theorem is referenced by:  ballotlemsgt1  26898  ballotlemsdom  26899  ballotlemsel1i  26900  ballotlemsf1o  26901  ballotlemsi  26902  ballotlemsima  26903  ballotlemrv  26907
  Copyright terms: Public domain W3C validator