Skip to content

Commit 5b6287c

Browse files
committed
feat(Geometry/Convex): cartesian product of convex spaces (#39407)
Provide a `ConvexSpace` instance for `Prod` and `Pi`.
1 parent 3479b31 commit 5b6287c

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4510,6 +4510,7 @@ public import Mathlib.Geometry.Convex.Cone.Simplicial
45104510
public import Mathlib.Geometry.Convex.Cone.TensorProduct
45114511
public import Mathlib.Geometry.Convex.ConvexSpace.AffineSpace
45124512
public import Mathlib.Geometry.Convex.ConvexSpace.Defs
4513+
public import Mathlib.Geometry.Convex.ConvexSpace.Prod
45134514
public import Mathlib.Geometry.Diffeology.Basic
45144515
public import Mathlib.Geometry.Euclidean.Altitude
45154516
public import Mathlib.Geometry.Euclidean.Angle.Bisector
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/-
2+
Copyright (c) 2026 Yaël Dillies. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yaël Dillies
5+
-/
6+
module
7+
8+
public import Mathlib.Geometry.Convex.ConvexSpace.Defs
9+
10+
/-!
11+
# Product of convex spaces
12+
13+
This file defines the cartesian product of convex spaces.
14+
-/
15+
16+
open Convexity Finsupp Set
17+
18+
public noncomputable section
19+
20+
variable {I R : Type*} [Semiring R] [PartialOrder R] [IsStrictOrderedRing R]
21+
22+
namespace Prod
23+
variable {X Y : Type*} [ConvexSpace R X] [ConvexSpace R Y]
24+
25+
instance : ConvexSpace R (X × Y) := .mk
26+
(fun w ↦ (w.iConvexComb fst, w.iConvexComb snd))
27+
(by simp)
28+
(by simp [Function.comp_def, iConvexComb_assoc])
29+
30+
@[simp]
31+
lemma fst_sConvexComb (w : StdSimplex R (X × Y)) : w.sConvexComb.fst = w.iConvexComb fst := rfl
32+
33+
@[simp]
34+
lemma snd_sConvexComb (w : StdSimplex R (X × Y)) : w.sConvexComb.snd = w.iConvexComb snd := rfl
35+
36+
@[fun_prop]
37+
lemma isAffineMap_fst : IsAffineMap R (fst : X × Y → X) where map_sConvexComb := fst_sConvexComb
38+
39+
@[fun_prop]
40+
lemma isAffineMap_snd : IsAffineMap R (snd : X × Y → Y) where map_sConvexComb := snd_sConvexComb
41+
42+
@[simp]
43+
lemma fst_iConvexComb (w : StdSimplex R I) (f : I → X × Y) :
44+
(w.iConvexComb f).fst = w.iConvexComb (fun i ↦ (f i).fst) :=
45+
isAffineMap_fst.map_iConvexComb ..
46+
47+
@[simp]
48+
lemma snd_iConvexComb (w : StdSimplex R I) (f : I → X × Y) :
49+
(w.iConvexComb f).snd = w.iConvexComb (fun i ↦ (f i).snd) :=
50+
isAffineMap_snd.map_iConvexComb ..
51+
52+
end Prod
53+
54+
namespace Pi
55+
variable {ι : Type*} {X : ι → Type*} [∀ i, ConvexSpace R (X i)] {i : ι}
56+
57+
instance : ConvexSpace R (∀ i, X i) := .mk
58+
(fun w i ↦ w.iConvexComb (· i))
59+
(by simp)
60+
(by simp [Function.comp_def, iConvexComb_assoc])
61+
62+
@[simp]
63+
lemma sConvexComb_apply (w : StdSimplex R (∀ i, X i)) (i : ι) :
64+
w.sConvexComb i = w.iConvexComb (· i) := rfl
65+
66+
@[fun_prop]
67+
lemma isAffineMap_eval : IsAffineMap R (· i : (∀ i, X i) → X i) where
68+
map_sConvexComb _ := sConvexComb_apply ..
69+
70+
@[simp]
71+
lemma iConvexComb_apply (w : StdSimplex R I) (f : I → ∀ i, X i) (i : ι) :
72+
w.iConvexComb f i = w.iConvexComb (fun j ↦ f j i) := isAffineMap_eval.map_iConvexComb ..
73+
74+
end Pi

0 commit comments

Comments
 (0)