Skip to content

[Merged by Bors] - feat: definition of ConvexSpace - #31984

Closed
kim-em wants to merge 25 commits into
leanprover-community:masterfrom
kim-em:ConvexSpace
Closed

kim-em wants to merge 25 commits into
leanprover-community:masterfrom
kim-em:ConvexSpace

Conversation

@kim-em

@kim-em kim-em commented Nov 23, 2025 •

Copy link
Copy Markdown
Contributor

This PR introduces ConvexSpace, an algebraic structure for spaces equipped with finite convex combinations.

The main definitions are:

  • StdSimplex R M: A finitely supported probability distribution over M with non-negative coefficients in R that sum to 1.
  • StdSimplex.single, StdSimplex.duple: Constructors for point mass and two-point distributions.
  • StdSimplex.map, StdSimplex.join: Monadic operations on standard simplices.
  • ConvexSpace R M: A typeclass with convexCombination : StdSimplex R M → M satisfying monadic laws (assoc and single).
  • convexCombo₂: Binary convex combinations of two points.

The design follows a monadic structure where StdSimplex R forms a monad and convexCombination is a monadic algebra. This eliminates the need for explicit extensionality axioms and avoids universe issues with indexed families.

🤖 Prepared with Claude Code

@github-actions

github-actions Bot commented Nov 23, 2025 •

Copy link
Copy Markdown

PR summary a2c6b11ab0

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.LinearAlgebra.ConvexSpace (new file) 545

Declarations diff

+ ConvexSpace
+ StdSimplex
+ convexComboPair
+ duple
+ join
+ map
+ single

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

@github-actions github-actions Bot added the t-algebra Algebra (groups, rings, fields, etc) label Nov 23, 2025
Comment thread Mathlib/LinearAlgebra/ConvexSpace.lean Resolved
Comment thread Mathlib/LinearAlgebra/ConvexSpace.lean Resolved
@plp127

plp127 commented Nov 23, 2025

Copy link
Copy Markdown
Contributor

I independently discovered this algebraic theory while biking two months ago, so I opened a zulip thread: #maths > Affine Combination Space

Comment thread Mathlib/LinearAlgebra/ConvexSpace.lean Resolved
@YaelDillies YaelDillies self-assigned this Nov 23, 2025
Comment thread Mathlib/LinearAlgebra/ConvexSpace.lean Resolved
Comment thread Mathlib/LinearAlgebra/ConvexSpace.lean Resolved
@kim-em
kim-em requested a review from ADedecker December 8, 2025 03:21
@kim-em kim-em changed the title feat: proposed definition of ConvexSpace feat: definition of ConvexSpace Dec 8, 2025
Comment thread Mathlib/LinearAlgebra/ConvexSpace.lean Resolved
@ocfnash

ocfnash commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Dec 19, 2025
mathlib-bors Bot pushed a commit that referenced this pull request Dec 19, 2025
This PR introduces `ConvexSpace`, an algebraic structure for spaces equipped with finite convex combinations.

The main definitions are:

* `StdSimplex R M`: A finitely supported probability distribution over `M` with non-negative coefficients in `R` that sum to 1.
* `StdSimplex.single`, `StdSimplex.duple`: Constructors for point mass and two-point distributions.
* `StdSimplex.map`, `StdSimplex.join`: Monadic operations on standard simplices.
* `ConvexSpace R M`: A typeclass with `convexCombination : StdSimplex R M → M` satisfying monadic laws (`assoc` and `single`).
* `convexCombo₂`: Binary convex combinations of two points.

The design follows a monadic structure where `StdSimplex R` forms a monad and `convexCombination` is a monadic algebra. This eliminates the need for explicit extensionality axioms and avoids universe issues with indexed families.

🤖 Prepared with Claude Code

Co-authored-by: ADedecker <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: definition of ConvexSpace [Merged by Bors] - feat: definition of ConvexSpace Dec 19, 2025
@mathlib-bors mathlib-bors Bot closed this Dec 19, 2025
kim-em added a commit to kim-em/mathlib4 that referenced this pull request Jan 6, 2026
This PR introduces `ConvexSpace`, an algebraic structure for spaces equipped with finite convex combinations.

The main definitions are:

* `StdSimplex R M`: A finitely supported probability distribution over `M` with non-negative coefficients in `R` that sum to 1.
* `StdSimplex.single`, `StdSimplex.duple`: Constructors for point mass and two-point distributions.
* `StdSimplex.map`, `StdSimplex.join`: Monadic operations on standard simplices.
* `ConvexSpace R M`: A typeclass with `convexCombination : StdSimplex R M → M` satisfying monadic laws (`assoc` and `single`).
* `convexCombo₂`: Binary convex combinations of two points.

The design follows a monadic structure where `StdSimplex R` forms a monad and `convexCombination` is a monadic algebra. This eliminates the need for explicit extensionality axioms and avoids universe issues with indexed families.

🤖 Prepared with Claude Code

Co-authored-by: ADedecker <[email protected]>
goliath-klein pushed a commit to PrParadoxy/mathlib4 that referenced this pull request Jan 24, 2026
This PR introduces `ConvexSpace`, an algebraic structure for spaces equipped with finite convex combinations.

The main definitions are:

* `StdSimplex R M`: A finitely supported probability distribution over `M` with non-negative coefficients in `R` that sum to 1.
* `StdSimplex.single`, `StdSimplex.duple`: Constructors for point mass and two-point distributions.
* `StdSimplex.map`, `StdSimplex.join`: Monadic operations on standard simplices.
* `ConvexSpace R M`: A typeclass with `convexCombination : StdSimplex R M → M` satisfying monadic laws (`assoc` and `single`).
* `convexCombo₂`: Binary convex combinations of two points.

The design follows a monadic structure where `StdSimplex R` forms a monad and `convexCombination` is a monadic algebra. This eliminates the need for explicit extensionality axioms and avoids universe issues with indexed families.

🤖 Prepared with Claude Code

Co-authored-by: ADedecker <[email protected]>
mathlib-bors Bot pushed a commit that referenced this pull request Sep 2, 2026
…StdSimplex` instead of `stdSimplex` (#42181)

Before #28893, the topological simplex (used for the definition of singular homology) was defined as a subtype of `Fin (n + 1) → ℝ≥0` which did not interact well with the convexity API which at the time required working with subtypes of vector spaces. Since #28893, we relied on `stdSimplex` which was a subtype of `Fin (n + 1) → ℝ` in order to use the convexity API. Since #31984, the convexity API allows to work with convex spaces not necessarily embedded in vector spaces and we have the new definition of `StdSimplex`, on which a topology was set up in #42131. This PR deprecates `stdSimplex` in favour of `StdSimplex`.
joelriou added a commit to joelriou/mathlib4 that referenced this pull request Sep 5, 2026
…StdSimplex` instead of `stdSimplex` (leanprover-community#42181)

Before leanprover-community#28893, the topological simplex (used for the definition of singular homology) was defined as a subtype of `Fin (n + 1) → ℝ≥0` which did not interact well with the convexity API which at the time required working with subtypes of vector spaces. Since leanprover-community#28893, we relied on `stdSimplex` which was a subtype of `Fin (n + 1) → ℝ` in order to use the convexity API. Since leanprover-community#31984, the convexity API allows to work with convex spaces not necessarily embedded in vector spaces and we have the new definition of `StdSimplex`, on which a topology was set up in leanprover-community#42131. This PR deprecates `stdSimplex` in favour of `StdSimplex`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants