Zulip Chat Archive
Stream: Is there code for X?
Topic: Congruum
Wouter Smeenk (Jul 03 2023 at 16:41):
Is there a proof for https://en.m.wikipedia.org/wiki/Congruum#Parameterized_solution in mathlib?
Johan Commelin (Jul 03 2023 at 16:49):
I don't think so.
Alex J. Best (Jul 03 2023 at 16:57):
It sounds related to the parameterization of pythagorean triples though, which we do have
Kevin Buzzard (Jul 03 2023 at 17:43):
It would be a nice lean exercise to show that an integer c is a solution to c=x^2-y^2=y^2-z^2 iff c can be written as 4t^2mn(m^2-n^2).
Yury G. Kudryashov (Jul 03 2023 at 19:35):
Or you can add a rational parametrization of any quadric over any field, not necessarily the sphere.
Kevin Buzzard (Jul 03 2023 at 21:16):
There is an integrality question too (up to squares these are just the congruent numbers, but it's not true that you can cast squares out of congruum numbers eg 24 is congruum but 6 isn't)
Wouter Smeenk (Jul 20 2023 at 17:18):
I am trying to formalize this. I am wondering if this is the correct thing to prove in this case:
lemma congruum : (∃ x y z : ℤ, c = x^2 - y^2 ∧ c = y^2 - z^2) ↔
∃ m n : ℤ, m > n ∧ c = 4 * m * n * (m^2-n^2) := by
constructor
. intro h
rcases h with ⟨x, y, z, hcxy, hcxz⟩
sorry
. intro h
rcases h with ⟨m, n, hmn, hc⟩
use m^2 + 2 * m * n - n^2
use m^2 + n^2
use m^2 - 2 * m * n - n^2
constructor
. rw [hc]; ring
. rw [hc]; ring
Kevin Buzzard (Jul 20 2023 at 17:33):
As it stands this might be false, right? Do you know a maths proof of the sorry? I don't. My version above had a t^2 in.
Wouter Smeenk (Jul 20 2023 at 17:55):
No I don't. I could not find a public source for the proof. You are right about the t^2 I think. I will try to incorporate it. I was specifically wondering if the use of the iff and exists is correct (matches the description of the wiki)
Kevin Buzzard (Jul 20 2023 at 17:58):
It looks fine other than the t issue. It might be good if you named c explicitly
Wouter Smeenk (Jul 20 2023 at 18:08):
Updated version:
lemma congruum : ∀ c : ℤ, (∃ x y z : ℤ, c = x^2 - y^2 ∧ c = y^2 - z^2) ↔
∃ m n t: ℤ, m > n ∧ c = 4 * t^2 * m * n * (m^2-n^2) := by
intro c
constructor
. intro h
rcases h with ⟨x, y, z, hcxy, hcxz⟩
sorry
. intro h
rcases h with ⟨m, n, t, hmn, hc⟩
use t * (m^2 + 2 * m * n - n^2)
use t * (m^2 + n^2)
use t * (m^2 - 2 * m * n - n^2)
constructor
. rw [hc]; ring
. rw [hc]; ring
Wouter Smeenk (Jul 20 2023 at 18:23):
Thanks for the help so far! If anyone knows of a proof for this or where to find it that would be great!
Kevin Buzzard (Jul 20 2023 at 18:40):
You mean a maths proof or a lean proof?
Kevin Buzzard (Jul 20 2023 at 18:58):
I would drop the m > n by the way, this is if you're dealing with naturals but you have used integers. A maths proof of the harder direction is: given x y z, we have (deal with case separately). Now set (deal with case separately) so . Think of this as a line meeting the circle in two points, namely and , . Eliminating gives . This quadratic has two roots and their sum is , so this must be . This gives you a formula for in terms of (it's ), and using you also get a formula for (it's ). Now write in lowest terms and tidy up; the is the gcd of and .
Alex Kontorovich (Jul 20 2023 at 19:00):
You can use this: https://leanprover-community.github.io/mathlib4_docs/Mathlib/NumberTheory/PythagoreanTriples.html
Set and . Then is a Pythagorean triple, and apply the classification PythagoreanTriple.coprime_classification
.
Kevin Buzzard (Jul 20 2023 at 19:02):
aah this is a better route: I'm parametrising the conic but apparently we already have it parametrised.
Wouter Smeenk (Jul 20 2023 at 19:07):
Thanks! I meant a maths proof indeed. I will try to make sense of this :P. Has been a long time since I did any serious math...;)
Last updated: Dec 20 2023 at 11:08 UTC