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

Theorem dscmet 22093
 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 9793 . . . . . 6 0 ∈ ℝ
2 1re 9792 . . . . . 6 1 ∈ ℝ
31, 2keepel 4008 . . . . 5 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
43rgen2w 2813 . . . 4 𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ
5 dscmet.1 . . . . 5 𝐷 = (𝑥𝑋, 𝑦𝑋 ↦ if(𝑥 = 𝑦, 0, 1))
65fmpt2 6999 . . . 4 (∀𝑥𝑋𝑦𝑋 if(𝑥 = 𝑦, 0, 1) ∈ ℝ ↔ 𝐷:(𝑋 × 𝑋)⟶ℝ)
74, 6mpbi 218 . . 3 𝐷:(𝑋 × 𝑋)⟶ℝ
8 equequ1 1902 . . . . . . . . 9 (𝑥 = 𝑤 → (𝑥 = 𝑦𝑤 = 𝑦))
98ifbid 3961 . . . . . . . 8 (𝑥 = 𝑤 → if(𝑥 = 𝑦, 0, 1) = if(𝑤 = 𝑦, 0, 1))
10 equequ2 1903 . . . . . . . . 9 (𝑦 = 𝑣 → (𝑤 = 𝑦𝑤 = 𝑣))
1110ifbid 3961 . . . . . . . 8 (𝑦 = 𝑣 → if(𝑤 = 𝑦, 0, 1) = if(𝑤 = 𝑣, 0, 1))
12 0nn0 11060 . . . . . . . . . 10 0 ∈ ℕ0
13 1nn0 11061 . . . . . . . . . 10 1 ∈ ℕ0
1412, 13keepel 4008 . . . . . . . . 9 if(𝑤 = 𝑣, 0, 1) ∈ ℕ0
1514elexi 3090 . . . . . . . 8 if(𝑤 = 𝑣, 0, 1) ∈ V
169, 11, 5, 15ovmpt2 6569 . . . . . . 7 ((𝑤𝑋𝑣𝑋) → (𝑤𝐷𝑣) = if(𝑤 = 𝑣, 0, 1))
1716eqeq1d 2516 . . . . . 6 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ if(𝑤 = 𝑣, 0, 1) = 0))
18 iffalse 3948 . . . . . . . . . 10 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 1)
19 ax-1ne0 9758 . . . . . . . . . . 11 1 ≠ 0
2019a1i 11 . . . . . . . . . 10 𝑤 = 𝑣 → 1 ≠ 0)
2118, 20eqnetrd 2753 . . . . . . . . 9 𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) ≠ 0)
2221neneqd 2691 . . . . . . . 8 𝑤 = 𝑣 → ¬ if(𝑤 = 𝑣, 0, 1) = 0)
2322con4i 111 . . . . . . 7 (if(𝑤 = 𝑣, 0, 1) = 0 → 𝑤 = 𝑣)
24 iftrue 3945 . . . . . . 7 (𝑤 = 𝑣 → if(𝑤 = 𝑣, 0, 1) = 0)
2523, 24impbii 197 . . . . . 6 (if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣)
2617, 25syl6bb 274 . . . . 5 ((𝑤𝑋𝑣𝑋) → ((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣))
2712, 13keepel 4008 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ ℕ0
2812, 13keepel 4008 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ ℕ0
2927, 28nn0addcli 11083 . . . . . . . . . 10 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0
30 elnn0 11047 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ0 ↔ ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0))
3129, 30mpbi 218 . . . . . . . . 9 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ ∨ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0)
32 breq1 4484 . . . . . . . . . . . 12 (0 = if(𝑤 = 𝑣, 0, 1) → (0 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
33 breq1 4484 . . . . . . . . . . . 12 (1 = if(𝑤 = 𝑣, 0, 1) → (1 ≤ 1 ↔ if(𝑤 = 𝑣, 0, 1) ≤ 1))
34 0le1 10298 . . . . . . . . . . . 12 0 ≤ 1
352leidi 10309 . . . . . . . . . . . 12 1 ≤ 1
3632, 33, 34, 35keephyp 4005 . . . . . . . . . . 11 if(𝑤 = 𝑣, 0, 1) ≤ 1
37 nnge1 10799 . . . . . . . . . . 11 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
3814nn0rei 11056 . . . . . . . . . . . 12 if(𝑤 = 𝑣, 0, 1) ∈ ℝ
3929nn0rei 11056 . . . . . . . . . . . 12 (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℝ
4038, 2, 39letri 9915 . . . . . . . . . . 11 ((if(𝑤 = 𝑣, 0, 1) ≤ 1 ∧ 1 ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1))) → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4136, 37, 40sylancr 693 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) ∈ ℕ → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
4227nn0ge0i 11073 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑤, 0, 1)
4328nn0ge0i 11073 . . . . . . . . . . . . 13 0 ≤ if(𝑢 = 𝑣, 0, 1)
4427nn0rei 11056 . . . . . . . . . . . . . 14 if(𝑢 = 𝑤, 0, 1) ∈ ℝ
4528nn0rei 11056 . . . . . . . . . . . . . 14 if(𝑢 = 𝑣, 0, 1) ∈ ℝ
4644, 45add20i 10318 . . . . . . . . . . . . 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 703 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0))
48 equequ2 1903 . . . . . . . . . . . . . . . . . . 19 (𝑣 = 𝑤 → (𝑢 = 𝑣𝑢 = 𝑤))
4948ifbid 3961 . . . . . . . . . . . . . . . . . 18 (𝑣 = 𝑤 → if(𝑢 = 𝑣, 0, 1) = if(𝑢 = 𝑤, 0, 1))
5049eqeq1d 2516 . . . . . . . . . . . . . . . . 17 (𝑣 = 𝑤 → (if(𝑢 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑤, 0, 1) = 0))
5150, 48bibi12d 333 . . . . . . . . . . . . . . . 16 (𝑣 = 𝑤 → ((if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣) ↔ (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)))
52 equequ1 1902 . . . . . . . . . . . . . . . . . . . 20 (𝑤 = 𝑢 → (𝑤 = 𝑣𝑢 = 𝑣))
5352ifbid 3961 . . . . . . . . . . . . . . . . . . 19 (𝑤 = 𝑢 → if(𝑤 = 𝑣, 0, 1) = if(𝑢 = 𝑣, 0, 1))
5453eqeq1d 2516 . . . . . . . . . . . . . . . . . 18 (𝑤 = 𝑢 → (if(𝑤 = 𝑣, 0, 1) = 0 ↔ if(𝑢 = 𝑣, 0, 1) = 0))
5554, 52bibi12d 333 . . . . . . . . . . . . . . . . 17 (𝑤 = 𝑢 → ((if(𝑤 = 𝑣, 0, 1) = 0 ↔ 𝑤 = 𝑣) ↔ (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)))
5655, 25chvarv 2154 . . . . . . . . . . . . . . . 16 (if(𝑢 = 𝑣, 0, 1) = 0 ↔ 𝑢 = 𝑣)
5751, 56chvarv 2154 . . . . . . . . . . . . . . 15 (if(𝑢 = 𝑤, 0, 1) = 0 ↔ 𝑢 = 𝑤)
58 eqtr2 2534 . . . . . . . . . . . . . . 15 ((𝑢 = 𝑤𝑢 = 𝑣) → 𝑤 = 𝑣)
5957, 56, 58syl2anb 494 . . . . . . . . . . . . . 14 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → 𝑤 = 𝑣)
6059iftrued 3947 . . . . . . . . . . . . 13 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) = 0)
611leidi 10309 . . . . . . . . . . . . 13 0 ≤ 0
6260, 61syl6eqbr 4520 . . . . . . . . . . . 12 ((if(𝑢 = 𝑤, 0, 1) = 0 ∧ if(𝑢 = 𝑣, 0, 1) = 0) → if(𝑤 = 𝑣, 0, 1) ≤ 0)
6347, 62sylbi 205 . . . . . . . . . . 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 4509 . . . . . . . . . 10 ((if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)) = 0 → if(𝑤 = 𝑣, 0, 1) ≤ (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
6641, 65jaoi 392 . . . . . . . . 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 480 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑤𝐷𝑣) = if(𝑤 = 𝑣, 0, 1))
69 eqeq12 2527 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑤) → (𝑥 = 𝑦𝑢 = 𝑤))
7069ifbid 3961 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑤) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑤, 0, 1))
7127elexi 3090 . . . . . . . . . . 11 if(𝑢 = 𝑤, 0, 1) ∈ V
7270, 5, 71ovmpt2a 6564 . . . . . . . . . 10 ((𝑢𝑋𝑤𝑋) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
7372adantrr 748 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑤) = if(𝑢 = 𝑤, 0, 1))
74 eqeq12 2527 . . . . . . . . . . . 12 ((𝑥 = 𝑢𝑦 = 𝑣) → (𝑥 = 𝑦𝑢 = 𝑣))
7574ifbid 3961 . . . . . . . . . . 11 ((𝑥 = 𝑢𝑦 = 𝑣) → if(𝑥 = 𝑦, 0, 1) = if(𝑢 = 𝑣, 0, 1))
7628elexi 3090 . . . . . . . . . . 11 if(𝑢 = 𝑣, 0, 1) ∈ V
7775, 5, 76ovmpt2a 6564 . . . . . . . . . 10 ((𝑢𝑋𝑣𝑋) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7877adantrl 747 . . . . . . . . 9 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑢𝐷𝑣) = if(𝑢 = 𝑣, 0, 1))
7973, 78oveq12d 6443 . . . . . . . 8 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)) = (if(𝑢 = 𝑤, 0, 1) + if(𝑢 = 𝑣, 0, 1)))
8067, 68, 793brtr4d 4513 . . . . . . 7 ((𝑢𝑋 ∧ (𝑤𝑋𝑣𝑋)) → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8180expcom 449 . . . . . 6 ((𝑤𝑋𝑣𝑋) → (𝑢𝑋 → (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8281ralrimiv 2852 . . . . 5 ((𝑤𝑋𝑣𝑋) → ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
8326, 82jca 552 . . . 4 ((𝑤𝑋𝑣𝑋) → (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
8483rgen2a 2864 . . 3 𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣)))
857, 84pm3.2i 469 . 2 (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))
86 ismet 21844 . 2 (𝑋𝑉 → (𝐷 ∈ (Met‘𝑋) ↔ (𝐷:(𝑋 × 𝑋)⟶ℝ ∧ ∀𝑤𝑋𝑣𝑋 (((𝑤𝐷𝑣) = 0 ↔ 𝑤 = 𝑣) ∧ ∀𝑢𝑋 (𝑤𝐷𝑣) ≤ ((𝑢𝐷𝑤) + (𝑢𝐷𝑣))))))
8785, 86mpbiri 246 1 (𝑋𝑉𝐷 ∈ (Met‘𝑋))
 Colors of variables: wff setvar class Syntax hints:  ¬ wn 3   → wi 4   ↔ wb 194   ∨ wo 381   ∧ wa 382   = wceq 1474   ∈ wcel 1938   ≠ wne 2684  ∀wral 2800  ifcif 3939   class class class wbr 4481   × cxp 4930  ⟶wf 5685  ‘cfv 5689  (class class class)co 6425   ↦ cmpt2 6427  ℝcr 9688  0cc0 9689  1c1 9690   + caddc 9692   ≤ cle 9828  ℕcn 10773  ℕ0cn0 11045  Metcme 19461 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1700  ax-4 1713  ax-5 1793  ax-6 1838  ax-7 1885  ax-8 1940  ax-9 1947  ax-10 1966  ax-11 1971  ax-12 1983  ax-13 2137  ax-ext 2494  ax-sep 4607  ax-nul 4616  ax-pow 4668  ax-pr 4732  ax-un 6721  ax-cnex 9745  ax-resscn 9746  ax-1cn 9747  ax-icn 9748  ax-addcl 9749  ax-addrcl 9750  ax-mulcl 9751  ax-mulrcl 9752  ax-mulcom 9753  ax-addass 9754  ax-mulass 9755  ax-distr 9756  ax-i2m1 9757  ax-1ne0 9758  ax-1rid 9759  ax-rnegex 9760  ax-rrecex 9761  ax-cnre 9762  ax-pre-lttri 9763  ax-pre-lttrn 9764  ax-pre-ltadd 9765  ax-pre-mulgt0 9766 This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1699  df-sb 1831  df-eu 2366  df-mo 2367  df-clab 2501  df-cleq 2507  df-clel 2510  df-nfc 2644  df-ne 2686  df-nel 2687  df-ral 2805  df-rex 2806  df-reu 2807  df-rab 2809  df-v 3079  df-sbc 3307  df-csb 3404  df-dif 3447  df-un 3449  df-in 3451  df-ss 3458  df-pss 3460  df-nul 3778  df-if 3940  df-pw 4013  df-sn 4029  df-pr 4031  df-tp 4033  df-op 4035  df-uni 4271  df-iun 4355  df-br 4482  df-opab 4542  df-mpt 4543  df-tr 4579  df-eprel 4843  df-id 4847  df-po 4853  df-so 4854  df-fr 4891  df-we 4893  df-xp 4938  df-rel 4939  df-cnv 4940  df-co 4941  df-dm 4942  df-rn 4943  df-res 4944  df-ima 4945  df-pred 5487  df-ord 5533  df-on 5534  df-lim 5535  df-suc 5536  df-iota 5653  df-fun 5691  df-fn 5692  df-f 5693  df-f1 5694  df-fo 5695  df-f1o 5696  df-fv 5697  df-riota 6387  df-ov 6428  df-oprab 6429  df-mpt2 6430  df-om 6832  df-1st 6932  df-2nd 6933  df-wrecs 7167  df-recs 7229  df-rdg 7267  df-er 7503  df-map 7620  df-en 7716  df-dom 7717  df-sdom 7718  df-pnf 9829  df-mnf 9830  df-xr 9831  df-ltxr 9832  df-le 9833  df-sub 10017  df-neg 10018  df-nn 10774  df-n0 11046  df-met 19469 This theorem is referenced by:  dscopn  22094
 Copyright terms: Public domain W3C validator