Skip to content

feat(Geometry/Convex/ConvexSpace): show that an AffineMap IsAffineMap#39437

Open
ooovi wants to merge 9 commits into
leanprover-community:masterfrom
ooovi:affine_map_isaffinemap
Open

feat(Geometry/Convex/ConvexSpace): show that an AffineMap IsAffineMap#39437
ooovi wants to merge 9 commits into
leanprover-community:masterfrom
ooovi:affine_map_isaffinemap

Conversation

@ooovi

@ooovi ooovi commented May 15, 2026

Copy link
Copy Markdown
Collaborator

Show that Convexity.IsAffineMap generalises AffineMaps between affine spaces.


Open in Gitpod

@github-actions github-actions Bot added the t-convex-geometry Affine geometry, cones, simplices label May 15, 2026
@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

PR summary 46c86287c1

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ isAffineMap
+ of_apply_affineCombination

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.

Current commit 46c86287c1
Reference commit c87658adb9

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

@Paul-Lez
Paul-Lez self-requested a review May 17, 2026 17:34
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 21, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@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 May 21, 2026
@ooovi

ooovi commented May 21, 2026

Copy link
Copy Markdown
Collaborator Author

I hope did the correct thing with the local instance...?

Comment thread Mathlib/Geometry/Convex/ConvexSpace/AffineSpace.lean Outdated
Co-authored-by: Paul Lezeau <paul.lezeau@gmail.com>
@ooovi
ooovi temporarily deployed to cache-upload-forks June 4, 2026 09:30 — with GitHub Actions Inactive
@ooovi
ooovi temporarily deployed to cache-upload-forks June 4, 2026 09:38 — with GitHub Actions Inactive

attribute [local instance] AddTorsor.toConvexSpace

lemma of_apply_affineCombination

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
lemma of_apply_affineCombination
lemma of_map_affineCombination

is the naming convention when the applied function is a free variable (or the coercion to function of a free variable)

See leanprover-community/leanprover-community.github.io#886

/-- A map between convex spaces is affine if it preserves convex combinations.

TODO: Show that this generalises affine maps between affine spaces, see `AffineMap`. -/
/-- A map between convex spaces is affine if it preserves convex combinations. -/

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
/-- A map between convex spaces is affine if it preserves convex combinations. -/
/-- A map between convex spaces is affine if it preserves convex combinations.
Note that this generalises the notion of affine maps between affine spaces.
See `AffineMap.isAffineMap` for one direction.
TODO: Prove the other direction. -/

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 25, 2026
(H : ∀ {ι : Type u_6} (s : Finset ι) (p : ι → P) (w : ι → k),
∑ i ∈ s, w i = 1 →
f ((affineCombination k s p) w) = (affineCombination k s (f ∘ p)) w) :
IsAffineMap k f where

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
IsAffineMap k f where
IsAffineMap k f where

{k : Type u_1} {V P V₂ P₂ : Type*} [PartialOrder k] [Ring k] [IsStrictOrderedRing k]
[AddCommGroup V] [Module k V] [S : AffineSpace V P]
[AddCommGroup V₂] [Module k V₂] [AffineSpace V₂ P₂] (f : P → P₂)
(H : ∀ {ι : Type u_6} (s : Finset ι) (p : ι → P) (w : ι → k),

@Paul-Lez Paul-Lez Jun 25, 2026

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.

One small note: I wasn't very satisfied with the universe for ι in this line, which is why my first suggestion was

lemma AffineMap.isAffineMap {V2 P2 : Type*} [AddCommGroup V2] [Module R V2] [AffineSpace V2 P2]
    (f : P →ᵃ[R] P2) : IsAffineMap R f  where
  map_sConvexComb s := by
     rw [sConvexComb_eq_affineCombination, map_affineCombination s.weights.support _root_.id
      s.weights s.total, ←iConvexComb_eq_affineCombination, Function.comp_id, iConvexComb]

Perhaps here the correct thing to do would be to just use Type?

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. t-convex-geometry Affine geometry, cones, simplices

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants