Repository navigation
Conversation
PR summary f083a36ccdImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type |
|---|---|---|
| 1770 | -16 | porting notes |
| 129 | 37 | adaptation notes |
| 7 | 3 | maxHeartBeats modifications |
Current commit f083a36ccd
Reference commit 8c10b57e9a
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
| section | ||
|
|
||
| open Lean Elab Tactic in | ||
| /-- A helper tactic for `aesop_cat` and `Pairwise`. -/ | ||
| def pairwiseCases : TacticM Unit := do | ||
| evalTactic (← `(tactic| casesm* (_ : Pairwise _) ⟶ (_ : Pairwise _))) | ||
|
|
||
| attribute [local aesop safe tactic (rule_sets := [CategoryTheory])] pairwiseCases in | ||
| instance : Category (Pairwise ι) where | ||
| Hom := Hom | ||
| id := id | ||
| comp f g := comp f g | ||
|
|
||
| end | ||
| comp := @comp _ | ||
| id_comp f := by cases f <;> rfl | ||
| comp_id f := by cases f <;> rfl | ||
| assoc f g _ := by cases f <;> cases g <;> rfl |
There was a problem hiding this comment.
Do we know what happened here?
There was a problem hiding this comment.
Splitting the construction into CategoryStruct stage, and then a Category stage allows us to keep the automation:
instance : CategoryStruct (Pairwise ι) where
Hom := Hom
id := id
comp := @comp _
section
open Lean Elab Tactic in
/-- A helper tactic for `aesop_cat` and `Pairwise`. -/
def pairwiseCases : TacticM Unit := do
evalTactic (← `(tactic| casesm* (_ : Pairwise _) ⟶ (_ : Pairwise _)))
attribute [local aesop safe tactic (rule_sets := [CategoryTheory])] pairwiseCases in
instance : Category (Pairwise ι) where
end
There was a problem hiding this comment.
My thinking here was that the automation was many more bytes than doing it directly, and the automation helped work around the fact that the fields weren't seeing the actual provided definition for comp. Maybe what I did was too big of a change for a bump PR though.
| instance (i : ι) : Inhabited (Pair d i) := | ||
| ⟨{ (empty : NormalWord d) with | ||
| head := 1, | ||
| head := 1, tail := _, |
There was a problem hiding this comment.
| head := 1, tail := _, | |
| head := 1, | |
| tail := _, |
There was a problem hiding this comment.
To be fully explicit, we could also replace this with
instance (i : ι) : Inhabited (Pair d i) :=
⟨{ head := 1,
tail := empty.toWord,
fstIdx_ne := fun h => by cases h
normalized := empty.normalized }⟩
left a comment
There was a problem hiding this comment.
Wow! This change to core Lean has caused a lot of disruption but the vast vast majority of it is positive: there are many dsimps which are removed and the addition of various explicit structure fields I think makes the library better not worse (having them solved by unification is all very clever-clever but it's also super-obscure). I left a couple of comments. Do we understand why all those norm_mul_self_les needed to be added in the CStarAlgebra directory? But overall L(V)GTM
| relation := by rintro ⟨⟩ | ||
| toSolution := Relations.solutionFinsupp _ | ||
| toIsPresentation := Relations.solutionFinsupp_isPresentation _ | ||
| toIsPresentation := by exact Relations.solutionFinsupp_isPresentation _ |
There was a problem hiding this comment.
| toIsPresentation := by exact Relations.solutionFinsupp_isPresentation _ | |
| #adaptation_note /-- 2025-03-29 lean4#7717 Needed to add `by exact` -/ | |
| toIsPresentation := by exact Relations.solutionFinsupp_isPresentation _ |
Or do you understand why this happened and it's expected?
There was a problem hiding this comment.
Assigning to parent projections is complicated, and there are some complicated dependent types here. It used to be that only some parent projections could be assigned, and now all of them can be. For uniformity, they're all handled in the same way; the expression is lifted to a let and that value is used to fill in fields; as a later step, fields are combined when possible. This code was previously taking advantage of how toSolution and toIsPresentation were actual fields in the underlying constructor.
This is what this particular expression expands to.
def Module.presentationFinsupp.{w₀, w₁, u} : (A : Type u) → [inst : Ring A] → (G : Type w₀) → Presentation A (G →₀ A) :=
fun A [Ring A] G ↦
let __Solution :=
{ G := G, R := PEmpty.{w₁ + 1}, relation := fun r ↦ PEmpty.casesOn (fun x ↦ G →₀ A) r }.solutionFinsupp;
let __IsPresentation := Relations.solutionFinsupp_isPresentation
{ G := G, R := PEmpty.{u_2 + 1}, relation := fun r ↦ PEmpty.casesOn (fun x ↦ G →₀ A) r };
{ G := G, R := PEmpty.{w₁ + 1}, relation := fun r ↦ PEmpty.casesOn (fun x ↦ G →₀ A) r, toSolution := __Solution,
toIsPresentation := __IsPresentation }
Somehow, the by exact is deferring elaboration long enough to keep some bad unification from happening.
It's possible there's some deeper problem that needs fixing, so it's worth adding the adaptation note to keep track of it.
|
|
||
| #adaptation_note /-- 2025-03-29 for lean4#7717 had to add `norm_mul_self_le` field. -/ | ||
| instance [NonUnitalCStarAlgebra A] : NonUnitalCStarAlgebra C(α, A) where | ||
| norm_mul_self_le := CStarRing.norm_mul_self_le |
There was a problem hiding this comment.
@j-loreaux do you understand why this is happening? A lot of norm_mul_self_les are being added manually now. @kmill are you able to add a comment somewhere explaining this fallout? It is one of very few "negative" changes in this PR.
There was a problem hiding this comment.
Yes, this issue is on my radar. I have a brief comment about it on Zulip.
The problem is that the type of the CStarRing parent depends on the fields of NonUnitalCStarAlgebra, and that's inhibiting it from using any pre-existing instances. It's unclear what the underlying issue is yet, but I hope there will be a reasonable fix.
…nity/mathlib4 into bump/nightly-2025-03-31
commented
Apr 1, 2025
|
bors merge |
commented
Apr 1, 2025
|
Pull request successfully merged into bump/v4.19.0. Build succeeded: |
No description provided.