-
Notifications
You must be signed in to change notification settings - Fork 331
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
[Merged by Bors] - chore: adapt to multiple goal linter 2 #12361
Conversation
@@ -156,9 +156,9 @@ theorem cyclotomic_mul_prime_pow_eq (R : Type*) {p m : ℕ} [Fact (Nat.Prime p)] | |||
have hdiv : p ∣ p ^ a.succ * m := ⟨p ^ a * m, by rw [← mul_assoc, pow_succ']⟩ | |||
rw [pow_succ', mul_assoc, mul_comm, cyclotomic_mul_prime_dvd_eq_pow R hdiv, | |||
cyclotomic_mul_prime_pow_eq _ _ a.succ_pos, ← pow_mul] | |||
congr 1 | |||
simp only [tsub_zero, Nat.succ_sub_succ_eq_sub] | |||
rwa [Nat.mul_sub_right_distrib, mul_comm, pow_succ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that rwa
used assumption
on a different goal than the one it rewrote? :O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed: see also this thread!
refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) | ||
rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, | ||
ContinuousMap.coe_mk, neg_neg] | ||
exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ | ||
· rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, | ||
ContinuousMap.coe_mk, neg_neg] | ||
exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really deserve to be indented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At that point, there are two goals, the second being
-x ∈ Icc (-x✝ + -S) (-x✝ + -R)
I do not understand though how Lean solves this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think that I see now.
The "first goal" becomes identical to the second one after the rw
. So, I guess that the final exact
solves the current goal and then Lean realizes that it already knows how to solve that goal and closes the second one as well.
Mathlib/RingTheory/Norm.lean
Outdated
letI : ∀ f : L →ₐ[K] E, Fintype (@AlgHom L F E _ _ _ _ f.toRingHom.toAlgebra) := ?_ | ||
rw [Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, | ||
← Finset.univ_sigma_univ, Finset.prod_sigma, ← Finset.prod_pow] | ||
refine Finset.prod_congr rfl fun σ _ => ?_ | ||
· letI : Algebra L E := σ.toRingHom.toAlgebra | ||
simp_rw [Finset.prod_const] | ||
congr | ||
exact AlgHom.card L F E | ||
· intro σ | ||
simp only [algHomEquivSigma, Equiv.coe_fn_mk, AlgHom.restrictDomain, AlgHom.comp_apply, | ||
IsScalarTower.coe_toAlgHom'] | ||
· rw [Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Can't add a suggestion here.) Should this be instead something like:
letI : ∀ f : L →ₐ[K] E, Fintype (@AlgHom L F E _ _ _ _ f.toRingHom.toAlgebra) := by
...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was puzzling: the letI
created an extra goal, wanting to figure out some function. I could not understand where this was used and removing the letI
line simply worked!
Maybe this was an instance of an "unused letI
"? Is there an "unused have/let" linter? Does it check for letI
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise. Thanks for this huge cleanup!
Anne, thank you very much for your review! |
bors d+ |
✌️ adomani can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
Pull request successfully merged into master. Build succeeded: |
This PR was reduced by approximately half of its original size: the other half of this PR is now the content of #12560. This PR was reduced by approximately half of its halved size: the other half of the halved PR is now the content of #12834. A PR analogous to the merged PRs #12338, #12361 and #12372: reformatting proofs following the multiple goals linter of #12339. This should be the last of the adaptations.
This PR was reduced by approximately half of its original size: the other half of this PR is now the content of #12560. This PR was reduced by approximately half of its halved size: the other half of the halved PR is now the content of #12834. A PR analogous to the merged PRs #12338, #12361 and #12372: reformatting proofs following the multiple goals linter of #12339. This should be the last of the adaptations.
This PR was reduced by approximately half of its original size: the other half of this PR is now the content of #12560. This PR was reduced by approximately half of its halved size: the other half of the halved PR is now the content of #12834. A PR analogous to the merged PRs #12338, #12361 and #12372: reformatting proofs following the multiple goals linter of #12339. This should be the last of the adaptations.
A linter that makes sure that, when multiple goals are present, they are enclosed in `·`s. Adaptations (the order is chronological, there should be no dependency among them): * #12338, * #12361, * #12372, * #12560, * #12834, * #12381, * #12908, * #14939, plus many many more that this comment is too small to contain. Co-authored-by: Michael Rothgang <[email protected]>
A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.