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

Theorem dscmet 22424
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 10078 . . . . . 6 0 ∈ ℝ
2 1re 10077 . . . . . 6 1 ∈ ℝ
31, 2keepel 4188 . . . . 5 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
43rgen2w 2954 . . . 4 𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
5 dscmet.1 . . . . 5 𝐷 = (𝑥𝑋, 𝑦𝑋 ↦ if(𝑥 = 𝑦, 0, 1))
65fmpt2 7282 . . . 4 (∀𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ ↔ 𝐷:(𝑋 × 𝑋)⟶ℝ)
74, 6mpbi 220 . . 3 𝐷:(𝑋 × 𝑋)⟶ℝ
8 equequ1 1998 . . . . . . . . 9 (𝑥 = 𝑤 → (𝑥 = 𝑦𝑤 = 𝑦))
98ifbid 4141 . . . . . . . 8 (𝑥 = 𝑤 → if(𝑥 = 𝑦, 0, 1) = if(𝑤 = 𝑦, 0, 1))
10 equequ2 1999 . . . . . . . . 9 (𝑦 = 𝑣 → (𝑤 = 𝑦𝑤 = 𝑣))
1110ifbid 4141 . . . . . . . 8 (𝑦 = 𝑣 → if(𝑤 = 𝑦, 0, 1) = if(𝑤 = 𝑣, 0, 1))
12 0nn0 11345 . . . . . . . . . 10 0 ∈ ℕ0
13 1nn0 11346 . . . . . . . . . 10 1 ∈ ℕ0
1412, 13keepel 4188 . . . . . . . . 9 if(𝑤 = 𝑣, 0, 1) ∈ ℕ0
1514elexi 3244 . . . . . . . 8 if(𝑤 = 𝑣, 0, 1) ∈ V
169, 11, 5, 15ovmpt2 6838 . . . . . . 7 ((𝑤𝑋𝑣𝑋) → (𝑤𝐷𝑣) = if(𝑤 = 𝑣, 0, 1))
1716eqeq1d 2653 . . . . . 6 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ if(𝑤 = 𝑣, 0, 1) = 0))
18 iffalse 4128 . . . . . . . . . 10 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 1)
19 ax-1ne0 10043 . . . . . . . . . . 11 1 ≠ 0
2019a1i 11 . . . . . . . . . 10 𝑤 = 𝑣 → 1 ≠ 0)
2118, 20eqnetrd 2890 . . . . . . . . 9 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) ≠ 0)
2221neneqd 2828 . . . . . . . 8 𝑤 = 𝑣 → ¬ if(𝑤 = 𝑣, 0, 1) = 0)
2322con4i 113 . . . . . . 7 (if(𝑤 = 𝑣, 0, 1) = 0 → 𝑤 = 𝑣)
24 iftrue 4125 . . . . . . 7 (𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 0)
2523, 24impbii 199 . . . . . 6 (if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣)
2617, 25syl6bb 276 . . . . 5 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣))
2712, 13keepel 4188 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ ℕ0
2812, 13keepel 4188 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ ℕ0
2927, 28nn0addcli 11368 . . . . . . . . . 10 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0
30 elnn0 11332 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0 ↔ ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0))
3129, 30mpbi 220 . . . . . . . . 9 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0)
32 breq1 4688 . . . . . . . . . . . 12 (0 = if(𝑤 = 𝑣, 0, 1) → (0 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
33 breq1 4688 . . . . . . . . . . . 12 (1 = if(𝑤 = 𝑣, 0, 1) → (1 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
34 0le1 10589 . . . . . . . . . . . 12 0 ≤ 1
352leidi 10600 . . . . . . . . . . . 12 1 ≤ 1
3632, 33, 34, 35keephyp 4185 . . . . . . . . . . 11 if(𝑤 = 𝑣, 0, 1) ≤ 1
37 nnge1 11084 . . . . . . . . . . 11 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
3814nn0rei 11341 . . . . . . . . . . . 12 if(𝑤 = 𝑣, 0, 1) ∈ ℝ
3929nn0rei 11341 . . . . . . . . . . . 12 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℝ
4038, 2, 39letri 10204 . . . . . . . . . . 11 ((if(𝑤 = 𝑣, 0, 1) ≤ 1 ∧ 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1))) → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4136, 37, 40sylancr 696 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4227nn0ge0i 11358 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑤, 0, 1)
4328nn0ge0i 11358 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑣, 0, 1)
4427nn0rei 11341 . . . . . . . . . . . . . 14 if(𝑢 = 𝑤, 0, 1) ∈ ℝ
4528nn0rei 11341 . . . . . . . . . . . . . 14 if(𝑢 = 𝑣, 0, 1) ∈ ℝ
4644, 45add20i 10609 . . . . . . . . . . . . 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 708 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0))
48 equequ2 1999 . . . . . . . . . . . . . . . . . . 19 (𝑣 = 𝑤 → (𝑢 = 𝑣𝑢 = 𝑤))
4948ifbid 4141 . . . . . . . . . . . . . . . . . 18 (𝑣 = 𝑤 → if(𝑢 = 𝑣, 0, 1) = if(𝑢 = 𝑤, 0, 1))
5049eqeq1d 2653 . . . . . . . . . . . . . . . . 17 (𝑣 = 𝑤 → (if(𝑢 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑤, 0, 1) = 0))
5150, 48bibi12d 334 . . . . . . . . . . . . . . . 16 (𝑣 = 𝑤 → ((if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣) ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)))
52 equequ1 1998 . . . . . . . . . . . . . . . . . . . 20 (𝑤 = 𝑢 → (𝑤 = 𝑣𝑢 = 𝑣))
5352ifbid 4141 . . . . . . . . . . . . . . . . . . 19 (𝑤 = 𝑢 → if(𝑤 = 𝑣, 0, 1) = if(𝑢 = 𝑣, 0, 1))
5453eqeq1d 2653 . . . . . . . . . . . . . . . . . 18 (𝑤 = 𝑢 → (if(𝑤 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑣, 0, 1) = 0))
5554, 52bibi12d 334 . . . . . . . . . . . . . . . . 17 (𝑤 = 𝑢 → ((if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣) ↔ (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)))
5655, 25chvarv 2299 . . . . . . . . . . . . . . . 16 (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)
5751, 56chvarv 2299 . . . . . . . . . . . . . . 15 (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)
58 eqtr2 2671 . . . . . . . . . . . . . . 15 ((𝑢 = 𝑤𝑢 = 𝑣) → 𝑤 = 𝑣)
5957, 56, 58syl2anb 495 . . . . . . . . . . . . . 14 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → 𝑤 = 𝑣)
6059iftrued 4127 . . . . . . . . . . . . 13 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) = 0)
611leidi 10600 . . . . . . . . . . . . 13 0 ≤ 0
6260, 61syl6eqbr 4724 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) ≤ 0)
6347, 62sylbi 207 . . . . . . . . . . 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 4713 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
6641, 65jaoi 393 . . . . . . . . 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 2664 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑤) → (𝑥 = 𝑦𝑢 = 𝑤))
7069ifbid 4141 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑤) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑤, 0, 1))
7127elexi 3244 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ V
7270, 5, 71ovmpt2a 6833 . . . . . . . . . 10 ((𝑢𝑋𝑤𝑋) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
7372adantrr 753 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
74 eqeq12 2664 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑣) → (𝑥 = 𝑦𝑢 = 𝑣))
7574ifbid 4141 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑣) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑣, 0, 1))
7628elexi 3244 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ V
7775, 5, 76ovmpt2a 6833 . . . . . . . . . 10 ((𝑢𝑋𝑣𝑋) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7877adantrl 752 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7973, 78oveq12d 6708 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)) = (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
8067, 68, 793brtr4d 4717 . . . . . . 7 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8180expcom 450 . . . . . 6 ((𝑤𝑋𝑣𝑋) → (𝑢𝑋 → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8281ralrimiv 2994 . . . . 5 ((𝑤𝑋𝑣𝑋) → ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8326, 82jca 553 . . . 4 ((𝑤𝑋𝑣𝑋) → (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8483rgen2a 3006 . . 3 𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
857, 84pm3.2i 470 . 2 (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
86 ismet 22175 . 2 (𝑋𝑉 → (𝐷 ∈ (Met‘𝑋) ↔ (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))))
8785, 86mpbiri 248 1 (𝑋𝑉𝐷 ∈ (Met‘𝑋))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 196  wo 382  wa 383   = wceq 1523  wcel 2030  wne 2823  wral 2941  ifcif 4119   class class class wbr 4685   × cxp 5141  wf 5922  cfv 5926  (class class class)co 6690  cmpt2 6692  cr 9973  0cc0 9974  1c1 9975   + caddc 9977  cle 10113  cn 11058  0cn0 11330  Metcme 19780
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1762  ax-4 1777  ax-5 1879  ax-6 1945  ax-7 1981  ax-8 2032  ax-9 2039  ax-10 2059  ax-11 2074  ax-12 2087  ax-13 2282  ax-ext 2631  ax-sep 4814  ax-nul 4822  ax-pow 4873  ax-pr 4936  ax-un 6991  ax-cnex 10030  ax-resscn 10031  ax-1cn 10032  ax-icn 10033  ax-addcl 10034  ax-addrcl 10035  ax-mulcl 10036  ax-mulrcl 10037  ax-mulcom 10038  ax-addass 10039  ax-mulass 10040  ax-distr 10041  ax-i2m1 10042  ax-1ne0 10043  ax-1rid 10044  ax-rnegex 10045  ax-rrecex 10046  ax-cnre 10047  ax-pre-lttri 10048  ax-pre-lttrn 10049  ax-pre-ltadd 10050  ax-pre-mulgt0 10051
This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-3or 1055  df-3an 1056  df-tru 1526  df-ex 1745  df-nf 1750  df-sb 1938  df-eu 2502  df-mo 2503  df-clab 2638  df-cleq 2644  df-clel 2647  df-nfc 2782  df-ne 2824  df-nel 2927  df-ral 2946  df-rex 2947  df-reu 2948  df-rab 2950  df-v 3233  df-sbc 3469  df-csb 3567  df-dif 3610  df-un 3612  df-in 3614  df-ss 3621  df-pss 3623  df-nul 3949  df-if 4120  df-pw 4193  df-sn 4211  df-pr 4213  df-tp 4215  df-op 4217  df-uni 4469  df-iun 4554  df-br 4686  df-opab 4746  df-mpt 4763  df-tr 4786  df-id 5053  df-eprel 5058  df-po 5064  df-so 5065  df-fr 5102  df-we 5104  df-xp 5149  df-rel 5150  df-cnv 5151  df-co 5152  df-dm 5153  df-rn 5154  df-res 5155  df-ima 5156  df-pred 5718  df-ord 5764  df-on 5765  df-lim 5766  df-suc 5767  df-iota 5889  df-fun 5928  df-fn 5929  df-f 5930  df-f1 5931  df-fo 5932  df-f1o 5933  df-fv 5934  df-riota 6651  df-ov 6693  df-oprab 6694  df-mpt2 6695  df-om 7108  df-1st 7210  df-2nd 7211  df-wrecs 7452  df-recs 7513  df-rdg 7551  df-er 7787  df-map 7901  df-en 7998  df-dom 7999  df-sdom 8000  df-pnf 10114  df-mnf 10115  df-xr 10116  df-ltxr 10117  df-le 10118  df-sub 10306  df-neg 10307  df-nn 11059  df-n0 11331  df-met 19788
This theorem is referenced by:  dscopn  22425
  Copyright terms: Public domain W3C validator