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

Theorem qdiff 37702
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 irrdiff 37701 but here proved with a proof which would also work in constructive mathematics. From an online post by Ingo Blechschmidt. For a proof using irrdiff 37701, see qdiffALT 37703. (Contributed by Jim Kingdon, 24-Apr-2026.)
Assertion
Ref Expression
qdiff (𝐴 ∈ ℝ → (𝐴 ∈ ℚ ↔ ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))))
Distinct variable group:   𝐴,𝑞,𝑟

Proof of Theorem qdiff
StepHypRef Expression
1 neeq1 2998 . . . . 5 (𝑞 = (𝐴 − 1) → (𝑞𝑟 ↔ (𝐴 − 1) ≠ 𝑟))
2 oveq2 7368 . . . . . 6 (𝑞 = (𝐴 − 1) → (𝐴𝑞) = (𝐴 − (𝐴 − 1)))
32fveqeq2d 6839 . . . . 5 (𝑞 = (𝐴 − 1) → ((abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
41, 3anbi12d 639 . . . 4 (𝑞 = (𝐴 − 1) → ((𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) ↔ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)))))
54rexbidv 3165 . . 3 (𝑞 = (𝐴 − 1) → (∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) ↔ ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)))))
6 1z 12552 . . . . 5 1 ∈ ℤ
7 zq 12899 . . . . 5 (1 ∈ ℤ → 1 ∈ ℚ)
86, 7ax-mp 5 . . . 4 1 ∈ ℚ
9 qsubcl 12913 . . . 4 ((𝐴 ∈ ℚ ∧ 1 ∈ ℚ) → (𝐴 − 1) ∈ ℚ)
108, 9mpan2 698 . . 3 (𝐴 ∈ ℚ → (𝐴 − 1) ∈ ℚ)
11 qaddcl 12910 . . . . 5 ((𝐴 ∈ ℚ ∧ 1 ∈ ℚ) → (𝐴 + 1) ∈ ℚ)
128, 11mpan2 698 . . . 4 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℚ)
13 qre 12898 . . . . . . . . . 10 (𝐴 ∈ ℚ → 𝐴 ∈ ℝ)
14 1rp 12941 . . . . . . . . . . . . 13 1 ∈ ℝ+
1514, 14pm3.2i 472 . . . . . . . . . . . 12 (1 ∈ ℝ+ ∧ 1 ∈ ℝ+)
16 rpaddcl 12961 . . . . . . . . . . . 12 ((1 ∈ ℝ+ ∧ 1 ∈ ℝ+) → (1 + 1) ∈ ℝ+)
1715, 16mp1i 13 . . . . . . . . . . 11 (𝐴 ∈ ℚ → (1 + 1) ∈ ℝ+)
1813, 17ltaddrpd 13014 . . . . . . . . . 10 (𝐴 ∈ ℚ → 𝐴 < (𝐴 + (1 + 1)))
1913, 18ltned 11277 . . . . . . . . 9 (𝐴 ∈ ℚ → 𝐴 ≠ (𝐴 + (1 + 1)))
2019neneqd 2941 . . . . . . . 8 (𝐴 ∈ ℚ → ¬ 𝐴 = (𝐴 + (1 + 1)))
2120neqcomd 2751 . . . . . . 7 (𝐴 ∈ ℚ → ¬ (𝐴 + (1 + 1)) = 𝐴)
22 qcn 12908 . . . . . . . . 9 (𝐴 ∈ ℚ → 𝐴 ∈ ℂ)
23 1cnd 11134 . . . . . . . . 9 (𝐴 ∈ ℚ → 1 ∈ ℂ)
2422, 23, 23addassd 11162 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴 + 1) + 1) = (𝐴 + (1 + 1)))
2524eqeq1d 2743 . . . . . . 7 (𝐴 ∈ ℚ → (((𝐴 + 1) + 1) = 𝐴 ↔ (𝐴 + (1 + 1)) = 𝐴))
2621, 25mtbird 327 . . . . . 6 (𝐴 ∈ ℚ → ¬ ((𝐴 + 1) + 1) = 𝐴)
2722, 23addcld 11159 . . . . . . 7 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℂ)
2822, 23, 27subadd2d 11519 . . . . . 6 (𝐴 ∈ ℚ → ((𝐴 − 1) = (𝐴 + 1) ↔ ((𝐴 + 1) + 1) = 𝐴))
2926, 28mtbird 327 . . . . 5 (𝐴 ∈ ℚ → ¬ (𝐴 − 1) = (𝐴 + 1))
3029neqned 2943 . . . 4 (𝐴 ∈ ℚ → (𝐴 − 1) ≠ (𝐴 + 1))
3123absnegd 15409 . . . . 5 (𝐴 ∈ ℚ → (abs‘-1) = (abs‘1))
3222, 22, 23subsub4d 11531 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = (𝐴 − (𝐴 + 1)))
3322subidd 11488 . . . . . . . . 9 (𝐴 ∈ ℚ → (𝐴𝐴) = 0)
3433oveq1d 7375 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = (0 − 1))
35 df-neg 11375 . . . . . . . 8 -1 = (0 − 1)
3634, 35eqtr4di 2794 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = -1)
3732, 36eqtr3d 2778 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 + 1)) = -1)
3837fveq2d 6835 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 + 1))) = (abs‘-1))
3922, 23nncand 11505 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 − 1)) = 1)
4039fveq2d 6835 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘1))
4131, 38, 403eqtr4rd 2787 . . . 4 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))
42 neeq2 2999 . . . . . 6 (𝑟 = (𝐴 + 1) → ((𝐴 − 1) ≠ 𝑟 ↔ (𝐴 − 1) ≠ (𝐴 + 1)))
43 oveq2 7368 . . . . . . . 8 (𝑟 = (𝐴 + 1) → (𝐴𝑟) = (𝐴 − (𝐴 + 1)))
4443fveq2d 6835 . . . . . . 7 (𝑟 = (𝐴 + 1) → (abs‘(𝐴𝑟)) = (abs‘(𝐴 − (𝐴 + 1))))
4544eqeq2d 2752 . . . . . 6 (𝑟 = (𝐴 + 1) → ((abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1)))))
4642, 45anbi12d 639 . . . . 5 (𝑟 = (𝐴 + 1) → (((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))) ↔ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))))
4746rspcev 3562 . . . 4 (((𝐴 + 1) ∈ ℚ ∧ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))) → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
4812, 30, 41, 47syl12anc 843 . . 3 (𝐴 ∈ ℚ → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
495, 10, 48rspcedvdw 3565 . 2 (𝐴 ∈ ℚ → ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
50 2cnd 12254 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 ∈ ℂ)
51 simpll 773 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℝ)
5251recnd 11168 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℂ)
53 simplrl 783 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℚ)
5453qred 12900 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℝ)
5554recnd 11168 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℂ)
5652, 55mulcld 11160 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · 𝑞) ∈ ℂ)
57 simplrr 784 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑟 ∈ ℚ)
5857qred 12900 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑟 ∈ ℝ)
5958recnd 11168 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑟 ∈ ℂ)
6052, 59mulcld 11160 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · 𝑟) ∈ ℂ)
6150, 56, 60subdid 11601 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((2 · (𝐴 · 𝑞)) − (2 · (𝐴 · 𝑟))))
6252sqcld 14101 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴↑2) ∈ ℂ)
6350, 60mulcld 11160 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · (𝐴 · 𝑟)) ∈ ℂ)
6450, 56mulcld 11160 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · (𝐴 · 𝑞)) ∈ ℂ)
6562, 63, 64nnncan1d 11534 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((2 · (𝐴 · 𝑞)) − (2 · (𝐴 · 𝑟))))
66 simprr 779 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))
6751, 54resubcld 11573 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴𝑞) ∈ ℝ)
6851, 58resubcld 11573 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴𝑟) ∈ ℝ)
69 sqabs 15264 . . . . . . . . . . . . 13 (((𝐴𝑞) ∈ ℝ ∧ (𝐴𝑟) ∈ ℝ) → (((𝐴𝑞)↑2) = ((𝐴𝑟)↑2) ↔ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
7067, 68, 69syl2anc 591 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴𝑞)↑2) = ((𝐴𝑟)↑2) ↔ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
7166, 70mpbird 259 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑞)↑2) = ((𝐴𝑟)↑2))
72 binom2sub 14177 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑞 ∈ ℂ) → ((𝐴𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
7352, 55, 72syl2anc 591 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
74 binom2sub 14177 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑟 ∈ ℂ) → ((𝐴𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7552, 59, 74syl2anc 591 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7671, 73, 753eqtr3d 2784 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7762, 64subcld 11500 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴↑2) − (2 · (𝐴 · 𝑞))) ∈ ℂ)
7855sqcld 14101 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞↑2) ∈ ℂ)
7962, 63subcld 11500 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴↑2) − (2 · (𝐴 · 𝑟))) ∈ ℂ)
8059sqcld 14101 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑟↑2) ∈ ℂ)
8177, 78, 79, 80addsubeq4d 11551 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)) ↔ (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((𝑞↑2) − (𝑟↑2))))
8276, 81mpbid 234 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((𝑞↑2) − (𝑟↑2)))
8361, 65, 823eqtr2d 2782 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((𝑞↑2) − (𝑟↑2)))
8478, 80subcld 11500 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝑞↑2) − (𝑟↑2)) ∈ ℂ)
8556, 60subcld 11500 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴 · 𝑞) − (𝐴 · 𝑟)) ∈ ℂ)
86 2ne0 12280 . . . . . . . . . 10 2 ≠ 0
8786a1i 11 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 ≠ 0)
8884, 50, 85, 87divmuld 11948 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)) ↔ (2 · ((𝐴 · 𝑞) − (𝐴 · 𝑟))) = ((𝑞↑2) − (𝑟↑2))))
8983, 88mpbird 259 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9052, 55, 59subdid 11601 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · (𝑞𝑟)) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9189, 90eqtr4d 2779 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = (𝐴 · (𝑞𝑟)))
9284halfcld 12417 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℂ)
9355, 59subcld 11500 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ∈ ℂ)
94 simprl 777 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞𝑟)
9555, 59, 94subne0d 11509 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ≠ 0)
9692, 52, 93, 95divmul3d 11960 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) = 𝐴 ↔ (((𝑞↑2) − (𝑟↑2)) / 2) = (𝐴 · (𝑞𝑟))))
9791, 96mpbird 259 . . . . 5 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) = 𝐴)
98 qsqcl 14087 . . . . . . . . 9 (𝑞 ∈ ℚ → (𝑞↑2) ∈ ℚ)
9953, 98syl 17 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞↑2) ∈ ℚ)
100 qsqcl 14087 . . . . . . . . 9 (𝑟 ∈ ℚ → (𝑟↑2) ∈ ℚ)
10157, 100syl 17 . . . . . . . 8 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑟↑2) ∈ ℚ)
102 qsubcl 12913 . . . . . . . 8 (((𝑞↑2) ∈ ℚ ∧ (𝑟↑2) ∈ ℚ) → ((𝑞↑2) − (𝑟↑2)) ∈ ℚ)
10399, 101, 102syl2anc 591 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝑞↑2) − (𝑟↑2)) ∈ ℚ)
104 2z 12554 . . . . . . . 8 2 ∈ ℤ
105 zq 12899 . . . . . . . 8 (2 ∈ ℤ → 2 ∈ ℚ)
106104, 105mp1i 13 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 ∈ ℚ)
107 qdivcl 12915 . . . . . . 7 ((((𝑞↑2) − (𝑟↑2)) ∈ ℚ ∧ 2 ∈ ℚ ∧ 2 ≠ 0) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ)
108103, 106, 87, 107syl3anc 1380 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ)
109 qsubcl 12913 . . . . . . 7 ((𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ) → (𝑞𝑟) ∈ ℚ)
11053, 57, 109syl2anc 591 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ∈ ℚ)
111 qdivcl 12915 . . . . . 6 (((((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ ∧ (𝑞𝑟) ∈ ℚ ∧ (𝑞𝑟) ≠ 0) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) ∈ ℚ)
112108, 110, 95, 111syl3anc 1380 . . . . 5 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) ∈ ℚ)
11397, 112eqeltrrd 2842 . . . 4 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℚ)
114113ex 414 . . 3 ((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) → ((𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) → 𝐴 ∈ ℚ))
115114rexlimdvva 3198 . 2 (𝐴 ∈ ℝ → (∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) → 𝐴 ∈ ℚ))
11649, 115impbid2 228 1 (𝐴 ∈ ℝ → (𝐴 ∈ ℚ ↔ ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 208  wa 397   = wceq 1548  wcel 2121  wne 2936  wrex 3065  cfv 6489  (class class class)co 7360  cc 11031  cr 11032  0cc0 11033  1c1 11034   + caddc 11036   · cmul 11038  cmin 11372  -cneg 11373   / cdiv 11802  2c2 12231  cz 12519  cq 12893  +crp 12937  cexp 14018  abscabs 15191
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1803  ax-4 1817  ax-5 1918  ax-6 1975  ax-7 2016  ax-8 2123  ax-9 2131  ax-10 2154  ax-11 2170  ax-12 2191  ax-ext 2713  ax-sep 5221  ax-nul 5231  ax-pow 5297  ax-pr 5365  ax-un 7682  ax-cnex 11089  ax-resscn 11090  ax-1cn 11091  ax-icn 11092  ax-addcl 11093  ax-addrcl 11094  ax-mulcl 11095  ax-mulrcl 11096  ax-mulcom 11097  ax-addass 11098  ax-mulass 11099  ax-distr 11100  ax-i2m1 11101  ax-1ne0 11102  ax-1rid 11103  ax-rnegex 11104  ax-rrecex 11105  ax-cnre 11106  ax-pre-lttri 11107  ax-pre-lttrn 11108  ax-pre-ltadd 11109  ax-pre-mulgt0 11110  ax-pre-sup 11111
This theorem depends on definitions:  df-bi 209  df-an 398  df-or 855  df-3or 1094  df-3an 1095  df-tru 1551  df-fal 1561  df-ex 1788  df-nf 1792  df-sb 2075  df-mo 2545  df-eu 2575  df-clab 2720  df-cleq 2733  df-clel 2816  df-nfc 2890  df-ne 2937  df-nel 3041  df-ral 3056  df-rex 3066  df-rmo 3346  df-reu 3347  df-rab 3394  df-v 3435  df-sbc 3726  df-csb 3834  df-dif 3888  df-un 3890  df-in 3892  df-ss 3902  df-pss 3905  df-nul 4265  df-if 4458  df-pw 4534  df-sn 4559  df-pr 4561  df-op 4565  df-uni 4842  df-iun 4926  df-br 5076  df-opab 5138  df-mpt 5157  df-tr 5183  df-id 5516  df-eprel 5521  df-po 5529  df-so 5530  df-fr 5574  df-we 5576  df-xp 5627  df-rel 5628  df-cnv 5629  df-co 5630  df-dm 5631  df-rn 5632  df-res 5633  df-ima 5634  df-pred 6256  df-ord 6317  df-on 6318  df-lim 6319  df-suc 6320  df-iota 6445  df-fun 6491  df-fn 6492  df-f 6493  df-f1 6494  df-fo 6495  df-f1o 6496  df-fv 6497  df-riota 7317  df-ov 7363  df-oprab 7364  df-mpo 7365  df-om 7811  df-1st 7935  df-2nd 7936  df-frecs 8225  df-wrecs 8256  df-recs 8305  df-rdg 8343  df-er 8637  df-en 8888  df-dom 8889  df-sdom 8890  df-sup 9349  df-pnf 11176  df-mnf 11177  df-xr 11178  df-ltxr 11179  df-le 11180  df-sub 11374  df-neg 11375  df-div 11803  df-nn 12170  df-2 12239  df-3 12240  df-n0 12433  df-z 12520  df-uz 12784  df-q 12894  df-rp 12938  df-seq 13959  df-exp 14019  df-cj 15056  df-re 15057  df-im 15058  df-sqrt 15192  df-abs 15193
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator