MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  dscmet Unicode version

Theorem dscmet 18095
Description: The discrete metric on any set  X. Definition 1.1-8 of [Kreyszig] p. 8. (Contributed by FL, 12-Oct-2006.)
Hypothesis
Ref Expression
dscmet.1  |-  D  =  ( x  e.  X ,  y  e.  X  |->  if ( x  =  y ,  0 ,  1 ) )
Assertion
Ref Expression
dscmet  |-  ( X  e.  V  ->  D  e.  ( Met `  X
) )
Distinct variable group:    x, y, X
Allowed substitution hints:    D( x, y)    V( x, y)

Proof of Theorem dscmet
Dummy variables  v  u  w are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 0re 8838 . . . . . 6  |-  0  e.  RR
2 1re 8837 . . . . . 6  |-  1  e.  RR
31, 2keepel 3622 . . . . 5  |-  if ( x  =  y ,  0 ,  1 )  e.  RR
43rgen2w 2611 . . . 4  |-  A. x  e.  X  A. y  e.  X  if (
x  =  y ,  0 ,  1 )  e.  RR
5 dscmet.1 . . . . 5  |-  D  =  ( x  e.  X ,  y  e.  X  |->  if ( x  =  y ,  0 ,  1 ) )
65fmpt2 6191 . . . 4  |-  ( A. x  e.  X  A. y  e.  X  if ( x  =  y ,  0 ,  1 )  e.  RR  <->  D :
( X  X.  X
) --> RR )
74, 6mpbi 199 . . 3  |-  D :
( X  X.  X
) --> RR
8 equequ1 1648 . . . . . . . . 9  |-  ( x  =  w  ->  (
x  =  y  <->  w  =  y ) )
98ifbid 3583 . . . . . . . 8  |-  ( x  =  w  ->  if ( x  =  y ,  0 ,  1 )  =  if ( w  =  y ,  0 ,  1 ) )
10 equequ2 1649 . . . . . . . . 9  |-  ( y  =  v  ->  (
w  =  y  <->  w  =  v ) )
1110ifbid 3583 . . . . . . . 8  |-  ( y  =  v  ->  if ( w  =  y ,  0 ,  1 )  =  if ( w  =  v ,  0 ,  1 ) )
12 0nn0 9980 . . . . . . . . . 10  |-  0  e.  NN0
13 1nn0 9981 . . . . . . . . . 10  |-  1  e.  NN0
1412, 13keepel 3622 . . . . . . . . 9  |-  if ( w  =  v ,  0 ,  1 )  e.  NN0
1514elexi 2797 . . . . . . . 8  |-  if ( w  =  v ,  0 ,  1 )  e.  _V
169, 11, 5, 15ovmpt2 5983 . . . . . . 7  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( w D v )  =  if ( w  =  v ,  0 ,  1 ) )
1716eqeq1d 2291 . . . . . 6  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( w D v )  =  0  <-> 
if ( w  =  v ,  0 ,  1 )  =  0 ) )
18 iffalse 3572 . . . . . . . . . 10  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =  1 )
19 ax-1ne0 8806 . . . . . . . . . . 11  |-  1  =/=  0
2019a1i 10 . . . . . . . . . 10  |-  ( -.  w  =  v  -> 
1  =/=  0 )
2118, 20eqnetrd 2464 . . . . . . . . 9  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =/=  0 )
2221neneqd 2462 . . . . . . . 8  |-  ( -.  w  =  v  ->  -.  if ( w  =  v ,  0 ,  1 )  =  0 )
2322con4i 122 . . . . . . 7  |-  ( if ( w  =  v ,  0 ,  1 )  =  0  ->  w  =  v )
24 iftrue 3571 . . . . . . 7  |-  ( w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =  0 )
2523, 24impbii 180 . . . . . 6  |-  ( if ( w  =  v ,  0 ,  1 )  =  0  <->  w  =  v )
2617, 25syl6bb 252 . . . . 5  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( w D v )  =  0  <-> 
w  =  v ) )
2712, 13keepel 3622 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  NN0
2812, 13keepel 3622 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  NN0
2927, 28nn0addcli 10001 . . . . . . . . . 10  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN0
30 elnn0 9967 . . . . . . . . . 10  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN0  <->  (
( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN  \/  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0 ) )
3129, 30mpbi 199 . . . . . . . . 9  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN  \/  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0 )
32 breq1 4026 . . . . . . . . . . . 12  |-  ( 0  =  if ( w  =  v ,  0 ,  1 )  -> 
( 0  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
33 breq1 4026 . . . . . . . . . . . 12  |-  ( 1  =  if ( w  =  v ,  0 ,  1 )  -> 
( 1  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
34 0le1 9297 . . . . . . . . . . . 12  |-  0  <_  1
352leidi 9307 . . . . . . . . . . . 12  |-  1  <_  1
3632, 33, 34, 35keephyp 3619 . . . . . . . . . . 11  |-  if ( w  =  v ,  0 ,  1 )  <_  1
37 nnge1 9772 . . . . . . . . . . 11  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN  ->  1  <_  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )
3814nn0rei 9976 . . . . . . . . . . . 12  |-  if ( w  =  v ,  0 ,  1 )  e.  RR
3929nn0rei 9976 . . . . . . . . . . . 12  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  RR
4038, 2, 39letri 8948 . . . . . . . . . . 11  |-  ( ( if ( w  =  v ,  0 ,  1 )  <_  1  /\  1  <_  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )  ->  if ( w  =  v ,  0 ,  1 )  <_  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )
4136, 37, 40sylancr 644 . . . . . . . . . 10  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN  ->  if ( w  =  v ,  0 ,  1 )  <_  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )
4227nn0ge0i 9993 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  w ,  0 ,  1 )
4328nn0ge0i 9993 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  v ,  0 ,  1 )
4427nn0rei 9976 . . . . . . . . . . . . . 14  |-  if ( u  =  w ,  0 ,  1 )  e.  RR
4528nn0rei 9976 . . . . . . . . . . . . . 14  |-  if ( u  =  v ,  0 ,  1 )  e.  RR
4644, 45add20i 9316 . . . . . . . . . . . . 13  |-  ( ( 0  <_  if (
u  =  w ,  0 ,  1 )  /\  0  <_  if ( u  =  v ,  0 ,  1 ) )  ->  (
( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0  <->  ( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 ) ) )
4742, 43, 46mp2an 653 . . . . . . . . . . . 12  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0  <-> 
( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 ) )
48 equequ2 1649 . . . . . . . . . . . . . . . . . . 19  |-  ( v  =  w  ->  (
u  =  v  <->  u  =  w ) )
4948ifbid 3583 . . . . . . . . . . . . . . . . . 18  |-  ( v  =  w  ->  if ( u  =  v ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
5049eqeq1d 2291 . . . . . . . . . . . . . . . . 17  |-  ( v  =  w  ->  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  if ( u  =  w ,  0 ,  1 )  =  0 ) )
5150, 48bibi12d 312 . . . . . . . . . . . . . . . 16  |-  ( v  =  w  ->  (
( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v
)  <->  ( if ( u  =  w ,  0 ,  1 )  =  0  <->  u  =  w ) ) )
52 equequ1 1648 . . . . . . . . . . . . . . . . . . . 20  |-  ( w  =  u  ->  (
w  =  v  <->  u  =  v ) )
5352ifbid 3583 . . . . . . . . . . . . . . . . . . 19  |-  ( w  =  u  ->  if ( w  =  v ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
5453eqeq1d 2291 . . . . . . . . . . . . . . . . . 18  |-  ( w  =  u  ->  ( if ( w  =  v ,  0 ,  1 )  =  0  <->  if ( u  =  v ,  0 ,  1 )  =  0 ) )
5554, 52bibi12d 312 . . . . . . . . . . . . . . . . 17  |-  ( w  =  u  ->  (
( if ( w  =  v ,  0 ,  1 )  =  0  <->  w  =  v
)  <->  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v ) ) )
5655, 25chvarv 1953 . . . . . . . . . . . . . . . 16  |-  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v )
5751, 56chvarv 1953 . . . . . . . . . . . . . . 15  |-  ( if ( u  =  w ,  0 ,  1 )  =  0  <->  u  =  w )
58 eqtr2 2301 . . . . . . . . . . . . . . 15  |-  ( ( u  =  w  /\  u  =  v )  ->  w  =  v )
5957, 56, 58syl2anb 465 . . . . . . . . . . . . . 14  |-  ( ( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 )  ->  w  =  v )
6059, 24syl 15 . . . . . . . . . . . . 13  |-  ( ( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 )  ->  if ( w  =  v ,  0 ,  1 )  =  0 )
611leidi 9307 . . . . . . . . . . . . 13  |-  0  <_  0
6260, 61syl6eqbr 4060 . . . . . . . . . . . 12  |-  ( ( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 )  ->  if ( w  =  v ,  0 ,  1 )  <_  0 )
6347, 62sylbi 187 . . . . . . . . . . 11  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0  ->  if ( w  =  v ,  0 ,  1 )  <_ 
0 )
64 id 19 . . . . . . . . . . 11  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0  ->  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0 )
6563, 64breqtrrd 4049 . . . . . . . . . 10  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0  ->  if ( w  =  v ,  0 ,  1 )  <_ 
( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )
6641, 65jaoi 368 . . . . . . . . 9  |-  ( ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN  \/  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0 )  ->  if ( w  =  v ,  0 ,  1 )  <_ 
( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )
6731, 66mp1i 11 . . . . . . . 8  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  if ( w  =  v ,  0 ,  1 )  <_  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )
6816adantl 452 . . . . . . . 8  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
w D v )  =  if ( w  =  v ,  0 ,  1 ) )
69 eqeq12 2295 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  w )  ->  ( x  =  y  <-> 
u  =  w ) )
7069ifbid 3583 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  w )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
7127elexi 2797 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  _V
7270, 5, 71ovmpt2a 5978 . . . . . . . . . 10  |-  ( ( u  e.  X  /\  w  e.  X )  ->  ( u D w )  =  if ( u  =  w ,  0 ,  1 ) )
7372adantrr 697 . . . . . . . . 9  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
u D w )  =  if ( u  =  w ,  0 ,  1 ) )
74 eqeq12 2295 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  v )  ->  ( x  =  y  <-> 
u  =  v ) )
7574ifbid 3583 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  v )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
7628elexi 2797 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  _V
7775, 5, 76ovmpt2a 5978 . . . . . . . . . 10  |-  ( ( u  e.  X  /\  v  e.  X )  ->  ( u D v )  =  if ( u  =  v ,  0 ,  1 ) )
7877adantrl 696 . . . . . . . . 9  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
u D v )  =  if ( u  =  v ,  0 ,  1 ) )
7973, 78oveq12d 5876 . . . . . . . 8  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
( u D w )  +  ( u D v ) )  =  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) ) )
8067, 68, 793brtr4d 4053 . . . . . . 7  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
w D v )  <_  ( ( u D w )  +  ( u D v ) ) )
8180expcom 424 . . . . . 6  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( u  e.  X  ->  ( w D v )  <_  ( (
u D w )  +  ( u D v ) ) ) )
8281ralrimiv 2625 . . . . 5  |-  ( ( w  e.  X  /\  v  e.  X )  ->  A. u  e.  X  ( w D v )  <_  ( (
u D w )  +  ( u D v ) ) )
8326, 82jca 518 . . . 4  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( ( w D v )  =  0  <->  w  =  v
)  /\  A. u  e.  X  ( w D v )  <_ 
( ( u D w )  +  ( u D v ) ) ) )
8483rgen2a 2609 . . 3  |-  A. w  e.  X  A. v  e.  X  ( (
( w D v )  =  0  <->  w  =  v )  /\  A. u  e.  X  ( w D v )  <_  ( ( u D w )  +  ( u D v ) ) )
857, 84pm3.2i 441 . 2  |-  ( D : ( X  X.  X ) --> RR  /\  A. w  e.  X  A. v  e.  X  (
( ( w D v )  =  0  <-> 
w  =  v )  /\  A. u  e.  X  ( w D v )  <_  (
( u D w )  +  ( u D v ) ) ) )
86 ismet 17888 . 2  |-  ( X  e.  V  ->  ( D  e.  ( Met `  X )  <->  ( D : ( X  X.  X ) --> RR  /\  A. w  e.  X  A. v  e.  X  (
( ( w D v )  =  0  <-> 
w  =  v )  /\  A. u  e.  X  ( w D v )  <_  (
( u D w )  +  ( u D v ) ) ) ) ) )
8785, 86mpbiri 224 1  |-  ( X  e.  V  ->  D  e.  ( Met `  X
) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 176    \/ wo 357    /\ wa 358    = wceq 1623    e. wcel 1684    =/= wne 2446   A.wral 2543   ifcif 3565   class class class wbr 4023    X. cxp 4687   -->wf 5251   ` cfv 5255  (class class class)co 5858    e. cmpt2 5860   RRcr 8736   0cc0 8737   1c1 8738    + caddc 8740    <_ cle 8868   NNcn 9746   NN0cn0 9965   Metcme 16370
This theorem is referenced by:  dscopn  18096
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-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  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-nel 2449  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-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  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  df-oprab 5862  df-mpt2 5863  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-er 6660  df-map 6774  df-en 6864  df-dom 6865  df-sdom 6866  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-nn 9747  df-n0 9966  df-met 16374
  Copyright terms: Public domain W3C validator