Martin Escardo, 15th April 2025
We look at convex bodies (= cancellative, iterative mindpoint objects)
in the β-topos of types.
NB. Here the category of sets in a universe π€ can be any π-topos in models.
These are experimental thoughts while finishing the joirnal version of
the interval objects paper with Alex Simpson.
Euclidean interval objects in categories with finite products
https://arxiv.org/abs/2504.21551
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import MLTT.Spartan hiding (_+_)
open import Naturals.Addition
open import UF.FunExt
open import UF.Sets
open import UF.Sets-Properties
open import UF.Subsingletons
open import UF.Subsingletons-FunExt
open import UF.Subsingletons-Properties
open import UF.Base
module gist.IntervalObject
(fe : Fun-Ext)
where
convex-body-structure : π€ Μ β π€ Μ
convex-body-structure X = X β X β X
is-convex-body : (X : π€ Μ ) β convex-body-structure X β π€ Μ
is-convex-body X _β_ = Carrier-is-set Γ Idemp Γ Comm Γ Transp Γ Cancel Γ Iter
where
Carrier-is-set = is-set X
Idemp = (x : X) β x β x οΌ x
Comm = (x y : X) β x β y οΌ y β x
Transp = (a b x y : X) β (a β b) β (x β y) οΌ (a β x) β (b β y)
Cancel = (a x y : X) β a β x οΌ a β y β x οΌ y
Iter = Ξ£ β¨ κ ((β β X) β X) , Unfolding β¨ Γ Canonicity β¨
where
Unfolding = β¨ β¦ ((x : β β X) β β¨ x οΌ x 0 β β¨ (x β succ))
Canonicity = β¨ β¦ ((x y : β β X)
β ((i : β) β y i οΌ x i β y (succ i))
β y 0 οΌ β¨ x)
\end{code}
NB. We are adopting the formulation of iteration that uses unfolding
an canonicity, which is possible as we have a natural numbers type.
NB. The iteration axiom is property, and hence so is
is-convex-body. (TODO in due course.)
\begin{code}
Convex-Body : (π€ : Universe) β π€ βΊ Μ
Convex-Body π€ = Ξ£ A κ π€ Μ , Ξ£ s κ convex-body-structure A , is-convex-body A s
β¨_β© : Convex-Body π€ β π€ Μ
β¨ A , _ β© = A
is-hom : (π : Convex-Body π€) (π : Convex-Body π₯)
β (β¨ π β© β β¨ π β©) β π€ β π₯ Μ
is-hom (A , _β_ , _) (_ , _β_ , _) f = (x y : A) β f (x β y) οΌ f x β f y
is-Hom : (π : Convex-Body π€) (π : Convex-Body π₯)
β (β¨ π β© β β¨ π β©) β π€ β π₯ Μ
is-Hom (A , _ , _ , _ , _ , _ , _ , β¨α΅ , _)
(_ , _ , _ , _ , _ , _ , _ , β¨α΅ , _) f
= (x : β β A) β f (β¨α΅ x) οΌ β¨α΅ (f β x)
homs-are-Homs : (π : Convex-Body π€) (π : Convex-Body π₯)
(f : β¨ π β© β β¨ π β©)
β is-hom π π f
β is-Hom π π f
homs-are-Homs (_ , _βα΅_ , _ , _ , _ , _ , _ , β¨α΅ , unfoldingα΅ , _)
(_ , _βα΅_ , _ , _ , _ , _ , _ , β¨α΅ , _ , canonicityα΅)
f f-is-hom x
= II
where
I : (i : β) β f (β¨α΅ (j β¦ x (j + i))) οΌ (f (x i) βα΅ f (β¨α΅ (j β¦ x (j + succ i))))
I i = f (β¨α΅ (j β¦ x (j + i))) οΌβ¨ ap f (unfoldingα΅ _) β©
f (x (0 + i) βα΅ β¨α΅ (j β¦ x (succ j + i))) οΌβ¨ f-is-hom _ _ β©
f (x (0 + i)) βα΅ f (β¨α΅ (j β¦ x (succ j + i))) οΌβ¨ Iβ β©
(f (x i) βα΅ f (β¨α΅ (j β¦ x (j + succ i)))) β
where
Iβ = j β¦ (succ j + i οΌβ¨ addition-commutativity (succ j) i β©
i + succ j οΌβ¨ refl β©
succ (i + j) οΌβ¨ ap succ (addition-commutativity i j) β©
succ (j + i) οΌβ¨ refl β©
j + succ i β)
Iβ = apβ _βα΅_
(ap (f β x) (addition-commutativity 0 i))
(ap (f β β¨α΅) (dfunext fe (j β¦ ap x (Iβ j))))
II : f (β¨α΅ x) οΌ β¨α΅ (f β x)
II = canonicityα΅ (f β x) (i β¦ f (β¨α΅ (j β¦ x (j + i)))) I
\end{code}
TODO. Add a proof Homs-are-homs of the converse (not needed for our
current purposes).
\begin{code}
id-is-hom : (π : Convex-Body π€)
β is-hom π π id
id-is-hom π aβ aβ = refl
const-is-hom : (π : Convex-Body π€) (π : Convex-Body π₯)
(b : β¨ π β©)
β is-hom π π (_ β¦ b)
const-is-hom π π@(_ , _β_ , _ , idemp , _) b aβ aβ = (idemp b)β»ΒΉ
module _ (π@(A , _β_ , _ , idemp , _ , transp , _) : Convex-Body π€) where
β-is-left-hom : (x : A)
β is-hom π π (_β x)
β-is-left-hom x y z =
(y β z) β x οΌβ¨ ap ((y β z) β_) ((idemp x)β»ΒΉ) β©
(y β z) β (x β x) οΌβ¨ transp y z x x β©
(y β x) β (z β x) β
β-is-right-hom : (x : A)
β is-hom π π (x β_)
β-is-right-hom x y z =
x β (y β z) οΌβ¨ ap (_β (y β z)) ((idemp x)β»ΒΉ) β©
(x β x) β (y β z) οΌβ¨ transp x x y z β©
(x β y) β (x β z) β
β-is-hom : (π : Convex-Body π€) (π : Convex-Body π₯) (π : Convex-Body π¦)
(f : β¨ π β© β β¨ π β©) (g : β¨ π β© β β¨ π β©)
β is-hom π π f
β is-hom π π g
β is-hom π π (g β f)
β-is-hom π@(A , _βα΅_ , _) π@(B , _βα΅_ , _) π@(C , _βαΆ_ , _)
f g f-is-hom g-is-hom aβ aβ =
g (f (aβ βα΅ aβ)) οΌβ¨ ap g (f-is-hom aβ aβ) β©
g (f aβ βα΅ f aβ) οΌβ¨ g-is-hom (f aβ) (f aβ) β©
((g β f) aβ βαΆ (g β f) aβ) β
is-interval-object : (π : Convex-Body π€) β β¨ π β© β β¨ π β© β π€Ο
is-interval-object π aβ aβ =
{π₯ : Universe} (π : Convex-Body π₯) (bβ bβ : β¨ π β©)
β β! h κ (β¨ π β© β β¨ π β©) , is-hom π π h
Γ (h aβ οΌ bβ)
Γ (h aβ οΌ bβ)
module _ (π§@(X ,
_β_ ,
X-is-set ,
β-idemp ,
β-comm ,
β-transp ,
β-cancel ,
β-iter@(M , β-unfolding , β-canonicity))
: Convex-Body π₯)
where
append : X β (β β X) β (β β X)
append x s 0 = x
append x s (succ i) = s i
constant-sequence : X β (β β X)
constant-sequence x i = x
β-fix : (a x : X) β a οΌ x β a β a οΌ x
β-fix a x e = β-cancel a a x
(a β a οΌβ¨ β-idemp a β©
a οΌβ¨ e β©
x β a οΌβ¨ β-comm x a β©
a β x β)
constant-iteration : (x : X) β M (constant-sequence x) οΌ x
constant-iteration x = β-fix (M (constant-sequence x)) x I
where
I : M (constant-sequence x) οΌ x β M (constant-sequence x)
I = β-unfolding (constant-sequence x)
binary-from-infinitary : (x y : X) β M (append x (constant-sequence y)) οΌ x β y
binary-from-infinitary x y = I
where
I = M (append x (constant-sequence y)) οΌβ¨ Iβ β©
x β M (constant-sequence y) οΌβ¨ Iβ β©
x β y β
where
Iβ = β-unfolding (append x (constant-sequence y))
Iβ = ap (x β_) (constant-iteration y)
module _ (π€ : Universe)
(π@([π,π] ,
_β_ ,
[π,π]-is-set ,
β-idemp ,
β-comm ,
β-transp ,
β-cancel ,
β-iter@(β¨ , β-unfolding , β-canonicity)) : Convex-Body π€)
(π π : [π,π])
([π,π]-is-interval-object : is-interval-object π π π)
where
module standard-definitions
(π@(A , _β_ , A-is-set , β-idemp , β-comm , β-transp , β-cancel , β-iter)
: Convex-Body π₯)
where
\end{code}
We think of Ξ± aβ aβ defined below as the line from aβ to aβ in A, or
as the unique affine function that maps π to aβ and π to aβ. We also
think of Ξ± aβ aβ r as the weighted average of aβ and aβ with left
weight r and right weight 1 - r, often termed a convex combination of
aβ and aβ.
\begin{code}
Ξ± : A β A β [π,π] β A
Ξ± aβ aβ = β!-witness ([π,π]-is-interval-object π aβ aβ)
module _ (aβ aβ : A) where
Ξ±-property : is-hom π π (Ξ± aβ aβ)
Γ (Ξ± aβ aβ π οΌ aβ)
Γ (Ξ± aβ aβ π οΌ aβ)
Ξ±-property = β!-is-witness ([π,π]-is-interval-object π aβ aβ)
Ξ±-is-hom : is-hom π π (Ξ± aβ aβ)
Ξ±-is-hom = prβ Ξ±-property
Ξ±-lawβ : Ξ± aβ aβ π οΌ aβ
Ξ±-lawβ = prβ (prβ Ξ±-property)
Ξ±-lawβ : Ξ± aβ aβ π οΌ aβ
Ξ±-lawβ = prβ (prβ Ξ±-property)
at-most-one-hom : (h k : β¨ π β© β A)
β is-hom π π h Γ (h π οΌ aβ) Γ (h π οΌ aβ)
β is-hom π π k Γ (k π οΌ aβ) Γ (k π οΌ aβ)
β h βΌ k
at-most-one-hom h k u v =
happly (witness-uniqueness _ ([π,π]-is-interval-object π aβ aβ) h k u v)
Ξ±-uniqueness : (h : [π,π] β A)
β is-hom π π h Γ (h π οΌ aβ) Γ (h π οΌ aβ)
β h βΌ Ξ± aβ aβ
Ξ±-uniqueness h h-property = at-most-one-hom h (Ξ± aβ aβ) h-property Ξ±-property
Ξ±-uniquenessβ»ΒΉ : (h : [π,π] β A)
β is-hom π π h Γ (h π οΌ aβ) Γ (h π οΌ aβ)
β Ξ± aβ aβ βΌ h
Ξ±-uniquenessβ»ΒΉ h h-property r = (Ξ±-uniqueness h h-property r)β»ΒΉ
homs-charac : (h : [π,π] β A) β is-hom π π h β h βΌ Ξ± (h π) (h π)
homs-charac h h-is-hom = Ξ±-uniqueness (h π) (h π) h (h-is-hom , refl , refl)
homs-characβ»ΒΉ : (h : [π,π] β A) β is-hom π π h β Ξ± (h π) (h π) βΌ h
homs-characβ»ΒΉ h h-is-hom r = (homs-charac h h-is-hom r)β»ΒΉ
Ξ±-lawβ : (r : [π,π]) (x : A) β Ξ± x x r οΌ x
Ξ±-lawβ r x = homs-characβ»ΒΉ (_ β¦ x) (const-is-hom π π x) r
\end{code}
End of module standard-definitions, and still in anonymous module
assumming an interval [π,π].
Observation (17th April 2025). If we don't assume commutativity in the
definition of interval object, but only that π β π οΌ π β π, then we
get commutativity automatically. The advantage of a definition
replacing commutativity by commutativity at π and π only is that we
have a more general class of convex bodies in the universal
property. However, we will keep working with the less general
definition in this file, leaving the generalization to future work (of
the author or any interested reader).
\begin{code}
module observation where
open standard-definitions π
comm-automaticβ : (x : [π,π])
β π β π οΌ π β π
β π β x οΌ x β π
comm-automaticβ x e = at-most-one-hom (π β π) (π β π) (π β_) (_β π)
(β-is-right-hom π π , refl , refl)
(β-is-left-hom π π , refl , (e β»ΒΉ))
x
comm-automaticβ : (x : [π,π])
β π β π οΌ π β π
β π β x οΌ x β π
comm-automaticβ x e = at-most-one-hom (π β π) (π β π) (π β_) (_β π)
(β-is-right-hom π π , refl , refl)
(β-is-left-hom π π , e , refl)
x
comm-automatic : (x y : [π,π])
β π β π οΌ π β π
β x β y οΌ y β x
comm-automatic x y e =
at-most-one-hom (x β π) (x β π) (x β_) (_β x)
(β-is-right-hom π x , refl , refl)
(β-is-left-hom π x , comm-automaticβ x e , comm-automaticβ x e)
y
\end{code}
End of module observation and still in the anonymous module assuming
an interval object [π,π].
\begin{code}
open standard-definitions
private
Ξ±Μ² : [π,π] β [π,π] β [π,π] β [π,π]
Ξ±Μ² = Ξ± π
line-from-π-to-π-is-id : Ξ±Μ² π π βΌ id
line-from-π-to-π-is-id = homs-characβ»ΒΉ π id (id-is-hom π)
\end{code}
Induction on [π,π]. (Added 28th April 2025.)
This requires more than just a category with finite
products. Everything else in this file should work in a category with
finite products.
TODO. There should be a variation that doesn't assume that P is prop-valued.
\begin{code}
is-closed-under-midpoint : ([π,π] β π₯ Μ ) β π€ β π₯ Μ
is-closed-under-midpoint P = (r s : [π,π]) β P r β P s β P (r β s)
is-closed-under-big-midpoint : ([π,π] β π₯ Μ ) β π€ β π₯ Μ
is-closed-under-big-midpoint P = (x : β β [π,π]) β ((i : β) β P (x i)) β P (β¨ x)
closure-under-big-midpoint-gives-closure-under-midpoint
: (P : [π,π] β π₯ Μ )
β is-closed-under-big-midpoint P
β is-closed-under-midpoint P
closure-under-big-midpoint-gives-closure-under-midpoint
P P⨠r s pr ps
= transport P
(binary-from-infinitary π r s)
(Pβ¨ (append π r (constant-sequence π s)) I)
where
I : (i : β) β P (append π r (constant-sequence π s) i)
I 0 = pr
I (succ i) = ps
[π,π]-induction
: (P : [π,π] β π₯ Μ )
β ((r : [π,π]) β is-prop (P r))
β P π
β P π
β is-closed-under-big-midpoint P
β (r : [π,π]) β P r
[π,π]-induction {π₯} P P-is-prop-valued Pβ Pβ Pβ¨ = VI
where
X : π€ β π₯ Μ
X = Ξ£ r κ [π,π] , P r
X-is-set : is-set X
X-is-set = subtypes-of-sets-are-sets' prβ
(prβ-lc (P-is-prop-valued _))
[π,π]-is-set
Pβ : (r s : [π,π]) β P r β P s β P (r β s)
Pβ = closure-under-big-midpoint-gives-closure-under-midpoint P Pβ¨
_β_ : X β X β X
(r , pr) β (s , ps) = r β s , Pβ r s pr ps
β-idemp : (x : X) β x β x οΌ x
β-idemp (r , _) = to-subtype-οΌ P-is-prop-valued (β-idemp r)
β-comm : (x y : X) β x β y οΌ y β x
β-comm (r , _) (s , _) = to-subtype-οΌ P-is-prop-valued (β-comm r s)
β-transp : (a b x y : X) β (a β b) β (x β y) οΌ (a β x) β (b β y)
β-transp (u , _) (v , _) (r , _) (s , _) =
to-subtype-οΌ P-is-prop-valued (β-transp u v r s)
β-cancel : (a x y : X) β a β x οΌ a β y β x οΌ y
β-cancel (u , _) (r , _) (s , _) e =
to-subtype-οΌ P-is-prop-valued (β-cancel u r s (ap prβ e))
M : (β β X) β X
M x = (β¨ (prβ β x)) ,
Pβ¨ (prβ β x) (prβ β x)
β-unfolding : (x : β β X) β M x οΌ x 0 β M (x β succ)
β-unfolding x = to-subtype-οΌ P-is-prop-valued (β-unfolding (prβ β x))
β-canonicity : (x y : β β X)
β ((i : β) β y i οΌ x i β y (succ i))
β y 0 οΌ M x
β-canonicity x y a = to-subtype-οΌ P-is-prop-valued
(β-canonicity (prβ β x) (prβ β y) (Ξ» i β ap prβ (a i)))
β-iter = M , β-unfolding , β-canonicity
π§ : Convex-Body (π€ β π₯)
π§ = X , _β_ , X-is-set , β-idemp , β-comm , β-transp , β-cancel , β-iter
xβ xβ : X
xβ = π , Pβ
xβ = π , Pβ
h : [π,π] β X
h = Ξ± π§ xβ xβ
prβ-is-hom : is-hom π§ π prβ
prβ-is-hom x y = refl
I : is-hom π π (prβ β h)
I = β-is-hom π π§ π h prβ (Ξ±-is-hom π§ xβ xβ) prβ-is-hom
IIβ : prβ (h π) οΌ π
IIβ = ap prβ (Ξ±-lawβ π§ xβ xβ)
IIβ : prβ (h π) οΌ π
IIβ = ap prβ (Ξ±-lawβ π§ xβ xβ)
III : prβ β h βΌ Ξ±Μ² π π
III = Ξ±-uniqueness π π π (prβ β h) (I , IIβ , IIβ)
IV : prβ β h βΌ id
IV r = III r β line-from-π-to-π-is-id r
V : (r : [π,π]) β P (prβ (h r))
V r = prβ (h r )
VI : (r : [π,π]) β P r
VI r = transport P (IV r) (V r)
\end{code}
Notice, however, that a number of operations can be defined and their
properties can be easily established without induction, using only the
universal property of [π,π].
Complement and multiplication.
\begin{code}
π- : [π,π] β [π,π]
π- r = Ξ±Μ² π π r
π-π-is-π : π- π οΌ π
π-π-is-π = Ξ±-lawβ π π π
π-π-is-π : π- π οΌ π
π-π-is-π = Ξ±-lawβ π π π
π-is-hom : (r s : [π,π]) β π- (r β s) οΌ (π- r) β (π- s)
π-is-hom = Ξ±-is-hom π π π
π-involution : (r : [π,π]) β π- (π- r) οΌ r
π-involution =
at-most-one-hom π π π (π- β π-) id
(β-is-hom π π π π- π- π-is-hom π-is-hom ,
(π- (π- π) οΌβ¨ ap π- π-π-is-π β©
π- π οΌβ¨ π-π-is-π β©
π β) ,
(π- (π- π) οΌβ¨ ap π- π-π-is-π β©
π- π οΌβ¨ π-π-is-π β©
π β))
(id-is-hom π , refl , refl)
Β½ : [π,π]
Β½ = π β π
Β½-is-π-fix : π- Β½ οΌ Β½
Β½-is-π-fix =
π- Β½ οΌβ¨ π-is-hom π π β©
(π- π) β (π- π) οΌβ¨ apβ _β_ π-π-is-π π-π-is-π β©
π β π οΌβ¨ β-comm π π β©
π β π β
β-π-Β½-property : (r : [π,π]) β r β (π- r) οΌ Β½
β-π-Β½-property =
at-most-one-hom π Β½ Β½ h (_ β¦ Β½)
(h-is-hom , ap (π β_) π-π-is-π , (ap (π β_) π-π-is-π β β-comm π π))
(const-is-hom π π Β½ , refl , refl)
where
h : [π,π] β [π,π]
h r = r β (π- r)
h-is-hom : is-hom π π h
h-is-hom r s =
(r β s) β (π- (r β s)) οΌβ¨ ap ((r β s) β_) (π-is-hom r s) β©
(r β s) β ((π- r) β (π- s)) οΌβ¨ β-transp r s (π- r) (π- s) β©
(r β (π- r)) β (s β (π- s)) β
_Β·_ : [π,π] β [π,π] β [π,π]
r Β· s = Ξ±Μ² π s r
π-left : (s : [π,π]) β π Β· s οΌ π
π-left = Ξ±-lawβ π π
π-left : (s : [π,π]) β π Β· s οΌ s
π-left = Ξ±-lawβ π π
mult-is-left-hom : (s : [π,π]) β is-hom π π (_Β· s)
mult-is-left-hom = Ξ±-is-hom π π
mult-mid-left-distr : (r s t : [π,π]) β (r β s) Β· t οΌ (r Β· t) β (s Β· t)
mult-mid-left-distr r s t = mult-is-left-hom t r s
mult-is-assoc : (r s t : [π,π]) β r Β· (s Β· t) οΌ (r Β· s) Β· t
mult-is-assoc r s t = Ξ³
where
I : is-hom π π (r β¦ (r Β· s) Β· t)
I rβ rβ =
((rβ β rβ) Β· s) Β· t οΌβ¨ ap (_Β· t) (mult-is-left-hom s rβ rβ) β©
((rβ Β· s) β (rβ Β· s)) Β· t οΌβ¨ mult-is-left-hom t (rβ Β· s) (rβ Β· s) β©
((rβ Β· s) Β· t) β ((rβ Β· s) Β· t) β
IIβ = (π Β· s) Β· t οΌβ¨ ap (_Β· t) (π-left s) β©
π Β· t οΌβ¨ π-left t β©
π β
IIβ = (π Β· s) Β· t οΌβ¨ ap (_Β· t) (π-left s) β©
s Β· t β
Ξ³ : r Β· (s Β· t) οΌ (r Β· s) Β· t
Ξ³ = Ξ±-uniquenessβ»ΒΉ π π (s Β· t) (r β¦ (r Β· s) Β· t) (I , IIβ , IIβ) r
π-right : (r : [π,π]) β r Β· π οΌ π
π-right r = Ξ±-lawβ π r π
π-right : (r : [π,π]) β r Β· π οΌ r
π-right = line-from-π-to-π-is-id
mult-is-right-hom : (r : [π,π]) β is-hom π π (r Β·_)
mult-is-right-hom r s t = Ξ³
where
f g : [π,π] β [π,π]
f r = r Β· (s β t)
g r = (r Β· s) β (r Β· t)
f-is-hom : is-hom π π f
f-is-hom = mult-is-left-hom (s β t)
g-is-hom : is-hom π π g
g-is-hom rβ rβ =
((rβ β rβ) Β· s) β ((rβ β rβ) Β· t) οΌβ¨ I β©
((rβ Β· s) β (rβ Β· s)) β ((rβ Β· t) β (rβ Β· t)) οΌβ¨ II β©
((rβ Β· s) β (rβ Β· t)) β ((rβ Β· s) β (rβ Β· t)) β
where
I = apβ _β_ (mult-is-left-hom s rβ rβ) (mult-is-left-hom t rβ rβ)
II = β-transp (rβ Β· s) (rβ Β· s) (rβ Β· t) (rβ Β· t)
fβ : f π οΌ π
fβ = π-left (s β t)
fβ : f π οΌ s β t
fβ = π-left (s β t)
gβ : g π οΌ π
gβ = (π Β· s) β (π Β· t) οΌβ¨ apβ _β_ (π-left s) (π-left t) β©
π β π οΌβ¨ β-idemp π β©
π β
gβ : g π οΌ s β t
gβ = apβ _β_ (π-left s) (π-left t)
Ξ³ : f r οΌ g r
Ξ³ = at-most-one-hom π π (s β t) f g
(f-is-hom , fβ , fβ)
(g-is-hom , gβ , gβ)
r
mult-is-comm : (r s : [π,π]) β r Β· s οΌ s Β· r
mult-is-comm r s = Ξ±-uniquenessβ»ΒΉ π π s (s Β·_)
(mult-is-right-hom s , π-right s , π-right s)
r
mult-mid-right-distr : (r s t : [π,π]) β r Β· (s β t) οΌ (r Β· s) β (r Β· t)
mult-mid-right-distr = mult-is-right-hom
\end{code}
TODO. r Β· s οΌ π β r οΌ π.
In an interval object [π,π] in a cartesian closed category, we cannot
prove that π β π, because a terminal category is cartesian closed and
any of its (terminal) objects is an interval objects, but terminal
objects have only one global point by definition. But we can prove the
following in any ccc with interval object.
\begin{code}
[π,π]-triviality : π οΌ π β (r s : [π,π]) β r οΌ s
[π,π]-triviality e r s =
r οΌβ¨ (Ξ±-lawβ π r s)β»ΒΉ β©
Ξ±Μ² r s π οΌβ¨ ap (Ξ±Μ² r s) e β©
Ξ±Μ² r s π οΌβ¨ Ξ±-lawβ π r s β©
s β
\end{code}
Homomorphisms automatically preserve convex combinations.
\begin{code}
homs-preserve-ccs : (π : Convex-Body π€) (π : Convex-Body π₯)
β (h : β¨ π β© β β¨ π β©)
β is-hom π π h
β (xβ xβ : β¨ π β©) (r : [π,π])
β h (Ξ± π xβ xβ r) οΌ Ξ± π (h xβ) (h xβ) r
homs-preserve-ccs π@(A , _βα΅_ , _) π@(_ , _βα΅_ , _) h h-is-hom xβ xβ =
f-and-g-agreement
where
f : [π,π] β β¨ π β©
f r = h (Ξ± π xβ xβ r)
f-is-hom : is-hom π π f
f-is-hom = β-is-hom π π π (Ξ± π xβ xβ) h (Ξ±-is-hom π xβ xβ) h-is-hom
π-agreement : f π οΌ h xβ
π-agreement = ap h (Ξ±-lawβ π xβ xβ)
π-agreement : f π οΌ h xβ
π-agreement = ap h (Ξ±-lawβ π xβ xβ)
f-and-g-agreement : f βΌ Ξ± π (h xβ) (h xβ)
f-and-g-agreement = Ξ±-uniqueness π (h xβ) (h xβ) f
(f-is-hom , π-agreement , π-agreement)
module _ (π§@(X , _β_ , X-is-set , β-idemp , β-comm , β-transp , β-cancel , β-iter)
: Convex-Body π₯)
where
Ξ±Μ
: X β X β [π,π] β X
Ξ±Μ
= Ξ± π§
c : [π,π] β X β X β X
c r x y = Ξ±Μ
x y r
cΜ
: [π,π] β [π,π] β [π,π] β [π,π]
cΜ
r x y = Ξ±Μ² x y r
Β½-combination : (xβ xβ : X) β c Β½ xβ xβ οΌ xβ β xβ
Β½-combination xβ xβ =
c Β½ xβ xβ οΌβ¨ refl β©
Ξ±Μ
xβ xβ (π β π) οΌβ¨ Ξ±-is-hom π§ xβ xβ π π β©
Ξ±Μ
xβ xβ π β Ξ±Μ
xβ xβ π οΌβ¨ apβ _β_ (Ξ±-lawβ π§ xβ xβ) (Ξ±-lawβ π§ xβ xβ) β©
xβ β xβ β
Ξ±-self-hom : (xβ xβ : X) (sβ sβ r : [π,π])
β Ξ±Μ
xβ xβ (Ξ±Μ² sβ sβ r) οΌ Ξ±Μ
(Ξ±Μ
xβ xβ sβ) (Ξ±Μ
xβ xβ sβ) r
Ξ±-self-hom xβ xβ = homs-preserve-ccs π π§ (Ξ±Μ
xβ xβ) (Ξ±-is-hom π§ xβ xβ)
c-self-hom : (r sβ sβ : [π,π]) (xβ xβ : X)
β c (cΜ
r sβ sβ) xβ xβ οΌ c r (c sβ xβ xβ) (c sβ xβ xβ)
c-self-hom r sβ sβ xβ xβ = Ξ±-self-hom xβ xβ sβ sβ r
c-self-hom-special : (r s : [π,π]) (xβ xβ : X)
β c (r Β· s) xβ xβ οΌ c r xβ (c s xβ xβ)
c-self-hom-special r s xβ xβ =
c (r Β· s) xβ xβ οΌβ¨ I β©
c r (c π xβ xβ) (c s xβ xβ) οΌβ¨ II β©
c r xβ (c s xβ xβ) β
where
I = c-self-hom r π s xβ xβ
II = ap (- β¦ c r - (c s xβ xβ)) (Ξ±-lawβ π§ xβ xβ)
Ξ±-is-homββ : (xβ xβ yβ yβ : X) (r : [π,π])
β Ξ±Μ
(xβ β xβ) (yβ β yβ) r οΌ Ξ±Μ
xβ yβ r β Ξ±Μ
xβ yβ r
Ξ±-is-homββ xβ xβ yβ yβ =
Ξ±-uniquenessβ»ΒΉ π§ (xβ β xβ) (yβ β yβ) f (f-is-hom , π-agreement , π-agreement)
where
f : [π,π] β X
f r = Ξ±Μ
xβ yβ r β Ξ±Μ
xβ yβ r
f-is-hom : is-hom π π§ f
f-is-hom r s =
(Ξ±Μ
xβ yβ (r β s) β Ξ±Μ
xβ yβ (r β s)) οΌβ¨ I β©
(Ξ±Μ
xβ yβ r β Ξ±Μ
xβ yβ s) β (Ξ±Μ
xβ yβ r β Ξ±Μ
xβ yβ s) οΌβ¨ II β©
(Ξ±Μ
xβ yβ r β Ξ±Μ
xβ yβ r) β (Ξ±Μ
xβ yβ s β Ξ±Μ
xβ yβ s) β
where
I = apβ
_β_
(Ξ±-is-hom π§ xβ yβ r s)
(Ξ±-is-hom π§ xβ yβ r s)
II = β-transp (Ξ±Μ
xβ yβ r) (Ξ±Μ
xβ yβ s) (Ξ±Μ
xβ yβ r) (Ξ±Μ
xβ yβ s)
π-agreement : f π οΌ xβ β xβ
π-agreement =
f π οΌβ¨ refl β©
Ξ±Μ
xβ yβ π β Ξ±Μ
xβ yβ π οΌβ¨ I β©
xβ β xβ β
where
I = apβ _β_ (Ξ±-lawβ π§ xβ yβ) (Ξ±-lawβ π§ xβ yβ)
π-agreement : f π οΌ yβ β yβ
π-agreement =
f π οΌβ¨ refl β©
Ξ±Μ
xβ yβ π β Ξ±Μ
xβ yβ π οΌβ¨ I β©
yβ β yβ β
where
I = apβ _β_ (Ξ±-lawβ π§ xβ yβ) (Ξ±-lawβ π§ xβ yβ)
Ξ±-is-homβ : (xβ xβ y : X) (r : [π,π])
β Ξ±Μ
(xβ β xβ) y r οΌ Ξ±Μ
xβ y r β Ξ±Μ
xβ y r
Ξ±-is-homβ xβ xβ y r =
Ξ±Μ
(xβ β xβ) y r οΌβ¨ ap (- β¦ Ξ±Μ
(xβ β xβ) - r) ((β-idemp y)β»ΒΉ) β©
Ξ±Μ
(xβ β xβ) (y β y) r οΌβ¨ Ξ±-is-homββ xβ xβ y y r β©
Ξ±Μ
xβ y r β Ξ±Μ
xβ y r β
Ξ±-is-homβ : (x yβ yβ : X) (r : [π,π])
β Ξ±Μ
x (yβ β yβ) r οΌ Ξ±Μ
x yβ r β Ξ±Μ
x yβ r
Ξ±-is-homβ x yβ yβ r =
Ξ±Μ
x (yβ β yβ) r οΌβ¨ ap (- β¦ Ξ±Μ
- (yβ β yβ) r) ((β-idemp x)β»ΒΉ) β©
Ξ±Μ
(x β x) (yβ β yβ) r οΌβ¨ Ξ±-is-homββ x x yβ yβ r β©
Ξ±Μ
x yβ r β Ξ±Μ
x yβ r β
Ξ±-lawβ : (r : [π,π]) (x y : X) β c r x y οΌ c (π- r) y x
Ξ±-lawβ r x y = III
where
I : is-hom π π§ (- β¦ c (π- -) y x)
I = β-is-hom π π π§ π- (- β¦ c - y x) (Ξ±-is-hom π π π) (Ξ±-is-hom π§ y x)
IIβ = c (π- π) y x οΌβ¨ refl β©
Ξ±Μ
y x (Ξ±Μ² π π π) οΌβ¨ ap (Ξ±Μ
y x) (Ξ±-lawβ π π π) β©
Ξ±Μ
y x π οΌβ¨ Ξ±-lawβ π§ y x β©
x β
IIβ = c (π- π) y x οΌβ¨ refl β©
Ξ±Μ
y x (Ξ±Μ² π π π) οΌβ¨ ap (Ξ±Μ
y x) (Ξ±-lawβ π π π) β©
Ξ±Μ
y x π οΌβ¨ Ξ±-lawβ π§ y x β©
y β
III : c r x y οΌ c (π- r) y x
III = Ξ±-uniquenessβ»ΒΉ π§ x y (Ζ β¦ c (π- Ζ) y x) (I , IIβ , IIβ) r
\end{code}