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

chore: golf a bit #212

Merged
merged 11 commits into from
Nov 13, 2024
Merged

chore: golf a bit #212

merged 11 commits into from
Nov 13, 2024

Conversation

pitmonticone
Copy link
Collaborator

No description provided.

Comment on lines 259 to 265
calc
0 < a * a + a * b + b * b := ?_
_ = _ := by ring
apply add_pos_of_nonneg_of_pos
apply add_nonneg (mul_self_nonneg _) h
apply mul_self_pos.mpr hb
exact add_pos_of_nonneg_of_pos (add_nonneg (mul_self_nonneg _) h) (mul_self_pos.mpr hb)
| inr h =>
rw [sub_pos]
exact h.trans_le (sq_nonneg _)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
calc
0 < a * a + a * b + b * b := ?_
_ = _ := by ring
apply add_pos_of_nonneg_of_pos
apply add_nonneg (mul_self_nonneg _) h
apply mul_self_pos.mpr hb
exact add_pos_of_nonneg_of_pos (add_nonneg (mul_self_nonneg _) h) (mul_self_pos.mpr hb)
| inr h =>
rw [sub_pos]
exact h.trans_le (sq_nonneg _)
rify
calc
(0 : ℝ) < (a ^ 2 + (a + b) ^ 2 + b ^ 2) / 2 := by positivity
_ = (a + b) ^ 2 - a * b := by ring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like you only golfed the first branch of the proof, while my suggestion was to unify the branches. See #212 (comment)

pitmonticone and others added 2 commits November 10, 2024 20:57
Co-Authored-By: Yaël Dillies <[email protected]>
Co-Authored-By: Yaël Dillies <[email protected]>
Copy link
Collaborator

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

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

can you revert the Frey-Mazur thing? Other than that this is fine.

apply Wiles_Frey P
exact Mazur_Frey P
theorem FreyPackage.false (P : FreyPackage) : False :=
Wiles_Frey P (Mazur_Frey P)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this one can be golfed but I think it's nice to leave it as it is. We should really add documentation rather than golfing!

FLT/Basic/Reductions.lean Outdated Show resolved Hide resolved
@pitmonticone
Copy link
Collaborator Author

Done @kbuzzard

@kbuzzard
Copy link
Collaborator

Thanks!

@kbuzzard kbuzzard merged commit 845664c into main Nov 13, 2024
1 check passed
@kbuzzard kbuzzard deleted the pitmonticone/golf branch November 13, 2024 09:03
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.

3 participants