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

Theorem dscmet 23634
Description: The discrete metric on any set 𝑋. Definition 1.1-8 of [Kreyszig] p. 8. (Contributed by FL, 12-Oct-2006.)
Hypothesis
Ref Expression
dscmet.1 𝐷 = (𝑥𝑋, 𝑦𝑋 ↦ if(𝑥 = 𝑦, 0, 1))
Assertion
Ref Expression
dscmet (𝑋𝑉𝐷 ∈ (Met‘𝑋))
Distinct variable group:   𝑥,𝑦,𝑋
Allowed substitution hints:   𝐷(𝑥,𝑦)   𝑉(𝑥,𝑦)

Proof of Theorem dscmet
Dummy variables 𝑣 𝑢 𝑤 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 0re 10908 . . . . . 6 0 ∈ ℝ
2 1re 10906 . . . . . 6 1 ∈ ℝ
31, 2ifcli 4503 . . . . 5 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
43rgen2w 3076 . . . 4 𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
5 dscmet.1 . . . . 5 𝐷 = (𝑥𝑋, 𝑦𝑋 ↦ if(𝑥 = 𝑦, 0, 1))
65fmpo 7881 . . . 4 (∀𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ ↔ 𝐷:(𝑋 × 𝑋)⟶ℝ)
74, 6mpbi 229 . . 3 𝐷:(𝑋 × 𝑋)⟶ℝ
8 equequ1 2029 . . . . . . . . 9 (𝑥 = 𝑤 → (𝑥 = 𝑦𝑤 = 𝑦))
98ifbid 4479 . . . . . . . 8 (𝑥 = 𝑤 → if(𝑥 = 𝑦, 0, 1) = if(𝑤 = 𝑦, 0, 1))
10 equequ2 2030 . . . . . . . . 9 (𝑦 = 𝑣 → (𝑤 = 𝑦𝑤 = 𝑣))
1110ifbid 4479 . . . . . . . 8 (𝑦 = 𝑣 → if(𝑤 = 𝑦, 0, 1) = if(𝑤 = 𝑣, 0, 1))
12 0nn0 12178 . . . . . . . . . 10 0 ∈ ℕ0
13 1nn0 12179 . . . . . . . . . 10 1 ∈ ℕ0
1412, 13ifcli 4503 . . . . . . . . 9 if(𝑤 = 𝑣, 0, 1) ∈ ℕ0
1514elexi 3441 . . . . . . . 8 if(𝑤 = 𝑣, 0, 1) ∈ V
169, 11, 5, 15ovmpo 7411 . . . . . . 7 ((𝑤𝑋𝑣𝑋) → (𝑤𝐷𝑣) = if(𝑤 = 𝑣, 0, 1))
1716eqeq1d 2740 . . . . . 6 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ if(𝑤 = 𝑣, 0, 1) = 0))
18 iffalse 4465 . . . . . . . . . 10 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 1)
19 ax-1ne0 10871 . . . . . . . . . . 11 1 ≠ 0
2019a1i 11 . . . . . . . . . 10 𝑤 = 𝑣 → 1 ≠ 0)
2118, 20eqnetrd 3010 . . . . . . . . 9 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) ≠ 0)
2221neneqd 2947 . . . . . . . 8 𝑤 = 𝑣 → ¬ if(𝑤 = 𝑣, 0, 1) = 0)
2322con4i 114 . . . . . . 7 (if(𝑤 = 𝑣, 0, 1) = 0 → 𝑤 = 𝑣)
24 iftrue 4462 . . . . . . 7 (𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 0)
2523, 24impbii 208 . . . . . 6 (if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣)
2617, 25bitrdi 286 . . . . 5 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣))
2712, 13ifcli 4503 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ ℕ0
2812, 13ifcli 4503 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ ℕ0
2927, 28nn0addcli 12200 . . . . . . . . . 10 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0
30 elnn0 12165 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0 ↔ ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0))
3129, 30mpbi 229 . . . . . . . . 9 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0)
32 breq1 5073 . . . . . . . . . . . 12 (0 = if(𝑤 = 𝑣, 0, 1) → (0 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
33 breq1 5073 . . . . . . . . . . . 12 (1 = if(𝑤 = 𝑣, 0, 1) → (1 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
34 0le1 11428 . . . . . . . . . . . 12 0 ≤ 1
352leidi 11439 . . . . . . . . . . . 12 1 ≤ 1
3632, 33, 34, 35keephyp 4527 . . . . . . . . . . 11 if(𝑤 = 𝑣, 0, 1) ≤ 1
37 nnge1 11931 . . . . . . . . . . 11 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
3814nn0rei 12174 . . . . . . . . . . . 12 if(𝑤 = 𝑣, 0, 1) ∈ ℝ
3929nn0rei 12174 . . . . . . . . . . . 12 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℝ
4038, 2, 39letri 11034 . . . . . . . . . . 11 ((if(𝑤 = 𝑣, 0, 1) ≤ 1 ∧ 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1))) → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4136, 37, 40sylancr 586 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4227nn0ge0i 12190 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑤, 0, 1)
4328nn0ge0i 12190 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑣, 0, 1)
4427nn0rei 12174 . . . . . . . . . . . . . 14 if(𝑢 = 𝑤, 0, 1) ∈ ℝ
4528nn0rei 12174 . . . . . . . . . . . . . 14 if(𝑢 = 𝑣, 0, 1) ∈ ℝ
4644, 45add20i 11448 . . . . . . . . . . . . 13 ((0 ≤ if(𝑢 = 𝑤, 0, 1) ∧ 0 ≤ if(𝑢 = 𝑣, 0, 1)) → ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0)))
4742, 43, 46mp2an 688 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0))
48 equequ2 2030 . . . . . . . . . . . . . . . . . . 19 (𝑣 = 𝑤 → (𝑢 = 𝑣𝑢 = 𝑤))
4948ifbid 4479 . . . . . . . . . . . . . . . . . 18 (𝑣 = 𝑤 → if(𝑢 = 𝑣, 0, 1) = if(𝑢 = 𝑤, 0, 1))
5049eqeq1d 2740 . . . . . . . . . . . . . . . . 17 (𝑣 = 𝑤 → (if(𝑢 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑤, 0, 1) = 0))
5150, 48bibi12d 345 . . . . . . . . . . . . . . . 16 (𝑣 = 𝑤 → ((if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣) ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)))
52 equequ1 2029 . . . . . . . . . . . . . . . . . . . 20 (𝑤 = 𝑢 → (𝑤 = 𝑣𝑢 = 𝑣))
5352ifbid 4479 . . . . . . . . . . . . . . . . . . 19 (𝑤 = 𝑢 → if(𝑤 = 𝑣, 0, 1) = if(𝑢 = 𝑣, 0, 1))
5453eqeq1d 2740 . . . . . . . . . . . . . . . . . 18 (𝑤 = 𝑢 → (if(𝑤 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑣, 0, 1) = 0))
5554, 52bibi12d 345 . . . . . . . . . . . . . . . . 17 (𝑤 = 𝑢 → ((if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣) ↔ (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)))
5655, 25chvarvv 2003 . . . . . . . . . . . . . . . 16 (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)
5751, 56chvarvv 2003 . . . . . . . . . . . . . . 15 (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)
58 eqtr2 2762 . . . . . . . . . . . . . . 15 ((𝑢 = 𝑤𝑢 = 𝑣) → 𝑤 = 𝑣)
5957, 56, 58syl2anb 597 . . . . . . . . . . . . . 14 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → 𝑤 = 𝑣)
6059iftrued 4464 . . . . . . . . . . . . 13 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) = 0)
611leidi 11439 . . . . . . . . . . . . 13 0 ≤ 0
6260, 61eqbrtrdi 5109 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) ≤ 0)
6347, 62sylbi 216 . . . . . . . . . . 11 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 → if(𝑤 = 𝑣, 0, 1) ≤ 0)
64 id 22 . . . . . . . . . . 11 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 → (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0)
6563, 64breqtrrd 5098 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
6641, 65jaoi 853 . . . . . . . . 9 (((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0) → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
6731, 66mp1i 13 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
6816adantl 481 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑤𝐷𝑣) = if(𝑤 = 𝑣, 0, 1))
69 eqeq12 2755 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑤) → (𝑥 = 𝑦𝑢 = 𝑤))
7069ifbid 4479 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑤) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑤, 0, 1))
7127elexi 3441 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ V
7270, 5, 71ovmpoa 7406 . . . . . . . . . 10 ((𝑢𝑋𝑤𝑋) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
7372adantrr 713 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
74 eqeq12 2755 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑣) → (𝑥 = 𝑦𝑢 = 𝑣))
7574ifbid 4479 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑣) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑣, 0, 1))
7628elexi 3441 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ V
7775, 5, 76ovmpoa 7406 . . . . . . . . . 10 ((𝑢𝑋𝑣𝑋) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7877adantrl 712 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7973, 78oveq12d 7273 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)) = (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
8067, 68, 793brtr4d 5102 . . . . . . 7 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8180expcom 413 . . . . . 6 ((𝑤𝑋𝑣𝑋) → (𝑢𝑋 → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8281ralrimiv 3106 . . . . 5 ((𝑤𝑋𝑣𝑋) → ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8326, 82jca 511 . . . 4 ((𝑤𝑋𝑣𝑋) → (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8483rgen2 3126 . . 3 𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
857, 84pm3.2i 470 . 2 (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
86 ismet 23384 . 2 (𝑋𝑉 → (𝐷 ∈ (Met‘𝑋) ↔ (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))))
8785, 86mpbiri 257 1 (𝑋𝑉𝐷 ∈ (Met‘𝑋))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 205  wa 395  wo 843   = wceq 1539  wcel 2108  wne 2942  wral 3063  ifcif 4456   class class class wbr 5070   × cxp 5578  wf 6414  cfv 6418  (class class class)co 7255  cmpo 7257  cr 10801  0cc0 10802  1c1 10803   + caddc 10805  cle 10941  cn 11903  0cn0 12163  Metcmet 20496
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1799  ax-4 1813  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2110  ax-9 2118  ax-10 2139  ax-11 2156  ax-12 2173  ax-ext 2709  ax-sep 5218  ax-nul 5225  ax-pow 5283  ax-pr 5347  ax-un 7566  ax-cnex 10858  ax-resscn 10859  ax-1cn 10860  ax-icn 10861  ax-addcl 10862  ax-addrcl 10863  ax-mulcl 10864  ax-mulrcl 10865  ax-mulcom 10866  ax-addass 10867  ax-mulass 10868  ax-distr 10869  ax-i2m1 10870  ax-1ne0 10871  ax-1rid 10872  ax-rnegex 10873  ax-rrecex 10874  ax-cnre 10875  ax-pre-lttri 10876  ax-pre-lttrn 10877  ax-pre-ltadd 10878  ax-pre-mulgt0 10879
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 844  df-3or 1086  df-3an 1087  df-tru 1542  df-fal 1552  df-ex 1784  df-nf 1788  df-sb 2069  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2817  df-nfc 2888  df-ne 2943  df-nel 3049  df-ral 3068  df-rex 3069  df-reu 3070  df-rab 3072  df-v 3424  df-sbc 3712  df-csb 3829  df-dif 3886  df-un 3888  df-in 3890  df-ss 3900  df-pss 3902  df-nul 4254  df-if 4457  df-pw 4532  df-sn 4559  df-pr 4561  df-tp 4563  df-op 4565  df-uni 4837  df-iun 4923  df-br 5071  df-opab 5133  df-mpt 5154  df-tr 5188  df-id 5480  df-eprel 5486  df-po 5494  df-so 5495  df-fr 5535  df-we 5537  df-xp 5586  df-rel 5587  df-cnv 5588  df-co 5589  df-dm 5590  df-rn 5591  df-res 5592  df-ima 5593  df-pred 6191  df-ord 6254  df-on 6255  df-lim 6256  df-suc 6257  df-iota 6376  df-fun 6420  df-fn 6421  df-f 6422  df-f1 6423  df-fo 6424  df-f1o 6425  df-fv 6426  df-riota 7212  df-ov 7258  df-oprab 7259  df-mpo 7260  df-om 7688  df-1st 7804  df-2nd 7805  df-frecs 8068  df-wrecs 8099  df-recs 8173  df-rdg 8212  df-er 8456  df-map 8575  df-en 8692  df-dom 8693  df-sdom 8694  df-pnf 10942  df-mnf 10943  df-xr 10944  df-ltxr 10945  df-le 10946  df-sub 11137  df-neg 11138  df-nn 11904  df-n0 12164  df-met 20504
This theorem is referenced by:  dscopn  23635
  Copyright terms: Public domain W3C validator