Skip to content

feat(Analysis/CStarAlgebra/CStarMatrix): operator-monotone rpow/log/sqrt specializations#39734

Draft
allenhaozhu wants to merge 1 commit into
leanprover-community:masterfrom
allenhaozhu:ltfp-add-cstarmatrix-operator-monotone
Draft

feat(Analysis/CStarAlgebra/CStarMatrix): operator-monotone rpow/log/sqrt specializations#39734
allenhaozhu wants to merge 1 commit into
leanprover-community:masterfrom
allenhaozhu:ltfp-add-cstarmatrix-operator-monotone

Conversation

@allenhaozhu

Copy link
Copy Markdown

Adds three discoverability lemmas for operator-monotonicity on CStarMatrix n n A, specializing the existing C*-algebra-level results from CFC.monotone_rpow / CFC.log_monotoneOn / CFC.monotone_sqrt:

CStarMatrix.monotone_rpow {p : ℝ} (hp : p ∈ Set.Icc 0 1) :
    Monotone (fun M : CStarMatrix n n A => M ^ p)

CStarMatrix.log_monotoneOn :
    MonotoneOn (CFC.log : CStarMatrix n n A → CStarMatrix n n A)
      {M | IsStrictlyPositive M}

CStarMatrix.monotone_sqrt :
    Monotone (CFC.sqrt : CStarMatrix n n A → CStarMatrix n n A)

In the course of implementing these specializations, three shortcut instances are also registered to bypass a typeclass-diamond issue. CStarMatrix n n A derives CStarAlgebra from the underlying CStarAlgebra A, but the typeclass search for ContinuousFunctionalCalculus ℝ (CStarMatrix n n A) IsSelfAdjoint does not find the path through the Matrix diamond automatically. Explicit shortcut instances enable ergonomic use of CFC.rpow, CFC.log, etc.:

instance instContinuousFunctionalCalculusRealIsSelfAdjoint
instance instNonUnitalContinuousFunctionalCalculusRealIsSelfAdjoint
instance instNonnegSpectrumClassReal

Reviewer note: I am NOT attached to this PR — if reviewers prefer that downstream users call CFC.monotone_rpow directly and accept the typeclass-search cost, please close. The PR is offered as a convenience on the assumption that matrix-shaped users may search the matrix namespace first and benefit from the diamond shortcut. The shortcut instances may also belong in a separate PR if reviewers prefer.

Extracted from LTFP-Lean (mechanical formalization of Bach's Learning Theory from First Principles), where matrix-side ergonomics matter for downstream proofs.


AI-assistance disclosure

Per the Mathlib AI-use policy:

  • Tool. Claude Code (Anthropic) with the Claude Opus 4.7 model.
  • Use. I specified the three target specialization lemmas. The assistant placed them in the right file, discovered the typeclass-diamond issue while implementing (adding 3 shortcut instances to resolve it), drafted the proofs, and verified the build under lake build Mathlib.Analysis.CStarAlgebra.CStarMatrix.OperatorMonotone. I reviewed the final code.
  • Vouching. I have read the declarations and can defend the proofs without further AI assistance. I welcome reviewer feedback on:
    • whether the three specialization lemmas justify their own file or should be merged into CStarMatrix.lean
    • whether the typeclass-diamond shortcut instances belong in this PR or a separate one
    • whether the convenience-layer is justified at all vs. having downstream users call CFC.* directly

…qrt specializations

Adds 3 shortcut instances (ContinuousFunctionalCalculus ℝ, NonUnitalContinuousFunctionalCalculus ℝ, NonnegSpectrumClass ℝ) for CStarMatrix n n A to bypass a typeclass-diamond issue that prevents automatic discovery through the Matrix diamond. Then specializes CFC.monotone_rpow / CFC.log_monotoneOn / CFC.monotone_sqrt to CStarMatrix n n A for discoverability via the CStarMatrix namespace.
@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 May 23, 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-analysis Analysis (normed *, calculus) label May 23, 2026
@github-actions

Copy link
Copy Markdown

PR summary a3bf4892db

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.CStarAlgebra.CStarMatrix.OperatorMonotone (new file) 2794

Declarations diff

+ instContinuousFunctionalCalculusRealIsSelfAdjoint
+ instNonUnitalContinuousFunctionalCalculusRealIsSelfAdjoint
+ instNonnegSpectrumClassReal
+ log_monotoneOn
+ monotone_rpow
+ monotone_sqrt

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.


No changes to strong technical debt.
No changes to weak technical debt.

@grunweg grunweg added the LLM-generated PRs with substantial input from LLMs - review accordingly label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM-generated PRs with substantial input from LLMs - review accordingly new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants