Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Mathlib/Geometry/Convex/ConvexSpace/AffineSpace.lean
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,32 @@ theorem convexCombPair_eq_lineMap (s t : R) (hs : 0 ≤ s) (ht : 0 ≤ t)
simp [vsub_self]

end AddTorsor

section

namespace AffineMap

open Finset AddTorsor

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

{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?

∑ 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

map_sConvexComb s := by
rw [sConvexComb_eq_affineCombination, H s.weights.support _root_.id s.weights s.total,
←iConvexComb_eq_affineCombination, Function.comp_id, iConvexComb]

lemma isAffineMap {V2 P2 : Type*} [AddCommGroup V2] [Module R V2] [AffineSpace V2 P2]
(f : P →ᵃ[R] P2) : IsAffineMap R f := by
apply of_apply_affineCombination
grind [map_affineCombination]

end AffineMap

end
4 changes: 1 addition & 3 deletions Mathlib/Geometry/Convex/ConvexSpace/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,7 @@ abbrev ConvexSpace.mk {M : Type*} (sConvexComb : StdSimplex R M → M)
⟨sConvexComb, single, assoc⟩

variable (R) in
/-- 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. -/

@[fun_prop]
structure IsAffineMap (f : M → N) : Prop where
map_sConvexComb (s : StdSimplex R M) : f s.sConvexComb = (s.map f).sConvexComb
Expand Down
Loading