Skip to content

chore: downstream-lean4 adaptations for nightly-2026-10-21 - #45142

Closed
downstream-lean4[bot] wants to merge 1 commit into
bump/v4.37.0from
downstream-lean4-export
Closed

downstream-lean4[bot] wants to merge 1 commit into
bump/v4.37.0from
downstream-lean4-export

Conversation

@downstream-lean4

Copy link
Copy Markdown
Contributor

This PR contains automatically exported adaptations up until leanprover/downstream-lean4@8fdad89.

If any dependencies have open export PRs themselves, you may need to merge them first and then run lake update in this PR. If this PR becomes outdated, just close it and a new one will be opened soon. No new export PRs will be opened while one is already open.

downstream-sha: 8fdad89b8cbf3659ca3427c419f0a5b982b7a0c5

@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Oct 21, 2026
@github-actions

Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to Zulip and join the Lean community.
Thank you again for joining our community.

@github-actions github-actions Bot added the increases-technical-debt Automatically added label for PRs which increase "strong" technical debts label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

PR summary 8bc0022b90

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

- dthen
- dthen_eq_then

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean -- stale, waiting for the new build)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 8fe54d9).

  • +1 new declarations
  • −2 removed declarations
+CategoryTheory.ConcreteCategory.hom.hcongr_9
-Ordering.dthen
-Ordering.dthen_eq_then

Increase in strong tech debt: (relative, absolute) = (1.77, 0.23)
Current number Change Type (strong)
391 5 adaptation notes
26 1 disabled simpNF lints
11 2 disabled deprecation lints
No changes to weak technical debt.

Current commit 8bc0022b90
Reference commit d88814353f

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

Comment thread Mathlib/Algebra/Ring/Equiv.lean Outdated
Comment on lines +573 to +574
simp only [Equiv.toFun_as_coe, Equiv.prodCongr_apply, EquivLike.coe_coe,
Prod.map, map_mul, Prod.mk_mul_mk]
simp only [Equiv.toFun_as_coe, Equiv.prodCongr_apply, Prod.map, EquivLike.coe_coe, map_mul,
Prod.mk_mul_mk]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we should merge these changes, since the two versions do the same thing and will just cause merge conflicts down the line.

@Vierkantor Vierkantor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I need to run for a bit, but when I come back I plan to revert a lot of these changes since they appear unnecessary.

Comment on lines +487 to +488
rw [AlgHom.comp_apply,
map_eq_zero_iff _ (rename_injective _ (fun _ _ _ ↦ rfl (α := PUnit.{u + 1})))] at this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change seems to be unnecessary too.

Comment thread Mathlib/Analysis/Quaternion.lean Outdated
theorem continuous_re : Continuous fun q : ℍ => q.re :=
(PiLp.continuous_apply 2 _ 0).comp linearIsometryEquivTuple.continuous
theorem continuous_re : Continuous fun q : ℍ => q.re := by
convert! (PiLp.continuous_apply 2 _ 0).comp linearIsometryEquivTuple.continuous

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also seems to be unnecessary...

let ⟨_,b,_⟩ := f
let ⟨_,e,_⟩ := g
congr
simp only [eq_iff_true_of_subsingleton]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is indeed a positive change!

def commMonToLaxBraidedObj (A : CommMon C) :
Discrete PUnit.{u + 1} ⥤ C := (Functor.const _).obj A.X

attribute [nolint simpNF] commMonToLaxBraidedObj_map

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs an adaptation note at least. We might even get away with removing the lemma altogether since both versions reduce to "this map is the identity":

@[simps! obj] -- `map` can already be proven.
def commMonToLaxBraidedObj (A : CommMon C) :
    Discrete PUnit.{u + 1} ⥤ C := (Functor.const _).obj A.X

Comment on lines +1199 to +1200
attribute [nolint simpNF] equivLaxMonoidalFunctorPUnit_inverse_obj_map
AddMon.equivLaxMonoidalFunctorPUnit_inverse_obj_map

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
attribute [nolint simpNF] equivLaxMonoidalFunctorPUnit_inverse_obj_map
AddMon.equivLaxMonoidalFunctorPUnit_inverse_obj_map
attribute [nolint simpNF] equivLaxMonoidalFunctorPUnit_inverse_obj_map
AddMon.equivLaxMonoidalFunctorPUnit_inverse_obj_map

(trNat_natEnd _) ⟨rfl, by simp⟩))
(TransGen.head rfl (TransGen.head rfl ?_))
simp only [TM2.step, Option.mem_def, trList, List.append_assoc,
List.cons_append, elim_update_stack, elim_rev, elim_update_rev, Function.update_self,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Idem.

· simp only [Nat.one_mod, Nat.mod_add_mod]
rw [← Nat.mod_eq_of_lt h, Nat.mod_mod]
· rw [Fin.val_mk, not_lt] at h
simp only [Nat.mod_add_mod,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Idem here.

rw [← MonoidHom.mem_range, S.range_inl_eq_ker_rightHom, MonoidHom.mem_ker, map_mul, map_inv,
rightHom_splitting, mul_inv_cancel]
map_mul' := fun ⟨n₁, g₁⟩ ⟨n₂, g₂⟩ ↦ by
simp only [conjAct, MonoidHom.comp_apply, map_mul, inl_conjAct_comm, MonoidHom.coe_ofClass]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Idem.

simp only [funMap_quotient_mk', Quotient.eq]
obtain ⟨k, ik, jk⟩ :=
directed_of (· ≤ ·) i (Classical.choose (Finite.bddAbove_range fun _ : Fin n => i))
refine ⟨k, jk, ik, ?_⟩

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Idem.

Comment thread Mathlib/NumberTheory/SmoothNumbers.lean Outdated
right_inv := by
rintro ⟨m, hm₀, hm⟩
rw [Subtype.mk.injEq, ← primeFactorsList_count_eq, ← prod_replicate, ← prod_append]
simp_rw [Subtype.mk.injEq, ← primeFactorsList_count_eq, ← prod_replicate, ← prod_append]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Idem.

@Vierkantor Vierkantor added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Oct 22, 2026
@downstream-lean4
downstream-lean4 Bot force-pushed the downstream-lean4-export branch 5 times, most recently from 44646e6 to 470fa82 Compare October 25, 2026 11:14
downstream-sha: 9b8dac4990f3ae8539a2b30942a7afc37f8a118f
@downstream-lean4
downstream-lean4 Bot force-pushed the downstream-lean4-export branch from 470fa82 to 8bc0022 Compare October 26, 2026 10:13
@Garmelon

Copy link
Copy Markdown
Contributor

Closing this PR so it is recreated by downstream-lean4. @Vierkantor I'm not sure if all your review comments were covered by the fixes you pushed to downstream-lean4, so you may want to keep this PR in mind when reviewing the next one.

@Garmelon Garmelon closed this Oct 26, 2026
@Garmelon

Copy link
Copy Markdown
Contributor

The new PR is at #45327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. increases-technical-debt Automatically added label for PRs which increase "strong" technical debts new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants