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

Theorem dscmet 18111
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 8854 . . . . . 6  |-  0  e.  RR
2 1re 8853 . . . . . 6  |-  1  e.  RR
31, 2keepel 3635 . . . . 5  |-  if ( x  =  y ,  0 ,  1 )  e.  RR
43rgen2w 2624 . . . 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 6207 . . . 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 1667 . . . . . . . . 9  |-  ( x  =  w  ->  (
x  =  y  <->  w  =  y ) )
98ifbid 3596 . . . . . . . 8  |-  ( x  =  w  ->  if ( x  =  y ,  0 ,  1 )  =  if ( w  =  y ,  0 ,  1 ) )
10 equequ2 1669 . . . . . . . . 9  |-  ( y  =  v  ->  (
w  =  y  <->  w  =  v ) )
1110ifbid 3596 . . . . . . . 8  |-  ( y  =  v  ->  if ( w  =  y ,  0 ,  1 )  =  if ( w  =  v ,  0 ,  1 ) )
12 0nn0 9996 . . . . . . . . . 10  |-  0  e.  NN0
13 1nn0 9997 . . . . . . . . . 10  |-  1  e.  NN0
1412, 13keepel 3635 . . . . . . . . 9  |-  if ( w  =  v ,  0 ,  1 )  e.  NN0
1514elexi 2810 . . . . . . . 8  |-  if ( w  =  v ,  0 ,  1 )  e.  _V
169, 11, 5, 15ovmpt2 5999 . . . . . . 7  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( w D v )  =  if ( w  =  v ,  0 ,  1 ) )
1716eqeq1d 2304 . . . . . 6  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( w D v )  =  0  <-> 
if ( w  =  v ,  0 ,  1 )  =  0 ) )
18 iffalse 3585 . . . . . . . . . 10  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =  1 )
19 ax-1ne0 8822 . . . . . . . . . . 11  |-  1  =/=  0
2019a1i 10 . . . . . . . . . 10  |-  ( -.  w  =  v  -> 
1  =/=  0 )
2118, 20eqnetrd 2477 . . . . . . . . 9  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =/=  0 )
2221neneqd 2475 . . . . . . . 8  |-  ( -.  w  =  v  ->  -.  if ( w  =  v ,  0 ,  1 )  =  0 )
2322con4i 122 . . . . . . 7  |-  ( if ( w  =  v ,  0 ,  1 )  =  0  ->  w  =  v )
24 iftrue 3584 . . . . . . 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 3635 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  NN0
2812, 13keepel 3635 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  NN0
2927, 28nn0addcli 10017 . . . . . . . . . 10  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN0
30 elnn0 9983 . . . . . . . . . 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 4042 . . . . . . . . . . . 12  |-  ( 0  =  if ( w  =  v ,  0 ,  1 )  -> 
( 0  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
33 breq1 4042 . . . . . . . . . . . 12  |-  ( 1  =  if ( w  =  v ,  0 ,  1 )  -> 
( 1  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
34 0le1 9313 . . . . . . . . . . . 12  |-  0  <_  1
352leidi 9323 . . . . . . . . . . . 12  |-  1  <_  1
3632, 33, 34, 35keephyp 3632 . . . . . . . . . . 11  |-  if ( w  =  v ,  0 ,  1 )  <_  1
37 nnge1 9788 . . . . . . . . . . 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 9992 . . . . . . . . . . . 12  |-  if ( w  =  v ,  0 ,  1 )  e.  RR
3929nn0rei 9992 . . . . . . . . . . . 12  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  RR
4038, 2, 39letri 8964 . . . . . . . . . . 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 10009 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  w ,  0 ,  1 )
4328nn0ge0i 10009 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  v ,  0 ,  1 )
4427nn0rei 9992 . . . . . . . . . . . . . 14  |-  if ( u  =  w ,  0 ,  1 )  e.  RR
4528nn0rei 9992 . . . . . . . . . . . . . 14  |-  if ( u  =  v ,  0 ,  1 )  e.  RR
4644, 45add20i 9332 . . . . . . . . . . . . 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 1669 . . . . . . . . . . . . . . . . . . 19  |-  ( v  =  w  ->  (
u  =  v  <->  u  =  w ) )
4948ifbid 3596 . . . . . . . . . . . . . . . . . 18  |-  ( v  =  w  ->  if ( u  =  v ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
5049eqeq1d 2304 . . . . . . . . . . . . . . . . 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 1667 . . . . . . . . . . . . . . . . . . . 20  |-  ( w  =  u  ->  (
w  =  v  <->  u  =  v ) )
5352ifbid 3596 . . . . . . . . . . . . . . . . . . 19  |-  ( w  =  u  ->  if ( w  =  v ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
5453eqeq1d 2304 . . . . . . . . . . . . . . . . . 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 1966 . . . . . . . . . . . . . . . 16  |-  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v )
5751, 56chvarv 1966 . . . . . . . . . . . . . . 15  |-  ( if ( u  =  w ,  0 ,  1 )  =  0  <->  u  =  w )
58 eqtr2 2314 . . . . . . . . . . . . . . 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 9323 . . . . . . . . . . . . 13  |-  0  <_  0
6260, 61syl6eqbr 4076 . . . . . . . . . . . 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 4065 . . . . . . . . . 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 2308 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  w )  ->  ( x  =  y  <-> 
u  =  w ) )
7069ifbid 3596 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  w )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
7127elexi 2810 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  _V
7270, 5, 71ovmpt2a 5994 . . . . . . . . . 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 2308 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  v )  ->  ( x  =  y  <-> 
u  =  v ) )
7574ifbid 3596 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  v )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
7628elexi 2810 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  _V
7775, 5, 76ovmpt2a 5994 . . . . . . . . . 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 5892 . . . . . . . 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 4069 . . . . . . 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 2638 . . . . 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 2622 . . 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 17904 . 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 1632    e. wcel 1696    =/= wne 2459   A.wral 2556   ifcif 3578   class class class wbr 4039    X. cxp 4703   -->wf 5267   ` cfv 5271  (class class class)co 5874    e. cmpt2 5876   RRcr 8752   0cc0 8753   1c1 8754    + caddc 8756    <_ cle 8884   NNcn 9762   NN0cn0 9981   Metcme 16386
This theorem is referenced by:  dscopn  18112
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528  ax-cnex 8809  ax-resscn 8810  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-addrcl 8814  ax-mulcl 8815  ax-mulrcl 8816  ax-mulcom 8817  ax-addass 8818  ax-mulass 8819  ax-distr 8820  ax-i2m1 8821  ax-1ne0 8822  ax-1rid 8823  ax-rnegex 8824  ax-rrecex 8825  ax-cnre 8826  ax-pre-lttri 8827  ax-pre-lttrn 8828  ax-pre-ltadd 8829  ax-pre-mulgt0 8830
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 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-nel 2462  df-ral 2561  df-rex 2562  df-reu 2563  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-pss 3181  df-nul 3469  df-if 3579  df-pw 3640  df-sn 3659  df-pr 3660  df-tp 3661  df-op 3662  df-uni 3844  df-iun 3923  df-br 4040  df-opab 4094  df-mpt 4095  df-tr 4130  df-eprel 4321  df-id 4325  df-po 4330  df-so 4331  df-fr 4368  df-we 4370  df-ord 4411  df-on 4412  df-lim 4413  df-suc 4414  df-om 4673  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-1st 6138  df-2nd 6139  df-riota 6320  df-recs 6404  df-rdg 6439  df-er 6676  df-map 6790  df-en 6880  df-dom 6881  df-sdom 6882  df-pnf 8885  df-mnf 8886  df-xr 8887  df-ltxr 8888  df-le 8889  df-sub 9055  df-neg 9056  df-nn 9763  df-n0 9982  df-met 16390
  Copyright terms: Public domain W3C validator