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

Theorem dscmet 18097
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 8840 . . . . . 6  |-  0  e.  RR
2 1re 8839 . . . . . 6  |-  1  e.  RR
31, 2keepel 3624 . . . . 5  |-  if ( x  =  y ,  0 ,  1 )  e.  RR
43rgen2w 2613 . . . 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 6193 . . . 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 1650 . . . . . . . . 9  |-  ( x  =  w  ->  (
x  =  y  <->  w  =  y ) )
98ifbid 3585 . . . . . . . 8  |-  ( x  =  w  ->  if ( x  =  y ,  0 ,  1 )  =  if ( w  =  y ,  0 ,  1 ) )
10 equequ2 1651 . . . . . . . . 9  |-  ( y  =  v  ->  (
w  =  y  <->  w  =  v ) )
1110ifbid 3585 . . . . . . . 8  |-  ( y  =  v  ->  if ( w  =  y ,  0 ,  1 )  =  if ( w  =  v ,  0 ,  1 ) )
12 0nn0 9982 . . . . . . . . . 10  |-  0  e.  NN0
13 1nn0 9983 . . . . . . . . . 10  |-  1  e.  NN0
1412, 13keepel 3624 . . . . . . . . 9  |-  if ( w  =  v ,  0 ,  1 )  e.  NN0
1514elexi 2799 . . . . . . . 8  |-  if ( w  =  v ,  0 ,  1 )  e.  _V
169, 11, 5, 15ovmpt2 5985 . . . . . . 7  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( w D v )  =  if ( w  =  v ,  0 ,  1 ) )
1716eqeq1d 2293 . . . . . 6  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( w D v )  =  0  <-> 
if ( w  =  v ,  0 ,  1 )  =  0 ) )
18 iffalse 3574 . . . . . . . . . 10  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =  1 )
19 ax-1ne0 8808 . . . . . . . . . . 11  |-  1  =/=  0
2019a1i 10 . . . . . . . . . 10  |-  ( -.  w  =  v  -> 
1  =/=  0 )
2118, 20eqnetrd 2466 . . . . . . . . 9  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =/=  0 )
2221neneqd 2464 . . . . . . . 8  |-  ( -.  w  =  v  ->  -.  if ( w  =  v ,  0 ,  1 )  =  0 )
2322con4i 122 . . . . . . 7  |-  ( if ( w  =  v ,  0 ,  1 )  =  0  ->  w  =  v )
24 iftrue 3573 . . . . . . 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 3624 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  NN0
2812, 13keepel 3624 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  NN0
2927, 28nn0addcli 10003 . . . . . . . . . 10  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN0
30 elnn0 9969 . . . . . . . . . 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 4028 . . . . . . . . . . . 12  |-  ( 0  =  if ( w  =  v ,  0 ,  1 )  -> 
( 0  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
33 breq1 4028 . . . . . . . . . . . 12  |-  ( 1  =  if ( w  =  v ,  0 ,  1 )  -> 
( 1  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
34 0le1 9299 . . . . . . . . . . . 12  |-  0  <_  1
352leidi 9309 . . . . . . . . . . . 12  |-  1  <_  1
3632, 33, 34, 35keephyp 3621 . . . . . . . . . . 11  |-  if ( w  =  v ,  0 ,  1 )  <_  1
37 nnge1 9774 . . . . . . . . . . 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 9978 . . . . . . . . . . . 12  |-  if ( w  =  v ,  0 ,  1 )  e.  RR
3929nn0rei 9978 . . . . . . . . . . . 12  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  RR
4038, 2, 39letri 8950 . . . . . . . . . . 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 9995 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  w ,  0 ,  1 )
4328nn0ge0i 9995 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  v ,  0 ,  1 )
4427nn0rei 9978 . . . . . . . . . . . . . 14  |-  if ( u  =  w ,  0 ,  1 )  e.  RR
4528nn0rei 9978 . . . . . . . . . . . . . 14  |-  if ( u  =  v ,  0 ,  1 )  e.  RR
4644, 45add20i 9318 . . . . . . . . . . . . 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 1651 . . . . . . . . . . . . . . . . . . 19  |-  ( v  =  w  ->  (
u  =  v  <->  u  =  w ) )
4948ifbid 3585 . . . . . . . . . . . . . . . . . 18  |-  ( v  =  w  ->  if ( u  =  v ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
5049eqeq1d 2293 . . . . . . . . . . . . . . . . 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 1650 . . . . . . . . . . . . . . . . . . . 20  |-  ( w  =  u  ->  (
w  =  v  <->  u  =  v ) )
5352ifbid 3585 . . . . . . . . . . . . . . . . . . 19  |-  ( w  =  u  ->  if ( w  =  v ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
5453eqeq1d 2293 . . . . . . . . . . . . . . . . . 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 1955 . . . . . . . . . . . . . . . 16  |-  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v )
5751, 56chvarv 1955 . . . . . . . . . . . . . . 15  |-  ( if ( u  =  w ,  0 ,  1 )  =  0  <->  u  =  w )
58 eqtr2 2303 . . . . . . . . . . . . . . 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 9309 . . . . . . . . . . . . 13  |-  0  <_  0
6260, 61syl6eqbr 4062 . . . . . . . . . . . 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 4051 . . . . . . . . . 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 2297 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  w )  ->  ( x  =  y  <-> 
u  =  w ) )
7069ifbid 3585 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  w )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
7127elexi 2799 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  _V
7270, 5, 71ovmpt2a 5980 . . . . . . . . . 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 2297 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  v )  ->  ( x  =  y  <-> 
u  =  v ) )
7574ifbid 3585 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  v )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
7628elexi 2799 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  _V
7775, 5, 76ovmpt2a 5980 . . . . . . . . . 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 5878 . . . . . . . 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 4055 . . . . . . 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 2627 . . . . 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 2611 . . 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 17890 . 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 1625    e. wcel 1686    =/= wne 2448   A.wral 2545   ifcif 3567   class class class wbr 4025    X. cxp 4689   -->wf 5253   ` cfv 5257  (class class class)co 5860    e. cmpt2 5862   RRcr 8738   0cc0 8739   1c1 8740    + caddc 8742    <_ cle 8870   NNcn 9748   NN0cn0 9967   Metcme 16372
This theorem is referenced by:  dscopn  18098
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1535  ax-5 1546  ax-17 1605  ax-9 1637  ax-8 1645  ax-13 1688  ax-14 1690  ax-6 1705  ax-7 1710  ax-11 1717  ax-12 1868  ax-ext 2266  ax-sep 4143  ax-nul 4151  ax-pow 4190  ax-pr 4216  ax-un 4514  ax-cnex 8795  ax-resscn 8796  ax-1cn 8797  ax-icn 8798  ax-addcl 8799  ax-addrcl 8800  ax-mulcl 8801  ax-mulrcl 8802  ax-mulcom 8803  ax-addass 8804  ax-mulass 8805  ax-distr 8806  ax-i2m1 8807  ax-1ne0 8808  ax-1rid 8809  ax-rnegex 8810  ax-rrecex 8811  ax-cnre 8812  ax-pre-lttri 8813  ax-pre-lttrn 8814  ax-pre-ltadd 8815  ax-pre-mulgt0 8816
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 1531  df-nf 1534  df-sb 1632  df-eu 2149  df-mo 2150  df-clab 2272  df-cleq 2278  df-clel 2281  df-nfc 2410  df-ne 2450  df-nel 2451  df-ral 2550  df-rex 2551  df-reu 2552  df-rab 2554  df-v 2792  df-sbc 2994  df-csb 3084  df-dif 3157  df-un 3159  df-in 3161  df-ss 3168  df-pss 3170  df-nul 3458  df-if 3568  df-pw 3629  df-sn 3648  df-pr 3649  df-tp 3650  df-op 3651  df-uni 3830  df-iun 3909  df-br 4026  df-opab 4080  df-mpt 4081  df-tr 4116  df-eprel 4307  df-id 4311  df-po 4316  df-so 4317  df-fr 4354  df-we 4356  df-ord 4397  df-on 4398  df-lim 4399  df-suc 4400  df-om 4659  df-xp 4697  df-rel 4698  df-cnv 4699  df-co 4700  df-dm 4701  df-rn 4702  df-res 4703  df-ima 4704  df-iota 5221  df-fun 5259  df-fn 5260  df-f 5261  df-f1 5262  df-fo 5263  df-f1o 5264  df-fv 5265  df-ov 5863  df-oprab 5864  df-mpt2 5865  df-1st 6124  df-2nd 6125  df-riota 6306  df-recs 6390  df-rdg 6425  df-er 6662  df-map 6776  df-en 6866  df-dom 6867  df-sdom 6868  df-pnf 8871  df-mnf 8872  df-xr 8873  df-ltxr 8874  df-le 8875  df-sub 9041  df-neg 9042  df-nn 9749  df-n0 9968  df-met 16376
  Copyright terms: Public domain W3C validator