Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fermat's last theorem for exponent 4 #4149

Merged
merged 19 commits into from
Aug 31, 2024
Merged

Conversation

icecream17
Copy link
Contributor

@icecream17 icecream17 commented Aug 21, 2024

Draft since I'm avoiding a merge conflict (deduction of opthpr will be where ifexd was: #4139), but everything is proved except for the lemmas Done

In changes-set.txt I replaced two tabs with spaces fixed by #4160

Edit: flt4lem5 is impossible to prove. flt4g will become a lemma with an extra A < B hypothesis, and flt4 will become nontrivial (will use fltne)...

edit 2: A < B is not very useful considering the relevant terms are A ^ 4 and B ^ 2, so instead the parity antecedent from pythagtriplem18 will be carried over

edit 3: A better proof was used

I've decided that when a general proof is easier to prove, the statement will be more general
flt4 is left as an easy exercise (hint: mteqand)

proving flt4g first shows that the structure of flt4lem and flt4lem6 is correct, subsequent commits will prove the lemmas
@metakunt
Copy link
Contributor

Nice, how much harder is exponent 3?

set.mm Outdated Show resolved Hide resolved
set.mm Outdated Show resolved Hide resolved
set.mm Outdated Show resolved Hide resolved
set.mm Outdated Show resolved Hide resolved
@icecream17
Copy link
Contributor Author

icecream17 commented Aug 21, 2024

FLT3 seems several times as hard as FLT4, judging by https://en.wikipedia.org/wiki/Proof_of_Fermat%27s_Last_Theorem_for_specific_exponents#n_=_3 (though it uses a "crucial lemma" without proving it)

and Lean, which has tactics and probably a better library given its cyclotomic Three import, and which takes 600 lines to prove FLT3
https://github.com/leanprover-community/mathlib4/blob/master/Mathlib/NumberTheory/FLT/Three.lean

worse options I looked at

I tried to find if anyone found a simple proof, but to no avail.


https://www.researchgate.net/publication/269238745_Proof_of_Fermat's_Last_Theorem_for_n3_Using_Tschirnhaus_Transformation
has many steps introducing very complicated substitutions and transformations, ending with
image
then
image

Which I find rather amusing. Other than the slightly questionable last sentence, it does not seem wrong, but it also does not seem to have garnered any citations.


Strangely, google keeps shoving the one vixra paper, which obviously doesn't work (edit: ironic typo). But there's also this arxiv paper: https://arxiv.org/abs/math/0309005 which is wrong because the logic at the end of page 6 doesn't connect (I can't tell what "embedded" means, based on the second last paragraph on page 6 it means two groups of equations can be true at the same time. That would make page 6 last paragraph sentence 2 equivalent to FLT, however the proof of that sentence is not given).

Afaict no one has bothered to refute this paper until now, probably because the grammar + the claim was a red flag.

@metakunt
Copy link
Contributor

What do you mean by questionable? The proof appears to be short to be formalised.
Is there any step that is likely a non-sequitur?

@icecream17
Copy link
Contributor Author

I was referring to "...and thereby this proof suggests that there is a possibility of existence of a simple proof to the Fermat's Last Theorem in general", there doesn't seem to be anything wrong with the actual proof.

set.mm Outdated Show resolved Hide resolved
@metakunt
Copy link
Contributor

So formalising FLT for n=3 is in reach? I think we might even have Cardano in set.mm

add rprpwr to main, shorten pdivsq

I've decided to just brute force the wikipedia proof directly
set.mm Outdated Show resolved Hide resolved
Copy link
Contributor

@avekens avekens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting (intermediate) results, and nice generalizations of existing theorems. Please go ahead.

@icecream17 icecream17 mentioned this pull request Aug 22, 2024
@icecream17
Copy link
Contributor Author

More delays: I just rediscovered my notes which links to a proof that's even better than wikipedia's

two trivial shortenings

---

I started working towards proving case B:
https://en.wikipedia.org/wiki/Proof_of_Fermat%27s_Last_Theorem_for_specific_exponents#Proof_for_case_B

However, it's at least three times as long as case A. So I'm stopping and committing a few fixes before switching to https://crypto.stanford.edu/pbc/notes/numberfield/fermatn4.html
@benjub
Copy link
Contributor

benjub commented Aug 22, 2024

General note: for these theorems, I think the following statements look nicer:

( ph -> A e. ZZ) 
...
( ph -> ( ( A ^ 4  ) + ( B ^ 4 ) ) =  ( C ^ 2 ) )
=>
( ph -> ( A x B ) =  0 )

And when the exponent is odd, the conclusion is ( ph -> ( ( A x B ) x C ) = 0 ) (or associated the other way, I do not know which we prefer in set.mm)

might as well commit this before going to bed, only about 1.5 flt4g size proofs left
@icecream17
Copy link
Contributor Author

icecream17 commented Aug 24, 2024

Almost done, except for proving a lemma, flt4g modified, and flt4g (new label)

Here's what the new a1ii looks like. I converted the text into a list, used <code> for commands, and added the sentence below it (I highlighted the first word).
image

I think minimizing flt4lem5e is prohibitively long because,
despite only being 27 lines long, there are 71 Zs,
so there are 46140 steps when expanded+syntax.

(Relevant: metamath#3269)

I used theorems in Scott's mathbox without even realizing, so they're moved now

I renamed dvdspw to reduce confusion with dvdsexp

Fix comment of ncoprmgcdne1bgd
Comment on lines +477 to +494
_Instructions_:
<HTML><ol><li>Assign this inference to any unknown step in the proof.
Typically, the last unknown step is the most convenient, since
<code>MM-PA> ASSIGN LAST</code> can be used. This step will be
replicated in hypothesis a1ii.1, from where the development of the main
proof can continue.</li><li>Develop the independent subproof backwards
from hypothesis a1ii.2. If desired, use a <code>MM-PA> LET STEP</code>
command to pre-assign the conclusion of the independent subproof to
a1ii.2.</li><li>After the independent subproof is complete, use
<code>MM-PA> IMPROVE ALL</code> to assign it automatically to an unknown
step in the main proof that matches it.</li><li>After the entire proof
is complete, use <code>MM-PA> MINIMIZE_WITH *</code> to clean up
(discard) all ~ a1ii references automatically.</ol></HTML>

This can also be used to apply subproofs from other theorems. In step
2, simply assign the theorem to a1ii.2, and run
<HTML><code>MM-PA> EXPAND <theorem></code></HTML> to "import" a subproof
from another theorem.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks prettier indeed, and this change is good to me. As a loose principle, I think there are two things to be wary of:

  • do not spend too much time on rich formatting of comments since the further we depart from plain text, the harder the database is to maintain (but of course, when necessary for improving understanding, do use available functionalities);
  • if there are general instructions or remarks about "proof engineering" which are not specific to set.mm, they probably have a better place to be that in set.mm.

Again, I think that in the current case this is ok (even though the method with using a1ii is generalizable to various sorts of databases, and these general guidelines could be added somewhere more general).

set.mm Outdated
Comment on lines 178869 to 178873
dvds2addd.1 $e |- ( ph -> K e. ZZ ) $.
dvds2addd.2 $e |- ( ph -> K || M ) $.
dvds2addd.3 $e |- ( ph -> K || N ) $.
dvds2addd.4 $e |- ( ph -> M e. ZZ ) $.
dvds2addd.5 $e |- ( ph -> N e. ZZ ) $.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cosmetic, but the order of hypotheses is not very natural (same in next theorem): why not first K, M, N integers, and then the two divisibility hypotheses?
It is important to have uniform "APIs".

Copy link
Contributor

@tirix tirix Aug 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those K e. ZZ, M e. ZZ and N e. ZZ are even actually redundant by dvdszrcl

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tirix do you think we could discourage that theorem ? For instance as an "implementation detail", or "too fragile" (e.g., if in the future we want to extend it, for instance as in https://us.metamath.org/mpeuni/df-bj-divc.html).

In every textbook, similar statements about divisibility begin with "Let K, M, N be integers".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tirix do you think we could discourage that theorem ?

Oh, I see. Yes, why not ?

set.mm Outdated Show resolved Hide resolved
set.mm Outdated Show resolved Hide resolved
set.mm Outdated Show resolved Hide resolved
set.mm Outdated Show resolved Hide resolved
set.mm Outdated
mvrlsubd.a $e |- ( ph -> B e. CC ) $.
mvrlsubd.b $e |- ( ph -> C e. CC ) $.
mvrlsubd.1 $e |- ( ph -> A = ( B - C ) ) $.
$( Move RHS left subtraction to LHS. Converse of ~ mvlraddd .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe:

Move a subtraction in the RHS to a right-addition in the LHS.

set.mm Outdated
raddcom12d.b $e |- ( ph -> B e. CC ) $.
raddcom12d.c $e |- ( ph -> C e. CC ) $.
raddcom12d.1 $e |- ( ph -> A = ( B + C ) ) $.
$( Swap the first two variables in an equation with addition on the right,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same kind of things: it seems strange to "swap" the whole LHS with a part of the RHS.

Move a right-addition to in the RHS to a subtraction in the LHS, and then use symmetry of equality.

Same for the following results.

set.mm Outdated Show resolved Hide resolved
set.mm Outdated
Comment on lines 647912 to 647920
fltdvdsabdvdsc.a $e |- ( ph -> A e. NN ) $.
fltdvdsabdvdsc.b $e |- ( ph -> B e. NN ) $.
fltdvdsabdvdsc.c $e |- ( ph -> C e. NN ) $.
fltdvdsabdvdsc.n $e |- ( ph -> N e. NN ) $.
fltdvdsabdvdsc.1 $e |- ( ph -> ( ( A ^ N ) + ( B ^ N ) ) = ( C ^ N ) ) $.
$( Any factor of both ` A ` and ` B ` also divides ` C ` . This
establishes the validity of ~ fltabcoprmex . (Contributed by SN,
21-Aug-2024.) $)
fltdvdsabdvdsc $p |- ( ph -> ( A gcd B ) || C ) $=
Copy link
Contributor

@benjub benjub Aug 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you proved in the theorem above, N can be in NN0. Also, C can be in ZZ, and maybe A and B too.

It would certainly be nice to be as general as possible, but it may be a bit annoying in the proofs. Hopefully the generalization of the earlier results to ZZ will reduce the needs to treat zero separately.

The same questions will appear repeatedly below. Since it is in your mathbox, these are non-blocking remarks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's possible (easier) to first keep the proof in NN as a kind of lemma, and then extend to ZZ in a subsequent proof?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tirix It may be. I cannot tell from here: it really depends on whether zero has to be treated separately in specific subproofs, or if there is no need for it because the above lemmas have been properly generalized.

Copy link
Contributor Author

@icecream17 icecream17 Aug 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The theorems currently depend on ~ dvdsexpnn (this pr) to go from ? || ( ? ^ N ) to ? || ?

~ dvdsexpnn is comparable with ~ dvdssqlem , and as seen from ~ dvdssq the generalization is not free, though it would be nice. TODO-SNd to later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking using theorems like neggcd, gcdneg, negdvdsb and dvdsnegb to fall back to positive integers. Similar theorems can be used to treat the zero cases.

set.mm Outdated Show resolved Hide resolved
@icecream17
Copy link
Contributor Author

Note: The force push only changes the commit message to link to a more relevant pr

set.mm Outdated Show resolved Hide resolved
set.mm Outdated Show resolved Hide resolved
flt4lem7 seems to be just like flt4lem5 with auto-minimization difficulty, but it's more understandable here since the proof is 62 lines rather than 27
@icecream17 icecream17 marked this pull request as ready for review August 25, 2024 19:00
@icecream17 icecream17 marked this pull request as draft August 25, 2024 19:04
4sqlem10 gets larger but the proof didn't change, I guess a subproof that was used more often now comes later, and was assigned the index UUA instead of YT or something.
@icecream17 icecream17 marked this pull request as ready for review August 25, 2024 21:36
@icecream17
Copy link
Contributor Author

I think this is equivalent to a non-draft state, although #4149 (comment) isn't resolved yet

Copy link
Contributor

@benjub benjub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me, even if I have one labeling remark (see "rotate" above), and I hope that in the future, as many of these statements as possible will have more general and natural hypotheses, typically, A, B, C \in \ZZ (and exponent in \NN0 when the statement remains true without complicating it, or else \NN), and expressing triviality of solutions by ABC=0. That is, statements of the form:

All solutions in $\mathbb{Z}^d$ to [this or that Diophantine equation] are trivial.

rather than

[This or that Diophantine equation] has no solution in [this or that subset of $\mathbb{Z}^d$].

@benjub
Copy link
Contributor

benjub commented Aug 30, 2024

I gave my approval above (and hopefully my comment to the approval will be useful). There are two other reviewers, @tirix and @avekens. Good for you? Feel free to merge if so.

@icecream17
Copy link
Contributor Author

if you are referring to me, I do not have merge permissions

@benjub
Copy link
Contributor

benjub commented Aug 30, 2024

if you are referring to me, I do not have merge permissions

I was referring to Thierry and Alexander (the requested reviewers are displayed at the top of the right pane on this page).

Copy link
Contributor

@tirix tirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections from me!

@benjub benjub merged commit 6bcb902 into metamath:develop Aug 31, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants