Users' Mathboxes Mathbox for Jim Kingdon < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >   Mathboxes  >  qdiff GIF version

Theorem qdiff 17265
Description: The rationals are exactly those reals for which there exist two distinct rationals that are the same distance from the original number. Similar to apdiff 17264 but by stating the result positively we can completely sidestep the issue of not equal versus apart in the statement of the result. From an online post by Ingo Blechschmidt. (Contributed by Jim Kingdon, 24-Apr-2026.)
Assertion
Ref Expression
qdiff (𝐴 ∈ ℝ → (𝐴 ∈ ℚ ↔ ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))))
Distinct variable group:   𝐴,𝑞,𝑟

Proof of Theorem qdiff
StepHypRef Expression
1 1z 9675 . . . . 5 1 ∈ ℤ
2 zq 10036 . . . . 5 (1 ∈ ℤ → 1 ∈ ℚ)
31, 2ax-mp 5 . . . 4 1 ∈ ℚ
4 qsubcl 10048 . . . 4 ((𝐴 ∈ ℚ ∧ 1 ∈ ℚ) → (𝐴 − 1) ∈ ℚ)
53, 4mpan2 429 . . 3 (𝐴 ∈ ℚ → (𝐴 − 1) ∈ ℚ)
6 qaddcl 10045 . . . . 5 ((𝐴 ∈ ℚ ∧ 1 ∈ ℚ) → (𝐴 + 1) ∈ ℚ)
73, 6mpan2 429 . . . 4 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℚ)
8 qre 10035 . . . . . . . . . 10 (𝐴 ∈ ℚ → 𝐴 ∈ ℝ)
9 1rp 10069 . . . . . . . . . . . . 13 1 ∈ ℝ+
109, 9pm3.2i 272 . . . . . . . . . . . 12 (1 ∈ ℝ+ ∧ 1 ∈ ℝ+)
11 rpaddcl 10089 . . . . . . . . . . . 12 ((1 ∈ ℝ+ ∧ 1 ∈ ℝ+) → (1 + 1) ∈ ℝ+)
1210, 11mp1i 10 . . . . . . . . . . 11 (𝐴 ∈ ℚ → (1 + 1) ∈ ℝ+)
138, 12ltaddrpd 10142 . . . . . . . . . 10 (𝐴 ∈ ℚ → 𝐴 < (𝐴 + (1 + 1)))
148, 13ltned 8441 . . . . . . . . 9 (𝐴 ∈ ℚ → 𝐴 ≠ (𝐴 + (1 + 1)))
1514neneqd 2441 . . . . . . . 8 (𝐴 ∈ ℚ → ¬ 𝐴 = (𝐴 + (1 + 1)))
1615neqcomd 2243 . . . . . . 7 (𝐴 ∈ ℚ → ¬ (𝐴 + (1 + 1)) = 𝐴)
17 qcn 10044 . . . . . . . . 9 (𝐴 ∈ ℚ → 𝐴 ∈ ℂ)
18 1cnd 8343 . . . . . . . . 9 (𝐴 ∈ ℚ → 1 ∈ ℂ)
1917, 18, 18addassd 8349 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴 + 1) + 1) = (𝐴 + (1 + 1)))
2019eqeq1d 2247 . . . . . . 7 (𝐴 ∈ ℚ → (((𝐴 + 1) + 1) = 𝐴 ↔ (𝐴 + (1 + 1)) = 𝐴))
2116, 20mtbird 684 . . . . . 6 (𝐴 ∈ ℚ → ¬ ((𝐴 + 1) + 1) = 𝐴)
2217, 18addcld 8346 . . . . . . 7 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℂ)
2317, 18, 22subadd2d 8658 . . . . . 6 (𝐴 ∈ ℚ → ((𝐴 − 1) = (𝐴 + 1) ↔ ((𝐴 + 1) + 1) = 𝐴))
2421, 23mtbird 684 . . . . 5 (𝐴 ∈ ℚ → ¬ (𝐴 − 1) = (𝐴 + 1))
2524neqned 2427 . . . 4 (𝐴 ∈ ℚ → (𝐴 − 1) ≠ (𝐴 + 1))
2618absnegd 11972 . . . . 5 (𝐴 ∈ ℚ → (abs‘-1) = (abs‘1))
2717, 17, 18subsub4d 8670 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴 − 𝐴) − 1) = (𝐴 − (𝐴 + 1)))
2817subidd 8627 . . . . . . . . 9 (𝐴 ∈ ℚ → (𝐴 − 𝐴) = 0)
2928oveq1d 6100 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴 − 𝐴) − 1) = (0 − 1))
30 df-neg 8502 . . . . . . . 8 -1 = (0 − 1)
3129, 30eqtr4di 2289 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴 − 𝐴) − 1) = -1)
3227, 31eqtr3d 2273 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 + 1)) = -1)
3332fveq2d 5699 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 + 1))) = (abs‘-1))
3417, 18nncand 8644 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 − 1)) = 1)
3534fveq2d 5699 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘1))
3626, 33, 353eqtr4rd 2282 . . . 4 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))
37 neeq2 2434 . . . . . 6 (𝑟 = (𝐴 + 1) → ((𝐴 − 1) ≠ 𝑟 ↔ (𝐴 − 1) ≠ (𝐴 + 1)))
38 oveq2 6093 . . . . . . . 8 (𝑟 = (𝐴 + 1) → (𝐴 − 𝑟) = (𝐴 − (𝐴 + 1)))
3938fveq2d 5699 . . . . . . 7 (𝑟 = (𝐴 + 1) → (abs‘(𝐴 − 𝑟)) = (abs‘(𝐴 − (𝐴 + 1))))
4039eqeq2d 2250 . . . . . 6 (𝑟 = (𝐴 + 1) → ((abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1)))))
4137, 40anbi12d 477 . . . . 5 (𝑟 = (𝐴 + 1) → (((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟))) ↔ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))))
4241rspcev 2929 . . . 4 (((𝐴 + 1) ∈ ℚ ∧ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))) → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟))))
437, 25, 36, 42syl12anc 1276 . . 3 (𝐴 ∈ ℚ → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟))))
44 neeq1 2433 . . . . . 6 (𝑞 = (𝐴 − 1) → (𝑞 ≠ 𝑟 ↔ (𝐴 − 1) ≠ 𝑟))
45 oveq2 6093 . . . . . . 7 (𝑞 = (𝐴 − 1) → (𝐴 − 𝑞) = (𝐴 − (𝐴 − 1)))
4645fveqeq2d 5703 . . . . . 6 (𝑞 = (𝐴 − 1) → ((abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟))))
4744, 46anbi12d 477 . . . . 5 (𝑞 = (𝐴 − 1) → ((𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))) ↔ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟)))))
4847rexbidv 2551 . . . 4 (𝑞 = (𝐴 − 1) → (∃𝑟 ∈ ℚ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))) ↔ ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟)))))
4948rspcev 2929 . . 3 (((𝐴 − 1) ∈ ℚ ∧ ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − 𝑟)))) → ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))))
505, 43, 49syl2anc 415 . 2 (𝐴 ∈ ℚ → ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))))
51 2cnd 9380 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 2 ∈ ℂ)
52 simpll 531 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝐴 ∈ ℝ)
5352recnd 8355 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝐴 ∈ ℂ)
54 simplrl 541 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝑞 ∈ ℚ)
55 qre 10035 . . . . . . . . . . . . 13 (𝑞 ∈ ℚ → 𝑞 ∈ ℝ)
5654, 55syl 14 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝑞 ∈ ℝ)
5756recnd 8355 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝑞 ∈ ℂ)
5853, 57mulcld 8347 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝐴 · 𝑞) ∈ ℂ)
59 simplrr 542 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝑟 ∈ ℚ)
60 qre 10035 . . . . . . . . . . . . 13 (𝑟 ∈ ℚ → 𝑟 ∈ ℝ)
6159, 60syl 14 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝑟 ∈ ℝ)
6261recnd 8355 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝑟 ∈ ℂ)
6353, 62mulcld 8347 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝐴 · 𝑟) ∈ ℂ)
6451, 58, 63subdid 8743 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((2 · (𝐴 · 𝑞)) − (2 · (𝐴 · 𝑟))))
6553sqcld 11124 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝐴↑2) ∈ ℂ)
6651, 63mulcld 8347 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (2 · (𝐴 · 𝑟)) ∈ ℂ)
6751, 58mulcld 8347 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (2 · (𝐴 · 𝑞)) ∈ ℂ)
6865, 66, 67nnncan1d 8673 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((2 · (𝐴 · 𝑞)) − (2 · (𝐴 · 𝑟))))
69 simprr 537 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))
7052, 56resubcld 8710 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝐴 − 𝑞) ∈ ℝ)
7152, 61resubcld 8710 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝐴 − 𝑟) ∈ ℝ)
72 sqabs 11865 . . . . . . . . . . . . 13 (((𝐴 − 𝑞) ∈ ℝ ∧ (𝐴 − 𝑟) ∈ ℝ) → (((𝐴 − 𝑞)↑2) = ((𝐴 − 𝑟)↑2) ↔ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))))
7370, 71, 72syl2anc 415 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝐴 − 𝑞)↑2) = ((𝐴 − 𝑟)↑2) ↔ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))))
7469, 73mpbird 167 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝐴 − 𝑞)↑2) = ((𝐴 − 𝑟)↑2))
75 binom2sub 11105 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑞 ∈ ℂ) → ((𝐴 − 𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
7653, 57, 75syl2anc 415 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝐴 − 𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
77 binom2sub 11105 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑟 ∈ ℂ) → ((𝐴 − 𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7853, 62, 77syl2anc 415 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝐴 − 𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7974, 76, 783eqtr3d 2279 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
8065, 67subcld 8639 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝐴↑2) − (2 · (𝐴 · 𝑞))) ∈ ℂ)
8157sqcld 11124 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑞↑2) ∈ ℂ)
8265, 66subcld 8639 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝐴↑2) − (2 · (𝐴 · 𝑟))) ∈ ℂ)
8362sqcld 11124 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑟↑2) ∈ ℂ)
8480, 81, 82, 83addsubeq4d 8690 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)) ↔ (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((𝑞↑2) − (𝑟↑2))))
8579, 84mpbid 147 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((𝑞↑2) − (𝑟↑2)))
8664, 68, 853eqtr2d 2277 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((𝑞↑2) − (𝑟↑2)))
8781, 83subcld 8639 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝑞↑2) − (𝑟↑2)) ∈ ℂ)
8858, 63subcld 8639 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝐴 · 𝑞) − (𝐴 · 𝑟)) ∈ ℂ)
89 2ap0 9400 . . . . . . . . . 10 2 # 0
9089a1i 9 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 2 # 0)
9187, 51, 88, 90divmulapd 9145 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)) ↔ (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((𝑞↑2) − (𝑟↑2))))
9286, 91mpbird 167 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9353, 57, 62subdid 8743 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝐴 · (𝑞 − 𝑟)) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9492, 93eqtr4d 2274 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = (𝐴 · (𝑞 − 𝑟)))
9587halfcld 9555 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℂ)
9657, 62subcld 8639 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑞 − 𝑟) ∈ ℂ)
97 simprl 535 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝑞 ≠ 𝑟)
9857, 62, 97subne0d 8648 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑞 − 𝑟) ≠ 0)
99 qsubcl 10048 . . . . . . . . . 10 ((𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ) → (𝑞 − 𝑟) ∈ ℚ)
10054, 59, 99syl2anc 415 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑞 − 𝑟) ∈ ℚ)
101 0z 9660 . . . . . . . . . 10 0 ∈ ℤ
102 zq 10036 . . . . . . . . . 10 (0 ∈ ℤ → 0 ∈ ℚ)
103101, 102mp1i 10 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 0 ∈ ℚ)
104 qapne 10049 . . . . . . . . 9 (((𝑞 − 𝑟) ∈ ℚ ∧ 0 ∈ ℚ) → ((𝑞 − 𝑟) # 0 ↔ (𝑞 − 𝑟) ≠ 0))
105100, 103, 104syl2anc 415 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝑞 − 𝑟) # 0 ↔ (𝑞 − 𝑟) ≠ 0))
10698, 105mpbird 167 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑞 − 𝑟) # 0)
10795, 53, 96, 106divmulap3d 9158 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞 − 𝑟)) = 𝐴 ↔ (((𝑞↑2) − (𝑟↑2)) / 2) = (𝐴 · (𝑞 − 𝑟))))
10894, 107mpbird 167 . . . . 5 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞 − 𝑟)) = 𝐴)
109 qsqcl 11063 . . . . . . . . 9 (𝑞 ∈ ℚ → (𝑞↑2) ∈ ℚ)
11054, 109syl 14 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑞↑2) ∈ ℚ)
111 qsqcl 11063 . . . . . . . . 9 (𝑟 ∈ ℚ → (𝑟↑2) ∈ ℚ)
11259, 111syl 14 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (𝑟↑2) ∈ ℚ)
113 qsubcl 10048 . . . . . . . 8 (((𝑞↑2) ∈ ℚ ∧ (𝑟↑2) ∈ ℚ) → ((𝑞↑2) − (𝑟↑2)) ∈ ℚ)
114110, 112, 113syl2anc 415 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((𝑞↑2) − (𝑟↑2)) ∈ ℚ)
115 2z 9677 . . . . . . . 8 2 ∈ ℤ
116 zq 10036 . . . . . . . 8 (2 ∈ ℤ → 2 ∈ ℚ)
117115, 116mp1i 10 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 2 ∈ ℚ)
118 2ne0 9399 . . . . . . . 8 2 ≠ 0
119118a1i 9 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 2 ≠ 0)
120 qdivcl 10053 . . . . . . 7 ((((𝑞↑2) − (𝑟↑2)) ∈ ℚ ∧ 2 ∈ ℚ ∧ 2 ≠ 0) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ)
121114, 117, 119, 120syl3anc 1278 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ)
122 qdivcl 10053 . . . . . 6 (((((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ ∧ (𝑞 − 𝑟) ∈ ℚ ∧ (𝑞 − 𝑟) ≠ 0) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞 − 𝑟)) ∈ ℚ)
123121, 100, 98, 122syl3anc 1278 . . . . 5 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞 − 𝑟)) ∈ ℚ)
124108, 123eqeltrrd 2316 . . . 4 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))) → 𝐴 ∈ ℚ)
125124ex 115 . . 3 ((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) → ((𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))) → 𝐴 ∈ ℚ))
126125rexlimdvva 2676 . 2 (𝐴 ∈ ℝ → (∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟))) → 𝐴 ∈ ℚ))
12750, 126impbid2 143 1 (𝐴 ∈ ℝ → (𝐴 ∈ ℚ ↔ ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞 ≠ 𝑟 ∧ (abs‘(𝐴 − 𝑞)) = (abs‘(𝐴 − 𝑟)))))
Colors of variables:    wff set class
This proof depends on syntax axioms:   → wi 4   ∧ wa 104   ↔ wb 105   = wceq 1402   ∈ wcel 2209   ≠ wne 2420  ∃wrex 2529   class class class wbr 4130  ‘cfv 5377  (class class class)co 6085  ℂcc 8178  ℝcr 8179  0cc0 8180  1c1 8181   + caddc 8183   · cmul 8185   − cmin 8499  -cneg 8500   # cap 8912   / cdiv 9005  2c2 9358  ℤcz 9649  ℚcq 10029  ℝ+crp 10065  ↑cexp 10990  abscabs 11779
This proof depends on axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 623  ax-in2 624  ax-io 721  ax-5 1500  ax-7 1501  ax-gen 1502  ax-ie1 1546  ax-ie2 1547  ax-8 1557  ax-10 1558  ax-11 1559  ax-i12 1560  ax-bndl 1562  ax-4 1563  ax-17 1579  ax-i9 1583  ax-ial 1587  ax-i5r 1588  ax-14 2212  ax-ext 2220  ax-coll 4246  ax-sep 4249  ax-nul 4259  ax-pow 4311  ax-pr 4346  ax-un 4578  ax-setind 4684  ax-iinf 4735  ax-cnex 8271  ax-resscn 8272  ax-1cn 8273  ax-1re 8274  ax-icn 8275  ax-addcl 8276  ax-addrcl 8277  ax-mulcl 8278  ax-mulrcl 8279  ax-addcom 8280  ax-mulcom 8281  ax-addass 8282  ax-mulass 8283  ax-distr 8284  ax-i2m1 8285  ax-0lt1 8286  ax-1rid 8287  ax-0id 8288  ax-rnegex 8289  ax-precex 8290  ax-cnre 8291  ax-pre-ltirr 8292  ax-pre-ltwlin 8293  ax-pre-lttrn 8294  ax-pre-apti 8295  ax-pre-ltadd 8296  ax-pre-mulgt0 8297  ax-pre-mulext 8298  ax-arch 8299  ax-caucvg 8300
This proof depends on definitions:  df-bi 117  df-dc 847  df-3or 1010  df-3an 1011  df-tru 1405  df-fal 1408  df-nf 1514  df-sb 1816  df-eu 2089  df-mo 2090  df-clab 2225  df-cleq 2231  df-clel 2234  df-nfc 2381  df-ne 2421  df-nel 2516  df-ral 2533  df-rex 2534  df-reu 2535  df-rmo 2536  df-rab 2537  df-v 2823  df-sbc 3052  df-csb 3148  df-dif 3222  df-un 3224  df-in 3226  df-ss 3233  df-nul 3521  df-if 3639  df-pw 3690  df-sn 3715  df-pr 3716  df-op 3718  df-uni 3936  df-int 3971  df-iun 4014  df-br 4131  df-opab 4193  df-mpt 4194  df-tr 4230  df-id 4438  df-po 4441  df-iso 4442  df-iord 4511  df-on 4513  df-ilim 4514  df-suc 4516  df-iom 4738  df-xp 4780  df-rel 4781  df-cnv 4782  df-co 4783  df-dm 4784  df-rn 4785  df-res 4786  df-ima 4787  df-iota 5337  df-fun 5379  df-fn 5380  df-f 5381  df-f1 5382  df-fo 5383  df-f1o 5384  df-fv 5385  df-riota 6038  df-ov 6088  df-oprab 6089  df-mpo 6090  df-1st 6374  df-2nd 6375  df-recs 6576  df-frec 6662  df-pnf 8363  df-mnf 8364  df-xr 8365  df-ltxr 8366  df-le 8367  df-sub 8501  df-neg 8502  df-reap 8906  df-ap 8913  df-div 9006  df-inn 9308  df-2 9366  df-3 9367  df-4 9368  df-n0 9569  df-z 9650  df-uz 9932  df-q 10030  df-rp 10066  df-seqfrec 10900  df-exp 10991  df-cj 11623  df-re 11624  df-im 11625  df-rsqrt 11780  df-abs 11781
This theorem is used by: (None)
  Copyright terms: Public domain W3C validator