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 37661
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 37660 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 37660, see qdiffALT 37662. (Contributed by Jim Kingdon, 24-Apr-2026.)
Assertion
Ref Expression
qdiff (𝐴 ∈ ℝ → (𝐴 ∈ ℚ ↔ ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))))
Distinct variable group:   𝐴,𝑞,𝑟

Proof of Theorem qdiff
StepHypRef Expression
1 neeq1 2995 . . . . 5 (𝑞 = (𝐴 − 1) → (𝑞𝑟 ↔ (𝐴 − 1) ≠ 𝑟))
2 oveq2 7370 . . . . . 6 (𝑞 = (𝐴 − 1) → (𝐴𝑞) = (𝐴 − (𝐴 − 1)))
32fveqeq2d 6844 . . . . 5 (𝑞 = (𝐴 − 1) → ((abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
41, 3anbi12d 633 . . . 4 (𝑞 = (𝐴 − 1) → ((𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) ↔ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)))))
54rexbidv 3162 . . 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 692 . . 3 (𝐴 ∈ ℚ → (𝐴 − 1) ∈ ℚ)
11 qaddcl 12910 . . . . 5 ((𝐴 ∈ ℚ ∧ 1 ∈ ℚ) → (𝐴 + 1) ∈ ℚ)
128, 11mpan2 692 . . . 4 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℚ)
13 qre 12898 . . . . . . . . . 10 (𝐴 ∈ ℚ → 𝐴 ∈ ℝ)
14 1rp 12941 . . . . . . . . . . . . 13 1 ∈ ℝ+
1514, 14pm3.2i 470 . . . . . . . . . . . 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 2938 . . . . . . . 8 (𝐴 ∈ ℚ → ¬ 𝐴 = (𝐴 + (1 + 1)))
2120neqcomd 2747 . . . . . . 7 (𝐴 ∈ ℚ → ¬ (𝐴 + (1 + 1)) = 𝐴)
22 qcn 12908 . . . . . . . . 9 (𝐴 ∈ ℚ → 𝐴 ∈ ℂ)
23 1cnd 11134 . . . . . . . . 9 (𝐴 ∈ ℚ → 1 ∈ ℂ)
2422, 23, 23addassd 11162 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴 + 1) + 1) = (𝐴 + (1 + 1)))
2524eqeq1d 2739 . . . . . . 7 (𝐴 ∈ ℚ → (((𝐴 + 1) + 1) = 𝐴 ↔ (𝐴 + (1 + 1)) = 𝐴))
2621, 25mtbird 325 . . . . . 6 (𝐴 ∈ ℚ → ¬ ((𝐴 + 1) + 1) = 𝐴)
2722, 23addcld 11159 . . . . . . 7 (𝐴 ∈ ℚ → (𝐴 + 1) ∈ ℂ)
2822, 23, 27subadd2d 11519 . . . . . 6 (𝐴 ∈ ℚ → ((𝐴 − 1) = (𝐴 + 1) ↔ ((𝐴 + 1) + 1) = 𝐴))
2926, 28mtbird 325 . . . . 5 (𝐴 ∈ ℚ → ¬ (𝐴 − 1) = (𝐴 + 1))
3029neqned 2940 . . . 4 (𝐴 ∈ ℚ → (𝐴 − 1) ≠ (𝐴 + 1))
3123absnegd 15409 . . . . 5 (𝐴 ∈ ℚ → (abs‘-1) = (abs‘1))
3222, 22, 23subsub4d 11531 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = (𝐴 − (𝐴 + 1)))
3322subidd 11488 . . . . . . . . 9 (𝐴 ∈ ℚ → (𝐴𝐴) = 0)
3433oveq1d 7377 . . . . . . . 8 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = (0 − 1))
35 df-neg 11375 . . . . . . . 8 -1 = (0 − 1)
3634, 35eqtr4di 2790 . . . . . . 7 (𝐴 ∈ ℚ → ((𝐴𝐴) − 1) = -1)
3732, 36eqtr3d 2774 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 + 1)) = -1)
3837fveq2d 6840 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 + 1))) = (abs‘-1))
3922, 23nncand 11505 . . . . . 6 (𝐴 ∈ ℚ → (𝐴 − (𝐴 − 1)) = 1)
4039fveq2d 6840 . . . . 5 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘1))
4131, 38, 403eqtr4rd 2783 . . . 4 (𝐴 ∈ ℚ → (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))
42 neeq2 2996 . . . . . 6 (𝑟 = (𝐴 + 1) → ((𝐴 − 1) ≠ 𝑟 ↔ (𝐴 − 1) ≠ (𝐴 + 1)))
43 oveq2 7370 . . . . . . . 8 (𝑟 = (𝐴 + 1) → (𝐴𝑟) = (𝐴 − (𝐴 + 1)))
4443fveq2d 6840 . . . . . . 7 (𝑟 = (𝐴 + 1) → (abs‘(𝐴𝑟)) = (abs‘(𝐴 − (𝐴 + 1))))
4544eqeq2d 2748 . . . . . 6 (𝑟 = (𝐴 + 1) → ((abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟)) ↔ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1)))))
4642, 45anbi12d 633 . . . . 5 (𝑟 = (𝐴 + 1) → (((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))) ↔ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))))
4746rspcev 3565 . . . 4 (((𝐴 + 1) ∈ ℚ ∧ ((𝐴 − 1) ≠ (𝐴 + 1) ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴 − (𝐴 + 1))))) → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
4812, 30, 41, 47syl12anc 837 . . 3 (𝐴 ∈ ℚ → ∃𝑟 ∈ ℚ ((𝐴 − 1) ≠ 𝑟 ∧ (abs‘(𝐴 − (𝐴 − 1))) = (abs‘(𝐴𝑟))))
495, 10, 48rspcedvdw 3568 . 2 (𝐴 ∈ ℚ → ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
50 2cnd 12254 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 2 ∈ ℂ)
51 simpll 767 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℝ)
5251recnd 11168 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℂ)
53 simplrl 777 . . . . . . . . . . . . 13 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℚ)
5453qred 12900 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℝ)
5554recnd 11168 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝑞 ∈ ℂ)
5652, 55mulcld 11160 . . . . . . . . . 10 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · 𝑞) ∈ ℂ)
57 simplrr 778 . . . . . . . . . . . . 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 773 . . . . . . . . . . . 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 585 . . . . . . . . . . . 12 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴𝑞)↑2) = ((𝐴𝑟)↑2) ↔ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))))
7166, 70mpbird 257 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑞)↑2) = ((𝐴𝑟)↑2))
72 binom2sub 14177 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑞 ∈ ℂ) → ((𝐴𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
7352, 55, 72syl2anc 585 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑞)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑞))) + (𝑞↑2)))
74 binom2sub 14177 . . . . . . . . . . . 12 ((𝐴 ∈ ℂ ∧ 𝑟 ∈ ℂ) → ((𝐴𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7552, 59, 74syl2anc 585 . . . . . . . . . . 11 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((𝐴𝑟)↑2) = (((𝐴↑2) − (2 · (𝐴 · 𝑟))) + (𝑟↑2)))
7671, 73, 753eqtr3d 2780 . . . . . . . . . 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 232 . . . . . . . . 9 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝐴↑2) − (2 · (𝐴 · 𝑟))) − ((𝐴↑2) − (2 · (𝐴 · 𝑞)))) = ((𝑞↑2) − (𝑟↑2)))
8361, 65, 823eqtr2d 2778 . . . . . . . 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 257 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9052, 55, 59subdid 11601 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝐴 · (𝑞𝑟)) = ((𝐴 · 𝑞) − (𝐴 · 𝑟)))
9189, 90eqtr4d 2775 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) = (𝐴 · (𝑞𝑟)))
9284halfcld 12417 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℂ)
9355, 59subcld 11500 . . . . . . 7 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ∈ ℂ)
94 simprl 771 . . . . . . . 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 257 . . . . 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 585 . . . . . . 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 1374 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ)
109 qsubcl 12913 . . . . . . 7 ((𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ) → (𝑞𝑟) ∈ ℚ)
11053, 57, 109syl2anc 585 . . . . . 6 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → (𝑞𝑟) ∈ ℚ)
111 qdivcl 12915 . . . . . 6 (((((𝑞↑2) − (𝑟↑2)) / 2) ∈ ℚ ∧ (𝑞𝑟) ∈ ℚ ∧ (𝑞𝑟) ≠ 0) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) ∈ ℚ)
112108, 110, 95, 111syl3anc 1374 . . . . 5 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → ((((𝑞↑2) − (𝑟↑2)) / 2) / (𝑞𝑟)) ∈ ℚ)
11397, 112eqeltrrd 2838 . . . 4 (((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) ∧ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))) → 𝐴 ∈ ℚ)
114113ex 412 . . 3 ((𝐴 ∈ ℝ ∧ (𝑞 ∈ ℚ ∧ 𝑟 ∈ ℚ)) → ((𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) → 𝐴 ∈ ℚ))
115114rexlimdvva 3195 . 2 (𝐴 ∈ ℝ → (∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟))) → 𝐴 ∈ ℚ))
11649, 115impbid2 226 1 (𝐴 ∈ ℝ → (𝐴 ∈ ℚ ↔ ∃𝑞 ∈ ℚ ∃𝑟 ∈ ℚ (𝑞𝑟 ∧ (abs‘(𝐴𝑞)) = (abs‘(𝐴𝑟)))))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 206  wa 395   = wceq 1542  wcel 2114  wne 2933  wrex 3062  cfv 6494  (class class class)co 7362  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 1797  ax-4 1811  ax-5 1912  ax-6 1969  ax-7 2010  ax-8 2116  ax-9 2124  ax-10 2147  ax-11 2163  ax-12 2185  ax-ext 2709  ax-sep 5232  ax-nul 5242  ax-pow 5304  ax-pr 5372  ax-un 7684  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 207  df-an 396  df-or 849  df-3or 1088  df-3an 1089  df-tru 1545  df-fal 1555  df-ex 1782  df-nf 1786  df-sb 2069  df-mo 2540  df-eu 2570  df-clab 2716  df-cleq 2729  df-clel 2812  df-nfc 2886  df-ne 2934  df-nel 3038  df-ral 3053  df-rex 3063  df-rmo 3343  df-reu 3344  df-rab 3391  df-v 3432  df-sbc 3730  df-csb 3839  df-dif 3893  df-un 3895  df-in 3897  df-ss 3907  df-pss 3910  df-nul 4275  df-if 4468  df-pw 4544  df-sn 4569  df-pr 4571  df-op 4575  df-uni 4852  df-iun 4936  df-br 5087  df-opab 5149  df-mpt 5168  df-tr 5194  df-id 5521  df-eprel 5526  df-po 5534  df-so 5535  df-fr 5579  df-we 5581  df-xp 5632  df-rel 5633  df-cnv 5634  df-co 5635  df-dm 5636  df-rn 5637  df-res 5638  df-ima 5639  df-pred 6261  df-ord 6322  df-on 6323  df-lim 6324  df-suc 6325  df-iota 6450  df-fun 6496  df-fn 6497  df-f 6498  df-f1 6499  df-fo 6500  df-f1o 6501  df-fv 6502  df-riota 7319  df-ov 7365  df-oprab 7366  df-mpo 7367  df-om 7813  df-1st 7937  df-2nd 7938  df-frecs 8226  df-wrecs 8257  df-recs 8306  df-rdg 8344  df-er 8638  df-en 8889  df-dom 8890  df-sdom 8891  df-sup 9350  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