ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  2zsupmax Unicode version

Theorem 2zsupmax 10720
Description: Two ways to express the maximum of two integers. Because order of integers is decidable, we have more flexibility than for real numbers. (Contributed by Jim Kingdon, 22-Jan-2023.)
Assertion
Ref Expression
2zsupmax  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  sup ( { A ,  B } ,  RR ,  <  )  =  if ( A  <_  B ,  B ,  A ) )

Proof of Theorem 2zsupmax
StepHypRef Expression
1 simpr 109 . . . 4  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  A  <_  B
)  ->  A  <_  B )
2 zre 8817 . . . . . 6  |-  ( A  e.  ZZ  ->  A  e.  RR )
32adantr 271 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  A  e.  RR )
4 zre 8817 . . . . . . 7  |-  ( B  e.  ZZ  ->  B  e.  RR )
54adantl 272 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  B  e.  RR )
65adantr 271 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  A  <_  B
)  ->  B  e.  RR )
7 maxleb 10712 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  RR )  ->  ( A  <_  B  <->  sup ( { A ,  B } ,  RR ,  <  )  =  B ) )
83, 6, 7syl2an2r 563 . . . 4  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  A  <_  B
)  ->  ( A  <_  B  <->  sup ( { A ,  B } ,  RR ,  <  )  =  B ) )
91, 8mpbid 146 . . 3  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  A  <_  B
)  ->  sup ( { A ,  B } ,  RR ,  <  )  =  B )
101iftrued 3406 . . 3  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  A  <_  B
)  ->  if ( A  <_  B ,  B ,  A )  =  B )
119, 10eqtr4d 2124 . 2  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  A  <_  B
)  ->  sup ( { A ,  B } ,  RR ,  <  )  =  if ( A  <_  B ,  B ,  A ) )
12 maxcom 10699 . . . 4  |-  sup ( { B ,  A } ,  RR ,  <  )  =  sup ( { A ,  B } ,  RR ,  <  )
135adantr 271 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  B  e.  RR )
143adantr 271 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  A  e.  RR )
15 zltnle 8859 . . . . . . . 8  |-  ( ( B  e.  ZZ  /\  A  e.  ZZ )  ->  ( B  <  A  <->  -.  A  <_  B )
)
1615ancoms 265 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  ( B  <  A  <->  -.  A  <_  B )
)
1716biimpar 292 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  B  <  A )
1813, 14, 17ltled 7665 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  B  <_  A )
19 maxleb 10712 . . . . . 6  |-  ( ( B  e.  RR  /\  A  e.  RR )  ->  ( B  <_  A  <->  sup ( { B ,  A } ,  RR ,  <  )  =  A ) )
205, 14, 19syl2an2r 563 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  ( B  <_  A  <->  sup ( { B ,  A } ,  RR ,  <  )  =  A ) )
2118, 20mpbid 146 . . . 4  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  sup ( { B ,  A } ,  RR ,  <  )  =  A )
2212, 21syl5eqr 2135 . . 3  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  sup ( { A ,  B } ,  RR ,  <  )  =  A )
23 simpr 109 . . . 4  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  -.  A  <_  B )
2423iffalsed 3409 . . 3  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  if ( A  <_  B ,  B ,  A )  =  A )
2522, 24eqtr4d 2124 . 2  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  A  <_  B )  ->  sup ( { A ,  B } ,  RR ,  <  )  =  if ( A  <_  B ,  B ,  A )
)
26 zdcle 8886 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  -> DECID  A  <_  B )
27 exmiddc 783 . . 3  |-  (DECID  A  <_  B  ->  ( A  <_  B  \/  -.  A  <_  B ) )
2826, 27syl 14 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  ( A  <_  B  \/  -.  A  <_  B
) )
2911, 25, 28mpjaodan 748 1  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  sup ( { A ,  B } ,  RR ,  <  )  =  if ( A  <_  B ,  B ,  A ) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 103    <-> wb 104    \/ wo 665  DECID wdc 781    = wceq 1290    e. wcel 1439   ifcif 3399   {cpr 3453   class class class wbr 3853   supcsup 6733   RRcr 7412    < clt 7585    <_ cle 7586   ZZcz 8813
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 580  ax-in2 581  ax-io 666  ax-5 1382  ax-7 1383  ax-gen 1384  ax-ie1 1428  ax-ie2 1429  ax-8 1441  ax-10 1442  ax-11 1443  ax-i12 1444  ax-bndl 1445  ax-4 1446  ax-13 1450  ax-14 1451  ax-17 1465  ax-i9 1469  ax-ial 1473  ax-i5r 1474  ax-ext 2071  ax-coll 3962  ax-sep 3965  ax-nul 3973  ax-pow 4017  ax-pr 4047  ax-un 4271  ax-setind 4368  ax-iinf 4418  ax-cnex 7499  ax-resscn 7500  ax-1cn 7501  ax-1re 7502  ax-icn 7503  ax-addcl 7504  ax-addrcl 7505  ax-mulcl 7506  ax-mulrcl 7507  ax-addcom 7508  ax-mulcom 7509  ax-addass 7510  ax-mulass 7511  ax-distr 7512  ax-i2m1 7513  ax-0lt1 7514  ax-1rid 7515  ax-0id 7516  ax-rnegex 7517  ax-precex 7518  ax-cnre 7519  ax-pre-ltirr 7520  ax-pre-ltwlin 7521  ax-pre-lttrn 7522  ax-pre-apti 7523  ax-pre-ltadd 7524  ax-pre-mulgt0 7525  ax-pre-mulext 7526  ax-arch 7527  ax-caucvg 7528
This theorem depends on definitions:  df-bi 116  df-dc 782  df-3or 926  df-3an 927  df-tru 1293  df-fal 1296  df-nf 1396  df-sb 1694  df-eu 1952  df-mo 1953  df-clab 2076  df-cleq 2082  df-clel 2085  df-nfc 2218  df-ne 2257  df-nel 2352  df-ral 2365  df-rex 2366  df-reu 2367  df-rmo 2368  df-rab 2369  df-v 2624  df-sbc 2844  df-csb 2937  df-dif 3004  df-un 3006  df-in 3008  df-ss 3015  df-nul 3290  df-if 3400  df-pw 3437  df-sn 3458  df-pr 3459  df-op 3461  df-uni 3662  df-int 3697  df-iun 3740  df-br 3854  df-opab 3908  df-mpt 3909  df-tr 3945  df-id 4131  df-po 4134  df-iso 4135  df-iord 4204  df-on 4206  df-ilim 4207  df-suc 4209  df-iom 4421  df-xp 4460  df-rel 4461  df-cnv 4462  df-co 4463  df-dm 4464  df-rn 4465  df-res 4466  df-ima 4467  df-iota 4995  df-fun 5032  df-fn 5033  df-f 5034  df-f1 5035  df-fo 5036  df-f1o 5037  df-fv 5038  df-riota 5624  df-ov 5671  df-oprab 5672  df-mpt2 5673  df-1st 5927  df-2nd 5928  df-recs 6086  df-frec 6172  df-sup 6735  df-pnf 7587  df-mnf 7588  df-xr 7589  df-ltxr 7590  df-le 7591  df-sub 7718  df-neg 7719  df-reap 8115  df-ap 8122  df-div 8203  df-inn 8486  df-2 8544  df-3 8545  df-4 8546  df-n0 8737  df-z 8814  df-uz 9083  df-rp 9198  df-iseq 9916  df-seq3 9917  df-exp 10018  df-cj 10339  df-re 10340  df-im 10341  df-rsqrt 10494  df-abs 10495
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator