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

Theorem dscmet 23288
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 10694 . . . . . 6 0 ∈ ℝ
2 1re 10692 . . . . . 6 1 ∈ ℝ
31, 2ifcli 4470 . . . . 5 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
43rgen2w 3083 . . . 4 𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
5 dscmet.1 . . . . 5 𝐷 = (𝑥𝑋, 𝑦𝑋 ↦ if(𝑥 = 𝑦, 0, 1))
65fmpo 7776 . . . 4 (∀𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ ↔ 𝐷:(𝑋 × 𝑋)⟶ℝ)
74, 6mpbi 233 . . 3 𝐷:(𝑋 × 𝑋)⟶ℝ
8 equequ1 2032 . . . . . . . . 9 (𝑥 = 𝑤 → (𝑥 = 𝑦𝑤 = 𝑦))
98ifbid 4446 . . . . . . . 8 (𝑥 = 𝑤 → if(𝑥 = 𝑦, 0, 1) = if(𝑤 = 𝑦, 0, 1))
10 equequ2 2033 . . . . . . . . 9 (𝑦 = 𝑣 → (𝑤 = 𝑦𝑤 = 𝑣))
1110ifbid 4446 . . . . . . . 8 (𝑦 = 𝑣 → if(𝑤 = 𝑦, 0, 1) = if(𝑤 = 𝑣, 0, 1))
12 0nn0 11962 . . . . . . . . . 10 0 ∈ ℕ0
13 1nn0 11963 . . . . . . . . . 10 1 ∈ ℕ0
1412, 13ifcli 4470 . . . . . . . . 9 if(𝑤 = 𝑣, 0, 1) ∈ ℕ0
1514elexi 3429 . . . . . . . 8 if(𝑤 = 𝑣, 0, 1) ∈ V
169, 11, 5, 15ovmpo 7311 . . . . . . 7 ((𝑤𝑋𝑣𝑋) → (𝑤𝐷𝑣) = if(𝑤 = 𝑣, 0, 1))
1716eqeq1d 2760 . . . . . 6 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ if(𝑤 = 𝑣, 0, 1) = 0))
18 iffalse 4432 . . . . . . . . . 10 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 1)
19 ax-1ne0 10657 . . . . . . . . . . 11 1 ≠ 0
2019a1i 11 . . . . . . . . . 10 𝑤 = 𝑣 → 1 ≠ 0)
2118, 20eqnetrd 3018 . . . . . . . . 9 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) ≠ 0)
2221neneqd 2956 . . . . . . . 8 𝑤 = 𝑣 → ¬ if(𝑤 = 𝑣, 0, 1) = 0)
2322con4i 114 . . . . . . 7 (if(𝑤 = 𝑣, 0, 1) = 0 → 𝑤 = 𝑣)
24 iftrue 4429 . . . . . . 7 (𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 0)
2523, 24impbii 212 . . . . . 6 (if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣)
2617, 25bitrdi 290 . . . . 5 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣))
2712, 13ifcli 4470 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ ℕ0
2812, 13ifcli 4470 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ ℕ0
2927, 28nn0addcli 11984 . . . . . . . . . 10 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0
30 elnn0 11949 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0 ↔ ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0))
3129, 30mpbi 233 . . . . . . . . 9 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0)
32 breq1 5039 . . . . . . . . . . . 12 (0 = if(𝑤 = 𝑣, 0, 1) → (0 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
33 breq1 5039 . . . . . . . . . . . 12 (1 = if(𝑤 = 𝑣, 0, 1) → (1 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
34 0le1 11214 . . . . . . . . . . . 12 0 ≤ 1
352leidi 11225 . . . . . . . . . . . 12 1 ≤ 1
3632, 33, 34, 35keephyp 4494 . . . . . . . . . . 11 if(𝑤 = 𝑣, 0, 1) ≤ 1
37 nnge1 11715 . . . . . . . . . . 11 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
3814nn0rei 11958 . . . . . . . . . . . 12 if(𝑤 = 𝑣, 0, 1) ∈ ℝ
3929nn0rei 11958 . . . . . . . . . . . 12 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℝ
4038, 2, 39letri 10820 . . . . . . . . . . 11 ((if(𝑤 = 𝑣, 0, 1) ≤ 1 ∧ 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1))) → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4136, 37, 40sylancr 590 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4227nn0ge0i 11974 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑤, 0, 1)
4328nn0ge0i 11974 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑣, 0, 1)
4427nn0rei 11958 . . . . . . . . . . . . . 14 if(𝑢 = 𝑤, 0, 1) ∈ ℝ
4528nn0rei 11958 . . . . . . . . . . . . . 14 if(𝑢 = 𝑣, 0, 1) ∈ ℝ
4644, 45add20i 11234 . . . . . . . . . . . . 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 691 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0))
48 equequ2 2033 . . . . . . . . . . . . . . . . . . 19 (𝑣 = 𝑤 → (𝑢 = 𝑣𝑢 = 𝑤))
4948ifbid 4446 . . . . . . . . . . . . . . . . . 18 (𝑣 = 𝑤 → if(𝑢 = 𝑣, 0, 1) = if(𝑢 = 𝑤, 0, 1))
5049eqeq1d 2760 . . . . . . . . . . . . . . . . 17 (𝑣 = 𝑤 → (if(𝑢 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑤, 0, 1) = 0))
5150, 48bibi12d 349 . . . . . . . . . . . . . . . 16 (𝑣 = 𝑤 → ((if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣) ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)))
52 equequ1 2032 . . . . . . . . . . . . . . . . . . . 20 (𝑤 = 𝑢 → (𝑤 = 𝑣𝑢 = 𝑣))
5352ifbid 4446 . . . . . . . . . . . . . . . . . . 19 (𝑤 = 𝑢 → if(𝑤 = 𝑣, 0, 1) = if(𝑢 = 𝑣, 0, 1))
5453eqeq1d 2760 . . . . . . . . . . . . . . . . . 18 (𝑤 = 𝑢 → (if(𝑤 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑣, 0, 1) = 0))
5554, 52bibi12d 349 . . . . . . . . . . . . . . . . 17 (𝑤 = 𝑢 → ((if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣) ↔ (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)))
5655, 25chvarvv 2005 . . . . . . . . . . . . . . . 16 (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)
5751, 56chvarvv 2005 . . . . . . . . . . . . . . 15 (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)
58 eqtr2 2779 . . . . . . . . . . . . . . 15 ((𝑢 = 𝑤𝑢 = 𝑣) → 𝑤 = 𝑣)
5957, 56, 58syl2anb 600 . . . . . . . . . . . . . 14 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → 𝑤 = 𝑣)
6059iftrued 4431 . . . . . . . . . . . . 13 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) = 0)
611leidi 11225 . . . . . . . . . . . . 13 0 ≤ 0
6260, 61eqbrtrdi 5075 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) ≤ 0)
6347, 62sylbi 220 . . . . . . . . . . 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 5064 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
6641, 65jaoi 854 . . . . . . . . 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 485 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑤𝐷𝑣) = if(𝑤 = 𝑣, 0, 1))
69 eqeq12 2772 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑤) → (𝑥 = 𝑦𝑢 = 𝑤))
7069ifbid 4446 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑤) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑤, 0, 1))
7127elexi 3429 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ V
7270, 5, 71ovmpoa 7306 . . . . . . . . . 10 ((𝑢𝑋𝑤𝑋) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
7372adantrr 716 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
74 eqeq12 2772 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑣) → (𝑥 = 𝑦𝑢 = 𝑣))
7574ifbid 4446 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑣) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑣, 0, 1))
7628elexi 3429 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ V
7775, 5, 76ovmpoa 7306 . . . . . . . . . 10 ((𝑢𝑋𝑣𝑋) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7877adantrl 715 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7973, 78oveq12d 7174 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)) = (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
8067, 68, 793brtr4d 5068 . . . . . . 7 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8180expcom 417 . . . . . 6 ((𝑤𝑋𝑣𝑋) → (𝑢𝑋 → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8281ralrimiv 3112 . . . . 5 ((𝑤𝑋𝑣𝑋) → ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8326, 82jca 515 . . . 4 ((𝑤𝑋𝑣𝑋) → (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8483rgen2 3132 . . 3 𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
857, 84pm3.2i 474 . 2 (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
86 ismet 23039 . 2 (𝑋𝑉 → (𝐷 ∈ (Met‘𝑋) ↔ (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))))
8785, 86mpbiri 261 1 (𝑋𝑉𝐷 ∈ (Met‘𝑋))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 209  wa 399  wo 844   = wceq 1538  wcel 2111  wne 2951  wral 3070  ifcif 4423   class class class wbr 5036   × cxp 5526  wf 6336  cfv 6340  (class class class)co 7156  cmpo 7158  cr 10587  0cc0 10588  1c1 10589   + caddc 10591  cle 10727  cn 11687  0cn0 11947  Metcmet 20166
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2113  ax-9 2121  ax-10 2142  ax-11 2158  ax-12 2175  ax-ext 2729  ax-sep 5173  ax-nul 5180  ax-pow 5238  ax-pr 5302  ax-un 7465  ax-cnex 10644  ax-resscn 10645  ax-1cn 10646  ax-icn 10647  ax-addcl 10648  ax-addrcl 10649  ax-mulcl 10650  ax-mulrcl 10651  ax-mulcom 10652  ax-addass 10653  ax-mulass 10654  ax-distr 10655  ax-i2m1 10656  ax-1ne0 10657  ax-1rid 10658  ax-rnegex 10659  ax-rrecex 10660  ax-cnre 10661  ax-pre-lttri 10662  ax-pre-lttrn 10663  ax-pre-ltadd 10664  ax-pre-mulgt0 10665
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3or 1085  df-3an 1086  df-tru 1541  df-fal 1551  df-ex 1782  df-nf 1786  df-sb 2070  df-mo 2557  df-eu 2588  df-clab 2736  df-cleq 2750  df-clel 2830  df-nfc 2901  df-ne 2952  df-nel 3056  df-ral 3075  df-rex 3076  df-reu 3077  df-rab 3079  df-v 3411  df-sbc 3699  df-csb 3808  df-dif 3863  df-un 3865  df-in 3867  df-ss 3877  df-pss 3879  df-nul 4228  df-if 4424  df-pw 4499  df-sn 4526  df-pr 4528  df-tp 4530  df-op 4532  df-uni 4802  df-iun 4888  df-br 5037  df-opab 5099  df-mpt 5117  df-tr 5143  df-id 5434  df-eprel 5439  df-po 5447  df-so 5448  df-fr 5487  df-we 5489  df-xp 5534  df-rel 5535  df-cnv 5536  df-co 5537  df-dm 5538  df-rn 5539  df-res 5540  df-ima 5541  df-pred 6131  df-ord 6177  df-on 6178  df-lim 6179  df-suc 6180  df-iota 6299  df-fun 6342  df-fn 6343  df-f 6344  df-f1 6345  df-fo 6346  df-f1o 6347  df-fv 6348  df-riota 7114  df-ov 7159  df-oprab 7160  df-mpo 7161  df-om 7586  df-1st 7699  df-2nd 7700  df-wrecs 7963  df-recs 8024  df-rdg 8062  df-er 8305  df-map 8424  df-en 8541  df-dom 8542  df-sdom 8543  df-pnf 10728  df-mnf 10729  df-xr 10730  df-ltxr 10731  df-le 10732  df-sub 10923  df-neg 10924  df-nn 11688  df-n0 11948  df-met 20174
This theorem is referenced by:  dscopn  23289
  Copyright terms: Public domain W3C validator