Skip to content

feat(Topology/Algebra/Module/Spaces/ContinuousLinearMap): convert toLinearMap₁₂ to a linear map#41731

Open
mpacholski wants to merge 7 commits into
leanprover-community:masterfrom
mpacholski:feat/linear-map-add-smul
Open

feat(Topology/Algebra/Module/Spaces/ContinuousLinearMap): convert toLinearMap₁₂ to a linear map#41731
mpacholski wants to merge 7 commits into
leanprover-community:masterfrom
mpacholski:feat/linear-map-add-smul

Conversation

@mpacholski

@mpacholski mpacholski commented Jul 14, 2026

Copy link
Copy Markdown

Convert the projection toLinearMap₁₂ (which strips the topology from a continuous semibilinear map) to a linear map, by showing that it preserves addition and scalar multiplication, and mark it with @[simp apply] absorb the toLinearMap₁₂_apply lemma.


Open in Gitpod

…arMap₁₂_add` and `toLinearMap₁₂_smul`

Prove that the projection `toLinearMap₁₂` (which strips the topology from a continuous semibilinear map) preserves addition and scalar multiplication, and mark both lemmas with `@[simp]`.
@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 Jul 14, 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 https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions github-actions Bot added the t-topology Topological spaces, uniform spaces, metric spaces, filters label Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR summary 242e4da0dd

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

No declarations were harmed in the making of this PR! 🐙

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 -- pending)

Computed after the build finishes.


No changes to strong technical debt.

No changes to weak technical debt.

Current commit 242e4da0dd
Reference commit 4a73a604a6

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.sh 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).

@pechersky

Copy link
Copy Markdown
Contributor

Does it make sense to upgrade toLinearMap₁₂ to a linear map of ContinuousLinearMaps instead of having it unbundled?

@mpacholski

Copy link
Copy Markdown
Author

@pechersky thank you for the comment! Can't say that I see a reason to have it unbundled. Shall I convert it to a linear map and update the PR?

@mpacholski mpacholski changed the title feat(Topology/Algebra/Module/Spaces/ContinuousLinearMap): add toLinearMap₁₂_add and toLinearMap₁₂_smul feat(Topology/Algebra/Module/Spaces/ContinuousLinearMap): convert toLinearMap₁₂ to a linear map Jul 14, 2026
@mpacholski

Copy link
Copy Markdown
Author

@pechersky I converted it to a bundled linear map, and also marked it with @[simp apply]. Do you think it's good now?

@pechersky

Copy link
Copy Markdown
Contributor

What were the new simps lemmas? You can check via simps?.

@mpacholski mpacholski force-pushed the feat/linear-map-add-smul branch from fd20ca4 to 7d465e5 Compare July 14, 2026 18:36
@mpacholski

Copy link
Copy Markdown
Author

Using simps? shows that the generated lemma is just

@[simp] lemma toLinearMap₁₂_apply (L : E →SL[σ₁₃] F →SL[σ₂₃] G) :
  toLinearMap₁₂ L = coeLMₛₗ σ₂₃ ∘ₛₗ ↑L

Should we use just @[simps] instead of @[simps apply]?

I also checked @[simps!? apply_apply] and it generates

@[simp] lemma toLinearMap₁₂_apply_apply (L : E →SL[σ₁₃] F →SL[σ₂₃] G) (v : E) :
  toLinearMap₁₂ L v = ↑(L v)

Comment thread Mathlib/Topology/Algebra/Module/Spaces/ContinuousLinearMap.lean Outdated
Comment thread Mathlib/Topology/Algebra/Module/Spaces/ContinuousLinearMap.lean Outdated

@[simp] lemma toLinearMap₁₂_apply (L : E →SL[σ₁₃] F →SL[σ₂₃] G) (v : E) (w : F) :
L.toLinearMap₁₂ v w = L v w := rfl
@[simps apply]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think apply here will be the same as the one we had before.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

you're right, as I checked with @[simp?] the generated lemma is

@[simp] lemma toLinearMap₁₂_apply (L : E →SL[σ₁₃] F →SL[σ₂₃] G) :
  toLinearMap₁₂ L = coeLMₛₗ σ₂₃ ∘ₛₗ ↑L

I reinstated the old lemma.

Comment on lines +514 to +515
simpa [this] using! contDiff_const
rw [this]
exact contDiff_const

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what happened here?

simpa [this] using! contDiff_const
rw [this]
exact contDiff_const

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change

@themathqueen themathqueen added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 14, 2026
…ap₁₂ and remove the now-duplicate toLinearMap₁₂_apply lemma
@mpacholski mpacholski force-pushed the feat/linear-map-add-smul branch 2 times, most recently from a6312c3 to e345bfe Compare July 14, 2026 19:38
@mpacholski mpacholski force-pushed the feat/linear-map-add-smul branch from c6d6a29 to 242e4da Compare July 14, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-topology Topological spaces, uniform spaces, metric spaces, filters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants