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

Theorem dscmet 17927
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
StepHypRef Expression
1 0re 8718 . . . . . 6  |-  0  e.  RR
2 1re 8717 . . . . . 6  |-  1  e.  RR
31, 2keepel 3527 . . . . 5  |-  if ( x  =  y ,  0 ,  1 )  e.  RR
43rgen2w 2573 . . . 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 6043 . . . 4  |-  ( A. x  e.  X  A. y  e.  X  if ( x  =  y ,  0 ,  1 )  e.  RR  <->  D :
( X  X.  X
) --> RR )
74, 6mpbi 201 . . 3  |-  D :
( X  X.  X
) --> RR
8 equequ1 1829 . . . . . . . . 9  |-  ( x  =  w  ->  (
x  =  y  <->  w  =  y ) )
98ifbid 3488 . . . . . . . 8  |-  ( x  =  w  ->  if ( x  =  y ,  0 ,  1 )  =  if ( w  =  y ,  0 ,  1 ) )
10 equequ2 1830 . . . . . . . . 9  |-  ( y  =  v  ->  (
w  =  y  <->  w  =  v ) )
1110ifbid 3488 . . . . . . . 8  |-  ( y  =  v  ->  if ( w  =  y ,  0 ,  1 )  =  if ( w  =  v ,  0 ,  1 ) )
12 0nn0 9859 . . . . . . . . . 10  |-  0  e.  NN0
13 1nn0 9860 . . . . . . . . . 10  |-  1  e.  NN0
1412, 13keepel 3527 . . . . . . . . 9  |-  if ( w  =  v ,  0 ,  1 )  e.  NN0
1514elexi 2736 . . . . . . . 8  |-  if ( w  =  v ,  0 ,  1 )  e.  _V
169, 11, 5, 15ovmpt2 5835 . . . . . . 7  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( w D v )  =  if ( w  =  v ,  0 ,  1 ) )
1716eqeq1d 2261 . . . . . 6  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( w D v )  =  0  <-> 
if ( w  =  v ,  0 ,  1 )  =  0 ) )
18 iffalse 3477 . . . . . . . . . 10  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =  1 )
19 ax-1ne0 8686 . . . . . . . . . . 11  |-  1  =/=  0
2019a1i 12 . . . . . . . . . 10  |-  ( -.  w  =  v  -> 
1  =/=  0 )
2118, 20eqnetrd 2430 . . . . . . . . 9  |-  ( -.  w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =/=  0 )
2221neneqd 2428 . . . . . . . 8  |-  ( -.  w  =  v  ->  -.  if ( w  =  v ,  0 ,  1 )  =  0 )
2322con4i 124 . . . . . . 7  |-  ( if ( w  =  v ,  0 ,  1 )  =  0  ->  w  =  v )
24 iftrue 3476 . . . . . . 7  |-  ( w  =  v  ->  if ( w  =  v ,  0 ,  1 )  =  0 )
2523, 24impbii 182 . . . . . 6  |-  ( if ( w  =  v ,  0 ,  1 )  =  0  <->  w  =  v )
2617, 25syl6bb 254 . . . . 5  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( ( w D v )  =  0  <-> 
w  =  v ) )
2712, 13keepel 3527 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  NN0
2812, 13keepel 3527 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  NN0
2927, 28nn0addcli 9880 . . . . . . . . . 10  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  NN0
30 elnn0 9846 . . . . . . . . . 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 201 . . . . . . . . 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 3923 . . . . . . . . . . . 12  |-  ( 0  =  if ( w  =  v ,  0 ,  1 )  -> 
( 0  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
33 breq1 3923 . . . . . . . . . . . 12  |-  ( 1  =  if ( w  =  v ,  0 ,  1 )  -> 
( 1  <_  1  <->  if ( w  =  v ,  0 ,  1 )  <_  1 ) )
34 0le1 9177 . . . . . . . . . . . 12  |-  0  <_  1
352leidi 9187 . . . . . . . . . . . 12  |-  1  <_  1
3632, 33, 34, 35keephyp 3524 . . . . . . . . . . 11  |-  if ( w  =  v ,  0 ,  1 )  <_  1
37 nnge1 9652 . . . . . . . . . . 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 9855 . . . . . . . . . . . 12  |-  if ( w  =  v ,  0 ,  1 )  e.  RR
3929nn0rei 9855 . . . . . . . . . . . 12  |-  ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  e.  RR
4038, 2, 39letri 8828 . . . . . . . . . . 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 647 . . . . . . . . . 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 9872 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  w ,  0 ,  1 )
4328nn0ge0i 9872 . . . . . . . . . . . . 13  |-  0  <_  if ( u  =  v ,  0 ,  1 )
4427nn0rei 9855 . . . . . . . . . . . . . 14  |-  if ( u  =  w ,  0 ,  1 )  e.  RR
4528nn0rei 9855 . . . . . . . . . . . . . 14  |-  if ( u  =  v ,  0 ,  1 )  e.  RR
4644, 45add20i 9196 . . . . . . . . . . . . 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 656 . . . . . . . . . . . 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 1830 . . . . . . . . . . . . . . . . . . 19  |-  ( v  =  w  ->  (
u  =  v  <->  u  =  w ) )
4948ifbid 3488 . . . . . . . . . . . . . . . . . 18  |-  ( v  =  w  ->  if ( u  =  v ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
5049eqeq1d 2261 . . . . . . . . . . . . . . . . 17  |-  ( v  =  w  ->  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  if ( u  =  w ,  0 ,  1 )  =  0 ) )
5150, 48bibi12d 314 . . . . . . . . . . . . . . . 16  |-  ( v  =  w  ->  (
( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v
)  <->  ( if ( u  =  w ,  0 ,  1 )  =  0  <->  u  =  w ) ) )
52 equequ1 1829 . . . . . . . . . . . . . . . . . . . 20  |-  ( w  =  u  ->  (
w  =  v  <->  u  =  v ) )
5352ifbid 3488 . . . . . . . . . . . . . . . . . . 19  |-  ( w  =  u  ->  if ( w  =  v ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
5453eqeq1d 2261 . . . . . . . . . . . . . . . . . 18  |-  ( w  =  u  ->  ( if ( w  =  v ,  0 ,  1 )  =  0  <->  if ( u  =  v ,  0 ,  1 )  =  0 ) )
5554, 52bibi12d 314 . . . . . . . . . . . . . . . . 17  |-  ( w  =  u  ->  (
( if ( w  =  v ,  0 ,  1 )  =  0  <->  w  =  v
)  <->  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v ) ) )
5655, 25chvarv 2059 . . . . . . . . . . . . . . . 16  |-  ( if ( u  =  v ,  0 ,  1 )  =  0  <->  u  =  v )
5751, 56chvarv 2059 . . . . . . . . . . . . . . 15  |-  ( if ( u  =  w ,  0 ,  1 )  =  0  <->  u  =  w )
58 eqtr2 2271 . . . . . . . . . . . . . . 15  |-  ( ( u  =  w  /\  u  =  v )  ->  w  =  v )
5957, 56, 58syl2anb 467 . . . . . . . . . . . . . 14  |-  ( ( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 )  ->  w  =  v )
6059, 24syl 17 . . . . . . . . . . . . 13  |-  ( ( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 )  ->  if ( w  =  v ,  0 ,  1 )  =  0 )
611leidi 9187 . . . . . . . . . . . . 13  |-  0  <_  0
6260, 61syl6eqbr 3957 . . . . . . . . . . . 12  |-  ( ( if ( u  =  w ,  0 ,  1 )  =  0  /\  if ( u  =  v ,  0 ,  1 )  =  0 )  ->  if ( w  =  v ,  0 ,  1 )  <_  0 )
6347, 62sylbi 189 . . . . . . . . . . 11  |-  ( ( if ( u  =  w ,  0 ,  1 )  +  if ( u  =  v ,  0 ,  1 ) )  =  0  ->  if ( w  =  v ,  0 ,  1 )  <_ 
0 )
64 id 21 . . . . . . . . . . 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 3946 . . . . . . . . . 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 370 . . . . . . . . 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 13 . . . . . . . 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 454 . . . . . . . 8  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
w D v )  =  if ( w  =  v ,  0 ,  1 ) )
69 eqeq12 2265 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  w )  ->  ( x  =  y  <-> 
u  =  w ) )
7069ifbid 3488 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  w )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  w ,  0 ,  1 ) )
7127elexi 2736 . . . . . . . . . . 11  |-  if ( u  =  w ,  0 ,  1 )  e.  _V
7270, 5, 71ovmpt2a 5830 . . . . . . . . . 10  |-  ( ( u  e.  X  /\  w  e.  X )  ->  ( u D w )  =  if ( u  =  w ,  0 ,  1 ) )
7372adantrr 700 . . . . . . . . 9  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
u D w )  =  if ( u  =  w ,  0 ,  1 ) )
74 eqeq12 2265 . . . . . . . . . . . 12  |-  ( ( x  =  u  /\  y  =  v )  ->  ( x  =  y  <-> 
u  =  v ) )
7574ifbid 3488 . . . . . . . . . . 11  |-  ( ( x  =  u  /\  y  =  v )  ->  if ( x  =  y ,  0 ,  1 )  =  if ( u  =  v ,  0 ,  1 ) )
7628elexi 2736 . . . . . . . . . . 11  |-  if ( u  =  v ,  0 ,  1 )  e.  _V
7775, 5, 76ovmpt2a 5830 . . . . . . . . . 10  |-  ( ( u  e.  X  /\  v  e.  X )  ->  ( u D v )  =  if ( u  =  v ,  0 ,  1 ) )
7877adantrl 699 . . . . . . . . 9  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
u D v )  =  if ( u  =  v ,  0 ,  1 ) )
7973, 78oveq12d 5728 . . . . . . . 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 3950 . . . . . . 7  |-  ( ( u  e.  X  /\  ( w  e.  X  /\  v  e.  X
) )  ->  (
w D v )  <_  ( ( u D w )  +  ( u D v ) ) )
8180expcom 426 . . . . . 6  |-  ( ( w  e.  X  /\  v  e.  X )  ->  ( u  e.  X  ->  ( w D v )  <_  ( (
u D w )  +  ( u D v ) ) ) )
8281ralrimiv 2587 . . . . 5  |-  ( ( w  e.  X  /\  v  e.  X )  ->  A. u  e.  X  ( w D v )  <_  ( (
u D w )  +  ( u D v ) ) )
8326, 82jca 520 . . . 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 2571 . . 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 443 . 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 17720 . 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 226 1  |-  ( X  e.  V  ->  D  e.  ( Met `  X
) )
Colors of variables: wff set class
Syntax hints:   -. wn 5    -> wi 6    <-> wb 178    \/ wo 359    /\ wa 360    = wceq 1619    e. wcel 1621    =/= wne 2412   A.wral 2509   ifcif 3470   class class class wbr 3920    X. cxp 4578   -->wf 4588   ` cfv 4592  (class class class)co 5710    e. cmpt2 5712   RRcr 8616   0cc0 8617   1c1 8618    + caddc 8620    <_ cle 8748   NNcn 9626   NN0cn0 9844   Metcme 16202
This theorem is referenced by:  dscopn  17928
This theorem was proved from axioms:  ax-1 7  ax-2 8  ax-3 9  ax-mp 10  ax-5 1533  ax-6 1534  ax-7 1535  ax-gen 1536  ax-8 1623  ax-11 1624  ax-13 1625  ax-14 1626  ax-17 1628  ax-12o 1664  ax-10 1678  ax-9 1684  ax-4 1692  ax-16 1926  ax-ext 2234  ax-sep 4038  ax-nul 4046  ax-pow 4082  ax-pr 4108  ax-un 4403  ax-cnex 8673  ax-resscn 8674  ax-1cn 8675  ax-icn 8676  ax-addcl 8677  ax-addrcl 8678  ax-mulcl 8679  ax-mulrcl 8680  ax-mulcom 8681  ax-addass 8682  ax-mulass 8683  ax-distr 8684  ax-i2m1 8685  ax-1ne0 8686  ax-1rid 8687  ax-rnegex 8688  ax-rrecex 8689  ax-cnre 8690  ax-pre-lttri 8691  ax-pre-lttrn 8692  ax-pre-ltadd 8693  ax-pre-mulgt0 8694
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 940  df-3an 941  df-tru 1315  df-ex 1538  df-nf 1540  df-sb 1883  df-eu 2118  df-mo 2119  df-clab 2240  df-cleq 2246  df-clel 2249  df-nfc 2374  df-ne 2414  df-nel 2415  df-ral 2513  df-rex 2514  df-reu 2515  df-rab 2516  df-v 2729  df-sbc 2922  df-csb 3010  df-dif 3081  df-un 3083  df-in 3085  df-ss 3089  df-pss 3091  df-nul 3363  df-if 3471  df-pw 3532  df-sn 3550  df-pr 3551  df-tp 3552  df-op 3553  df-uni 3728  df-iun 3805  df-br 3921  df-opab 3975  df-mpt 3976  df-tr 4011  df-eprel 4198  df-id 4202  df-po 4207  df-so 4208  df-fr 4245  df-we 4247  df-ord 4288  df-on 4289  df-lim 4290  df-suc 4291  df-om 4548  df-xp 4594  df-rel 4595  df-cnv 4596  df-co 4597  df-dm 4598  df-rn 4599  df-res 4600  df-ima 4601  df-fun 4602  df-fn 4603  df-f 4604  df-f1 4605  df-fo 4606  df-f1o 4607  df-fv 4608  df-ov 5713  df-oprab 5714  df-mpt2 5715  df-1st 5974  df-2nd 5975  df-iota 6143  df-riota 6190  df-recs 6274  df-rdg 6309  df-er 6546  df-map 6660  df-en 6750  df-dom 6751  df-sdom 6752  df-pnf 8749  df-mnf 8750  df-xr 8751  df-ltxr 8752  df-le 8753  df-sub 8919  df-neg 8920  df-n 9627  df-n0 9845  df-met 16206
  Copyright terms: Public domain W3C validator