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