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

Theorem qdiff 16833
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 16832 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 9603 . . . . 5 1 ∈ ℤ
2 zq 9958 . . . . 5 (1 ∈ ℤ → 1 ∈ ℚ)
31, 2ax-mp 5 . . . 4 1 ∈ ℚ
4 qsubcl 9970 . . . 4 ((𝐴 ∈ ℚ ∧ 1 ∈ ℚ) → (𝐴 − 1) ∈ ℚ)
53, 4mpan2 425 . . 3 (𝐴 ∈ ℚ → (𝐴 − 1) ∈ ℚ)
6 qaddcl 9967 . . . . 5 ((𝐴 ∈ ℚ ∧ 1 ∈ ℚ) → (𝐴 + 1) ∈ ℚ)
73, 6mpan2 425 . . . 4 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℚ)
8 qre 9957 . . . . . . . . . 10 (𝐴 ∈ ℚ → 𝐴 ∈ ℝ)
9 1rp 9990 . . . . . . . . . . . . 13 1 ∈ ℝ+
109, 9pm3.2i 272 . . . . . . . . . . . 12 (1 ∈ ℝ+ ∧ 1 ∈ ℝ+)
11 rpaddcl 10010 . . . . . . . . . . . 12 ((1 ∈ ℝ+ ∧ 1 ∈ ℝ+) → (1 + 1) ∈ ℝ+)
1210, 11mp1i 10 . . . . . . . . . . 11 (𝐴 ∈ ℚ → (1 + 1) ∈ ℝ+)
138, 12ltaddrpd 10063 . . . . . . . . . 10 (𝐴 ∈ ℚ → 𝐴 < (𝐴 + (1 + 1)))
148, 13ltned 8387 . . . . . . . . 9 (𝐴 ∈ ℚ → 𝐴 ≠ (𝐴 + (1 + 1)))
1514neneqd 2433 . . . . . . . 8 (𝐴 ∈ ℚ → ¬ 𝐴 = (𝐴 + (1 + 1)))
1615neqcomd 2237 . . . . . . 7 (𝐴 ∈ ℚ → ¬ (𝐴 + (1 + 1)) = 𝐴)
17 qcn 9966 . . . . . . . . 9 (𝐴 ∈ ℚ → 𝐴 ∈ ℂ)
18 1cnd 8290 . . . . . . . . 9 (𝐴 ∈ ℚ → 1 ∈ ℂ)
1917, 18, 18addassd 8296 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴 + 1) + 1) = (𝐴 + (1 + 1)))
2019eqeq1d 2241 . . . . . . 7 (𝐴 ∈ ℚ → (((𝐴 + 1) + 1) = 𝐴 ↔ (𝐴 + (1 + 1)) = 𝐴))
2116, 20mtbird 680 . . . . . 6 (𝐴 ∈ ℚ → ¬ ((𝐴 + 1) + 1) = 𝐴)
2217, 18addcld 8293 . . . . . . 7 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℂ)
2317, 18, 22subadd2d 8603 . . . . . 6 (𝐴 ∈ ℚ → ((𝐴 − 1) = (𝐴 + 1) ↔ ((𝐴 + 1) + 1) = 𝐴))
2421, 23mtbird 680 . . . . 5 (𝐴 ∈ ℚ → ¬ (𝐴 − 1) = (𝐴 + 1))
2524neqned 2419 . . . 4 (𝐴 ∈ ℚ → (𝐴 − 1) ≠ (𝐴 + 1))
2618absnegd 11874 . . . . 5 (𝐴 ∈ ℚ → (abs‘-1) = (abs‘1))
2717, 17, 18subsub4d 8615 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = (𝐴 − (𝐴 + 1)))
2817subidd 8572 . . . . . . . . 9 (𝐴 ∈ ℚ → (𝐴𝐴) = 0)
2928oveq1d 6065 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = (0 − 1))
30 df-neg 8447 . . . . . . . 8 -1 = (0 − 1)
3129, 30eqtr4di 2283 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = -1)
3227, 31eqtr3d 2267 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 + 1)) = -1)
3332fveq2d 5674 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 + 1))) = (abs‘-1))
3417, 18nncand 8589 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 − 1)) = 1)
3534fveq2d 5674 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘1))
3626, 33, 353eqtr4rd 2276 . . . 4 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))
37 neeq2 2426 . . . . . 6 (𝑟 = (𝐴 + 1) → ((𝐴 − 1) ≠ 𝑟 ↔ (𝐴 − 1) ≠ (𝐴 + 1)))
38 oveq2 6058 . . . . . . . 8 (𝑟 = (𝐴 + 1) → (𝐴𝑟) = (𝐴 − (𝐴 + 1)))
3938fveq2d 5674 . . . . . . 7 (𝑟 = (𝐴 + 1) → (abs‘(𝐴𝑟)) = (abs‘(𝐴 − (𝐴 + 1))))
4039eqeq2d 2244 . . . . . 6 (𝑟 = (𝐴 + 1) → ((abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1)))))
4137, 40anbi12d 473 . . . . 5 (𝑟 = (𝐴 + 1) → (((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))) ↔ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))))
4241rspcev 2921 . . . 4 (((𝐴 + 1) ∈ ℚ ∧ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))) → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
437, 25, 36, 42syl12anc 1272 . . 3 (𝐴 ∈ ℚ → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
44 neeq1 2425 . . . . . 6 (𝑞 = (𝐴 − 1) → (𝑞𝑟 ↔ (𝐴 − 1) ≠ 𝑟))
45 oveq2 6058 . . . . . . 7 (𝑞 = (𝐴 − 1) → (𝐴𝑞) = (𝐴 − (𝐴 − 1)))
4645fveqeq2d 5678 . . . . . 6 (𝑞 = (𝐴 − 1) → ((abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
4744, 46anbi12d 473 . . . . 5 (𝑞 = (𝐴 − 1) → ((𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) ↔ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)))))
4847rexbidv 2543 . . . 4 (𝑞 = (𝐴 − 1) → (∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) ↔ ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)))))
4948rspcev 2921 . . 3 (((𝐴 − 1) ∈ ℚ ∧ ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)))) → ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
505, 43, 49syl2anc 411 . 2 (𝐴 ∈ ℚ → ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
51 2cnd 9310 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 ∈ ℂ)
52 simpll 527 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℝ)
5352recnd 8302 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℂ)
54 simplrl 537 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℚ)
55 qre 9957 . . . . . . . . . . . . 13 (𝑞 ∈ ℚ → 𝑞 ∈ ℝ)
5654, 55syl 14 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℝ)
5756recnd 8302 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℂ)
5853, 57mulcld 8294 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · 𝑞) ∈ ℂ)
59 simplrr 538 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑟 ∈ ℚ)
60 qre 9957 . . . . . . . . . . . . 13 (𝑟 ∈ ℚ → 𝑟 ∈ ℝ)
6159, 60syl 14 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑟 ∈ ℝ)
6261recnd 8302 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑟 ∈ ℂ)
6353, 62mulcld 8294 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · 𝑟) ∈ ℂ)
6451, 58, 63subdid 8687 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((2 · (𝐴 · 𝑞)) − (2 · (𝐴 · 𝑟))))
6553sqcld 11033 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴↑2) ∈ ℂ)
6651, 63mulcld 8294 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · (𝐴 · 𝑟)) ∈ ℂ)
6751, 58mulcld 8294 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · (𝐴 · 𝑞)) ∈ ℂ)
6865, 66, 67nnncan1d 8618 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((2 · (𝐴 · 𝑞)) − (2 · (𝐴 · 𝑟))))
69 simprr 533 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))
7052, 56resubcld 8654 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴𝑞) ∈ ℝ)
7152, 61resubcld 8654 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴𝑟) ∈ ℝ)
72 sqabs 11767 . . . . . . . . . . . . 13 (((𝐴𝑞) ∈ ℝ ∧ (𝐴𝑟) ∈ ℝ) → (((𝐴𝑞)↑2) = ((𝐴𝑟)↑2) ↔ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
7370, 71, 72syl2anc 411 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴𝑞)↑2) = ((𝐴𝑟)↑2) ↔ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
7469, 73mpbird 167 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑞)↑2) = ((𝐴𝑟)↑2))
75 binom2sub 11015 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑞 ∈ ℂ) → ((𝐴𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
7653, 57, 75syl2anc 411 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
77 binom2sub 11015 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑟 ∈ ℂ) → ((𝐴𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7853, 62, 77syl2anc 411 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7974, 76, 783eqtr3d 2273 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
8065, 67subcld 8584 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴↑2) − (2 · (𝐴 · 𝑞))) ∈ ℂ)
8157sqcld 11033 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞↑2) ∈ ℂ)
8265, 66subcld 8584 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴↑2) − (2 · (𝐴 · 𝑟))) ∈ ℂ)
8362sqcld 11033 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑟↑2) ∈ ℂ)
8480, 81, 82, 83addsubeq4d 8635 . . . . . . . . . 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 2271 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((𝑞↑2) − (𝑟↑2)))
8781, 83subcld 8584 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝑞↑2) − (𝑟↑2)) ∈ ℂ)
8858, 63subcld 8584 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴 · 𝑞) − (𝐴 · 𝑟)) ∈ ℂ)
89 2ap0 9330 . . . . . . . . . 10 2 # 0
9089a1i 9 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 # 0)
9187, 51, 88, 90divmulapd 9086 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)) ↔ (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((𝑞↑2) − (𝑟↑2))))
9286, 91mpbird 167 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9353, 57, 62subdid 8687 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · (𝑞𝑟)) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9492, 93eqtr4d 2268 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = (𝐴 · (𝑞𝑟)))
9587halfcld 9483 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℂ)
9657, 62subcld 8584 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ∈ ℂ)
97 simprl 531 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞𝑟)
9857, 62, 97subne0d 8593 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ≠ 0)
99 qsubcl 9970 . . . . . . . . . 10 ((𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ) → (𝑞𝑟) ∈ ℚ)
10054, 59, 99syl2anc 411 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ∈ ℚ)
101 0z 9588 . . . . . . . . . 10 0 ∈ ℤ
102 zq 9958 . . . . . . . . . 10 (0 ∈ ℤ → 0 ∈ ℚ)
103101, 102mp1i 10 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 0 ∈ ℚ)
104 qapne 9971 . . . . . . . . 9 (((𝑞𝑟) ∈ ℚ ∧ 0 ∈ ℚ) → ((𝑞𝑟) # 0 ↔ (𝑞𝑟) ≠ 0))
105100, 103, 104syl2anc 411 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝑞𝑟) # 0 ↔ (𝑞𝑟) ≠ 0))
10698, 105mpbird 167 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) # 0)
10795, 53, 96, 106divmulap3d 9099 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) = 𝐴 ↔ (((𝑞↑2) − (𝑟↑2)) / 2) = (𝐴 · (𝑞𝑟))))
10894, 107mpbird 167 . . . . 5 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) = 𝐴)
109 qsqcl 10973 . . . . . . . . 9 (𝑞 ∈ ℚ → (𝑞↑2) ∈ ℚ)
11054, 109syl 14 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞↑2) ∈ ℚ)
111 qsqcl 10973 . . . . . . . . 9 (𝑟 ∈ ℚ → (𝑟↑2) ∈ ℚ)
11259, 111syl 14 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑟↑2) ∈ ℚ)
113 qsubcl 9970 . . . . . . . 8 (((𝑞↑2) ∈ ℚ ∧ (𝑟↑2) ∈ ℚ) → ((𝑞↑2) − (𝑟↑2)) ∈ ℚ)
114110, 112, 113syl2anc 411 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝑞↑2) − (𝑟↑2)) ∈ ℚ)
115 2z 9605 . . . . . . . 8 2 ∈ ℤ
116 zq 9958 . . . . . . . 8 (2 ∈ ℤ → 2 ∈ ℚ)
117115, 116mp1i 10 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 ∈ ℚ)
118 2ne0 9329 . . . . . . . 8 2 ≠ 0
119118a1i 9 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 ≠ 0)
120 qdivcl 9975 . . . . . . 7 ((((𝑞↑2) − (𝑟↑2)) ∈ ℚ ∧ 2 ∈ ℚ ∧ 2 ≠ 0) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ)
121114, 117, 119, 120syl3anc 1274 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ)
122 qdivcl 9975 . . . . . 6 (((((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ ∧ (𝑞𝑟) ∈ ℚ ∧ (𝑞𝑟) ≠ 0) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) ∈ ℚ)
123121, 100, 98, 122syl3anc 1274 . . . . 5 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) ∈ ℚ)
124108, 123eqeltrrd 2310 . . . 4 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℚ)
125124ex 115 . . 3 ((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) → ((𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) → 𝐴 ∈ ℚ))
126125rexlimdvva 2668 . 2 (𝐴 ∈ ℝ → (∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) → 𝐴 ∈ ℚ))
12750, 126impbid2 143 1 (𝐴 ∈ ℝ → (𝐴 ∈ ℚ ↔ ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))))
Colors of variables: wff set class
Syntax hints:  wi 4  wa 104  wb 105   = wceq 1398  wcel 2203  wne 2412  wrex 2521   class class class wbr 4109  cfv 5352  (class class class)co 6050  cc 8125  cr 8126  0cc0 8127  1c1 8128   + caddc 8130   · cmul 8132  cmin 8444  -cneg 8445   # cap 8855   / cdiv 8946  2c2 9288  cz 9577  cq 9951  +crp 9986  cexp 10900  abscabs 11682
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 619  ax-in2 620  ax-io 717  ax-5 1496  ax-7 1497  ax-gen 1498  ax-ie1 1542  ax-ie2 1543  ax-8 1553  ax-10 1554  ax-11 1555  ax-i12 1556  ax-bndl 1558  ax-4 1559  ax-17 1575  ax-i9 1579  ax-ial 1583  ax-i5r 1584  ax-13 2205  ax-14 2206  ax-ext 2214  ax-coll 4225  ax-sep 4228  ax-nul 4236  ax-pow 4287  ax-pr 4322  ax-un 4554  ax-setind 4659  ax-iinf 4710  ax-cnex 8218  ax-resscn 8219  ax-1cn 8220  ax-1re 8221  ax-icn 8222  ax-addcl 8223  ax-addrcl 8224  ax-mulcl 8225  ax-mulrcl 8226  ax-addcom 8227  ax-mulcom 8228  ax-addass 8229  ax-mulass 8230  ax-distr 8231  ax-i2m1 8232  ax-0lt1 8233  ax-1rid 8234  ax-0id 8235  ax-rnegex 8236  ax-precex 8237  ax-cnre 8238  ax-pre-ltirr 8239  ax-pre-ltwlin 8240  ax-pre-lttrn 8241  ax-pre-apti 8242  ax-pre-ltadd 8243  ax-pre-mulgt0 8244  ax-pre-mulext 8245  ax-arch 8246  ax-caucvg 8247
This theorem depends on definitions:  df-bi 117  df-dc 843  df-3or 1006  df-3an 1007  df-tru 1401  df-fal 1404  df-nf 1510  df-sb 1812  df-eu 2083  df-mo 2084  df-clab 2219  df-cleq 2225  df-clel 2228  df-nfc 2373  df-ne 2413  df-nel 2508  df-ral 2525  df-rex 2526  df-reu 2527  df-rmo 2528  df-rab 2529  df-v 2815  df-sbc 3043  df-csb 3139  df-dif 3213  df-un 3215  df-in 3217  df-ss 3224  df-nul 3509  df-if 3621  df-pw 3671  df-sn 3695  df-pr 3696  df-op 3698  df-uni 3915  df-int 3950  df-iun 3993  df-br 4110  df-opab 4172  df-mpt 4173  df-tr 4209  df-id 4414  df-po 4417  df-iso 4418  df-iord 4487  df-on 4489  df-ilim 4490  df-suc 4492  df-iom 4713  df-xp 4755  df-rel 4756  df-cnv 4757  df-co 4758  df-dm 4759  df-rn 4760  df-res 4761  df-ima 4762  df-iota 5312  df-fun 5354  df-fn 5355  df-f 5356  df-f1 5357  df-fo 5358  df-f1o 5359  df-fv 5360  df-riota 6003  df-ov 6053  df-oprab 6054  df-mpo 6055  df-1st 6334  df-2nd 6335  df-recs 6536  df-frec 6622  df-pnf 8310  df-mnf 8311  df-xr 8312  df-ltxr 8313  df-le 8314  df-sub 8446  df-neg 8447  df-reap 8849  df-ap 8856  df-div 8947  df-inn 9238  df-2 9296  df-3 9297  df-4 9298  df-n0 9497  df-z 9578  df-uz 9854  df-q 9952  df-rp 9987  df-seqfrec 10810  df-exp 10901  df-cj 11527  df-re 11528  df-im 11529  df-rsqrt 11683  df-abs 11684
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator