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

Theorem dscmet 18091
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 8834 . . . . . 6  |-  0  e.  RR
2 1re 8833 . . . . . 6  |-  1  e.  RR
31, 2keepel 3623 . . . . 5  |-  if ( x  =  y ,  0 ,  1 )  e.  RR
43rgen2w 2612 . . . 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 6153 . . . 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 1649 . . . . . . . . 9  |-  ( x  =  w  ->  (
x  =  y  <->  w  =  y ) )
98ifbid 3584 . . . . . . . 8  |-  ( x  =  w  ->  if ( x  =  y ,  0 ,  1 )  =  if ( w  =  y ,  0 ,  1 ) )
10 equequ2 1650 . . . . . . . . 9  |-  ( y  =  v  ->  (
w  =  y  <->  w  =  v ) )
1110ifbid 3584 . . . . . . . 8  |-  ( y  =  v  ->  if ( w  =  y ,  0 ,  1 )  =  if ( w  =  v ,  0 ,  1 ) )
12 0nn0 9976 . . . . . . . . . 10  |-  0  e.  NN0
13 1nn0 9977 . . . . . . . . . 10  |-  1  e.  NN0
1412, 13keepel 3623 . . . . . . . . 9  |-  if ( w  =  v ,  0 ,  1 )  e.  NN0
1514elexi 2798 . . . . . . . 8  |-  if ( w  =  v ,  0 ,  1 )  e.  _V
169, 11, 5, 15ovmpt2 5945 . . . . . . 7  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( w D v )  =  if ( w  =  v ,  0 ,  1 ) )
1716eqeq1d 2292 . . . . . 6  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( w D v )  =  0  <-> 
if ( w  =  v ,  0 ,  1 )  =  0 ) )
18 iffalse 3573 . . . . . . . . . 10  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =  1 )
19 ax-1ne0 8802 . . . . . . . . . . 11  |-  1  =/=  0
2019a1i 10 . . . . . . . . . 10  |-  ( -.  w  =  v  -> 
1  =/=  0 )
2118, 20eqnetrd 2465 . . . . . . . . 9  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =/=  0 )
2221neneqd 2463 . . . . . . . 8  |-  ( -.  w  =  v  ->  -.  if ( w  =  v ,  0 ,  1 )  =  0 )
2322con4i 122 . . . . . . 7  |-  ( if ( w  =  v ,  0 ,  1 )  =  0  ->  w  =  v )
24 iftrue 3572 . . . . . . 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 3623 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  NN0
2812, 13keepel 3623 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  NN0
2927, 28nn0addcli 9997 . . . . . . . . . 10  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN0
30 elnn0 9963 . . . . . . . . . 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 4027 . . . . . . . . . . . 12  |-  ( 0  =  if ( w  =  v ,  0 ,  1 )  -> 
( 0  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
33 breq1 4027 . . . . . . . . . . . 12  |-  ( 1  =  if ( w  =  v ,  0 ,  1 )  -> 
( 1  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
34 0le1 9293 . . . . . . . . . . . 12  |-  0  <_  1
352leidi 9303 . . . . . . . . . . . 12  |-  1  <_  1
3632, 33, 34, 35keephyp 3620 . . . . . . . . . . 11  |-  if ( w  =  v ,  0 ,  1 )  <_  1
37 nnge1 9768 . . . . . . . . . . 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 9972 . . . . . . . . . . . 12  |-  if ( w  =  v ,  0 ,  1 )  e.  RR
3929nn0rei 9972 . . . . . . . . . . . 12  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  RR
4038, 2, 39letri 8944 . . . . . . . . . . 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 9989 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  w ,  0 ,  1 )
4328nn0ge0i 9989 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  v ,  0 ,  1 )
4427nn0rei 9972 . . . . . . . . . . . . . 14  |-  if ( u  =  w ,  0 ,  1 )  e.  RR
4528nn0rei 9972 . . . . . . . . . . . . . 14  |-  if ( u  =  v ,  0 ,  1 )  e.  RR
4644, 45add20i 9312 . . . . . . . . . . . . 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 1650 . . . . . . . . . . . . . . . . . . 19  |-  ( v  =  w  ->  (
u  =  v  <->  u  =  w ) )
4948ifbid 3584 . . . . . . . . . . . . . . . . . 18  |-  ( v  =  w  ->  if ( u  =  v ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
5049eqeq1d 2292 . . . . . . . . . . . . . . . . 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 1649 . . . . . . . . . . . . . . . . . . . 20  |-  ( w  =  u  ->  (
w  =  v  <->  u  =  v ) )
5352ifbid 3584 . . . . . . . . . . . . . . . . . . 19  |-  ( w  =  u  ->  if ( w  =  v ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
5453eqeq1d 2292 . . . . . . . . . . . . . . . . . 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 1958 . . . . . . . . . . . . . . . 16  |-  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v )
5751, 56chvarv 1958 . . . . . . . . . . . . . . 15  |-  ( if ( u  =  w ,  0 ,  1 )  =  0  <->  u  =  w )
58 eqtr2 2302 . . . . . . . . . . . . . . 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 9303 . . . . . . . . . . . . 13  |-  0  <_  0
6260, 61syl6eqbr 4061 . . . . . . . . . . . 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 4050 . . . . . . . . . 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 2296 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  w )  ->  ( x  =  y  <-> 
u  =  w ) )
7069ifbid 3584 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  w )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
7127elexi 2798 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  _V
7270, 5, 71ovmpt2a 5940 . . . . . . . . . 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 2296 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  v )  ->  ( x  =  y  <-> 
u  =  v ) )
7574ifbid 3584 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  v )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
7628elexi 2798 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  _V
7775, 5, 76ovmpt2a 5940 . . . . . . . . . 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 5838 . . . . . . . 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 4054 . . . . . . 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 2626 . . . . 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 2610 . . 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 17884 . 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 1685    =/= wne 2447   A.wral 2544   ifcif 3566   class class class wbr 4024    X. cxp 4686   -->wf 5217   ` cfv 5221  (class class class)co 5820    e. cmpt2 5822   RRcr 8732   0cc0 8733   1c1 8734    + caddc 8736    <_ cle 8864   NNcn 9742   NN0cn0 9961   Metcme 16366
This theorem is referenced by:  dscopn  18092
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 1636  ax-8 1644  ax-13 1687  ax-14 1689  ax-6 1704  ax-7 1709  ax-11 1716  ax-12 1868  ax-ext 2265  ax-sep 4142  ax-nul 4150  ax-pow 4187  ax-pr 4213  ax-un 4511  ax-cnex 8789  ax-resscn 8790  ax-1cn 8791  ax-icn 8792  ax-addcl 8793  ax-addrcl 8794  ax-mulcl 8795  ax-mulrcl 8796  ax-mulcom 8797  ax-addass 8798  ax-mulass 8799  ax-distr 8800  ax-i2m1 8801  ax-1ne0 8802  ax-1rid 8803  ax-rnegex 8804  ax-rrecex 8805  ax-cnre 8806  ax-pre-lttri 8807  ax-pre-lttrn 8808  ax-pre-ltadd 8809  ax-pre-mulgt0 8810
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 1631  df-eu 2148  df-mo 2149  df-clab 2271  df-cleq 2277  df-clel 2280  df-nfc 2409  df-ne 2449  df-nel 2450  df-ral 2549  df-rex 2550  df-reu 2551  df-rab 2553  df-v 2791  df-sbc 2993  df-csb 3083  df-dif 3156  df-un 3158  df-in 3160  df-ss 3167  df-pss 3169  df-nul 3457  df-if 3567  df-pw 3628  df-sn 3647  df-pr 3648  df-tp 3649  df-op 3650  df-uni 3829  df-iun 3908  df-br 4025  df-opab 4079  df-mpt 4080  df-tr 4115  df-eprel 4304  df-id 4308  df-po 4313  df-so 4314  df-fr 4351  df-we 4353  df-ord 4394  df-on 4395  df-lim 4396  df-suc 4397  df-om 4656  df-xp 4694  df-rel 4695  df-cnv 4696  df-co 4697  df-dm 4698  df-rn 4699  df-res 4700  df-ima 4701  df-fun 5223  df-fn 5224  df-f 5225  df-f1 5226  df-fo 5227  df-f1o 5228  df-fv 5229  df-ov 5823  df-oprab 5824  df-mpt2 5825  df-1st 6084  df-2nd 6085  df-iota 6253  df-riota 6300  df-recs 6384  df-rdg 6419  df-er 6656  df-map 6770  df-en 6860  df-dom 6861  df-sdom 6862  df-pnf 8865  df-mnf 8866  df-xr 8867  df-ltxr 8868  df-le 8869  df-sub 9035  df-neg 9036  df-nn 9743  df-n0 9962  df-met 16370
  Copyright terms: Public domain W3C validator