Skip to content
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

feat(LinearAlgebra/QuadraticForm/Basis): basis expansion of a quadratic map #18578

Open
wants to merge 117 commits into
base: master
Choose a base branch
from

Conversation

mans0954
Copy link
Collaborator

@mans0954 mans0954 commented Nov 3, 2024

Three lemmas about Quadratic maps applied to:

  • A finite sum
  • A linearCombination
  • The representation of an element wrt a basis

Open in Gitpod

@mans0954 mans0954 added the t-algebra Algebra (groups, rings, fields, etc) label Nov 3, 2024
Copy link

github-actions bot commented Nov 3, 2024

PR summary b6cdfd3a4c

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Data.Sym.Sym2 480 484 +4 (+0.83%)
Mathlib.LinearAlgebra.QuadraticForm.Basis 1431 1432 +1 (+0.07%)
Import changes for all files
Files Import difference
21 files Mathlib.Combinatorics.SimpleGraph.Acyclic Mathlib.Combinatorics.SimpleGraph.Connectivity.Represents Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting Mathlib.Combinatorics.SimpleGraph.DegreeSum Mathlib.Combinatorics.SimpleGraph.Density Mathlib.Combinatorics.SimpleGraph.Girth Mathlib.Combinatorics.SimpleGraph.Matching Mathlib.Combinatorics.SimpleGraph.Regularity.Energy Mathlib.Combinatorics.SimpleGraph.Regularity.Uniform Mathlib.Combinatorics.SimpleGraph.Triangle.Basic Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite Mathlib.Combinatorics.SimpleGraph.UniversalVerts Mathlib.LinearAlgebra.QuadraticForm.Basis Mathlib.SetTheory.Game.Birthday Mathlib.SetTheory.Game.Domineering Mathlib.SetTheory.Game.Nim Mathlib.SetTheory.Game.Ordinal Mathlib.SetTheory.Game.Short Mathlib.SetTheory.Game.State Mathlib.SetTheory.Surreal.Basic
1
6 files Mathlib.Combinatorics.SimpleGraph.Coloring Mathlib.Combinatorics.SimpleGraph.ConcreteColorings Mathlib.Combinatorics.SimpleGraph.Diam Mathlib.Combinatorics.SimpleGraph.Metric Mathlib.Combinatorics.SimpleGraph.Partition Mathlib.Combinatorics.SimpleGraph.Sum
3
29 files Mathlib.Algebra.BigOperators.Sym Mathlib.Combinatorics.Digraph.Orientation Mathlib.Combinatorics.SimpleGraph.Basic Mathlib.Combinatorics.SimpleGraph.Circulant Mathlib.Combinatorics.SimpleGraph.Clique Mathlib.Combinatorics.SimpleGraph.Dart Mathlib.Combinatorics.SimpleGraph.Finite Mathlib.Combinatorics.SimpleGraph.Hamiltonian Mathlib.Combinatorics.SimpleGraph.Hasse Mathlib.Combinatorics.SimpleGraph.LineGraph Mathlib.Combinatorics.SimpleGraph.Maps Mathlib.Combinatorics.SimpleGraph.Operations Mathlib.Combinatorics.SimpleGraph.Path Mathlib.Combinatorics.SimpleGraph.Prod Mathlib.Combinatorics.SimpleGraph.Subgraph Mathlib.Combinatorics.SimpleGraph.Trails Mathlib.Combinatorics.SimpleGraph.Turan Mathlib.Combinatorics.SimpleGraph.Walk Mathlib.Data.Finset.Sym Mathlib.Data.List.Sym Mathlib.Data.Multiset.Sym Mathlib.Data.Sym.Card Mathlib.Data.Sym.Sym2.Order Mathlib.Data.Sym.Sym2 Mathlib.Order.GameAdd Mathlib.SetTheory.Game.Basic Mathlib.SetTheory.Game.Impartial Mathlib.SetTheory.Game.PGame Mathlib.SetTheory.ZFC.Ordinal
4

Declarations diff

+ Sym2.mul_finsupp
+ Sym2.mul_finsupp_support
+ Sym2.testB
+ apply_linearCombination
+ apply_linearCombination'
+ coe_pointwise_module_smul
+ map_finsuppSum
+ map_finsuppSum'
+ mul
+ mul_sym2Mk
+ pointwiseModuleScalar
+ polarSym2_map_mul
+ smul
+ sum_polar_sub_repr_sq
+ sum_repr_sq_add_sum_repr_mul_polar
+ test

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/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).

@mans0954 mans0954 marked this pull request as ready for review November 3, 2024 14:43
@mans0954 mans0954 requested a review from eric-wieser November 3, 2024 14:43
@mans0954
Copy link
Collaborator Author

mans0954 commented Nov 3, 2024

CC: @eric-wieser

@mans0954 mans0954 added the WIP Work in progress label Nov 5, 2024
@mans0954 mans0954 removed the request for review from eric-wieser November 6, 2024 08:22
@mans0954 mans0954 marked this pull request as draft November 6, 2024 08:23
@mans0954 mans0954 marked this pull request as ready for review November 6, 2024 18:03
@mans0954 mans0954 removed the WIP Work in progress label Nov 6, 2024
@Ruben-VandeVelde Ruben-VandeVelde changed the title feature(LinearAlgebra/QuadraticForm/Basis): basis expansion of a quadratic map feat(LinearAlgebra/QuadraticForm/Basis): basis expansion of a quadratic map Nov 6, 2024
mans0954 added a commit that referenced this pull request Nov 24, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 10, 2025
…olar to Sym2 (#21593)

Given a function `f : M → N` (`M` and `N` additive commutative groups) `QuadraticMap.polar f : M → M → N` is always symmetric and so has a lift to `Sym2 M → N`, which is defined as `QuadraticMap.polarSym2` in this PR.

This definition allows the statements of `QuadraticMap.map_sum` and `QuadraticMap.map_sum'` to be given in a more pleasing form.

The intention is to use `polarSym2` more extensively in #18578.



Co-authored-by: Christopher Hoskin <[email protected]>
Co-authored-by: Eric Wieser <[email protected]>
mathlib-bors bot pushed a commit that referenced this pull request Feb 10, 2025
…olar to Sym2 (#21593)

Given a function `f : M → N` (`M` and `N` additive commutative groups) `QuadraticMap.polar f : M → M → N` is always symmetric and so has a lift to `Sym2 M → N`, which is defined as `QuadraticMap.polarSym2` in this PR.

This definition allows the statements of `QuadraticMap.map_sum` and `QuadraticMap.map_sum'` to be given in a more pleasing form.

The intention is to use `polarSym2` more extensively in #18578.



Co-authored-by: Christopher Hoskin <[email protected]>
Co-authored-by: Eric Wieser <[email protected]>
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 11, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 11, 2025
Comment on lines +116 to +118
variable [Semiring β] [AddCommMonoid γ] [Module β γ]

instance pointwiseModuleScalar : HMul (α →₀ β) (α → γ) (α →₀ γ) where
Copy link
Member

Choose a reason for hiding this comment

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

I think inheriting a * from a smul in this way is not an established pattern in mathlib. This would maybe be a little less objectionable if it used HSMul, but fundamentally the heterogenous classes create nasty diamond issues (which I touch on briefly in Section 4.8 of my thesis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-merge t-algebra Algebra (groups, rings, fields, etc) WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants