Martin Escardo, 9th April 2018
We first give Voevodsky's original proof that univalence implies
non-dependent, naive function extensionality, as presented by Gambino,
Kapulkin and Lumsdaine in
http://www.math.uwo.ca/faculty/kapulkin/notes/ua_implies_fe.pdf.
We then deduce dependent function extensionality applying a second
argument by Voevodsky, developed in another module, which doesn't
depend on univalence.
\begin{code}
{-# OPTIONS --without-K --exact-split --safe #-}
module UF-UA-FunExt where
open import SpartanMLTT
open import UF-Base
open import UF-Equiv
open import UF-Univalence
open import UF-LeftCancellable
open import UF-FunExt
open import UF-FunExt-Properties
open import UF-Equiv-FunExt
naive-univalence-gives-funext : is-univalent ๐ค โ โ {๐ฅ} โ naive-funext ๐ฅ ๐ค
naive-univalence-gives-funext {๐ค} ua {๐ฅ} {X} {Y} {fโ} {fโ} h = ฮณ
where
ฮ = ฮฃ yโ ๊ Y , ฮฃ yโ ๊ Y , yโ โก yโ
ฮด : Y โ ฮ
ฮด y = (y , y , refl)
ฯโ ฯโ : ฮ โ Y
ฯโ (yโ , yโ , p) = yโ
ฯโ (yโ , yโ , p) = yโ
ฮด-is-equiv : is-equiv ฮด
ฮด-is-equiv = (ฯโ , ฮท) , (ฯโ , ฮต)
where
ฮท : (d : ฮ) โ ฮด (ฯโ d) โก d
ฮท (yโ , yโ , refl) = refl
ฮต : (y : Y) โ ฯโ (ฮด y) โก y
ฮต y = refl
ฯฮด : ฯโ โ ฮด โก ฯโ โ ฮด
ฯฮด = refl
ฯ : (ฮ โ Y) โ (Y โ Y)
ฯ ฯ = ฯ โ ฮด
ฯ-is-equiv : is-equiv ฯ
ฯ-is-equiv = pre-comp-is-equiv ua ฮด ฮด-is-equiv
ฯโ-equals-ฯโ : ฯโ โก ฯโ
ฯโ-equals-ฯโ = is-equiv-lc ฯ ฯ-is-equiv ฯฮด
ฮณ : fโ โก fโ
ฮณ = fโ โกโจ refl โฉ
(ฮป x โ fโ x) โกโจ refl โฉ
(ฮป x โ ฯโ (fโ x , fโ x , h x)) โกโจ ap (ฮป ฯ x โ ฯ (fโ x , fโ x , h x)) ฯโ-equals-ฯโ โฉ
(ฮป x โ ฯโ (fโ x , fโ x , h x)) โกโจ refl โฉ
(ฮป x โ fโ x) โกโจ refl โฉ
fโ โ
\end{code}
Added 19th May 2018:
\begin{code}
univalence-gives-funext : is-univalent ๐ค โ funext ๐ค ๐ค
univalence-gives-funext ua = naive-funext-gives-funext (naive-univalence-gives-funext ua)
\end{code}
Added 27 Jun 2018:
\begin{code}
univalence-gives-funext' : โ ๐ค ๐ฅ โ is-univalent ๐ค โ is-univalent (๐ค โ ๐ฅ) โ funext ๐ค ๐ฅ
univalence-gives-funext' ๐ค ๐ฅ ua ua' = naive-funext-gives-funext'
(naive-univalence-gives-funext ua')
(naive-univalence-gives-funext ua)
Univalence-gives-FunExt : Univalence โ FunExt
Univalence-gives-FunExt ua ๐ค ๐ฅ = univalence-gives-funext' ๐ค ๐ฅ (ua ๐ค) (ua (๐ค โ ๐ฅ))
Univalence-gives-Fun-Ext : Univalence โ Fun-Ext
Univalence-gives-Fun-Ext ua {๐ค} {๐ฅ} = Univalence-gives-FunExt ua ๐ค ๐ฅ
funext-from-successive-univalence : โ ๐ค โ is-univalent ๐ค โ is-univalent (๐ค โบ) โ funext ๐ค (๐ค โบ)
funext-from-successive-univalence ๐ค = univalence-gives-funext' ๐ค (๐ค โบ)
open import UF-Subsingletons
open import UF-Subsingletons-FunExt
ฮฉ-ext-from-univalence : is-univalent ๐ค
โ {p q : ฮฉ ๐ค}
โ (p holds โ q holds)
โ (q holds โ p holds)
โ p โก q
ฮฉ-ext-from-univalence {๐ค} ua {p} {q} = ฮฉ-extensionality
(univalence-gives-funext ua)
(univalence-gives-propext ua)
\end{code}
April 2020. How much function extensionality do we get from
propositional univalence?
\begin{code}
naive-prop-valued-funext : (๐ค ๐ฅ : Universe) โ (๐ค โ ๐ฅ)โบ ฬ
naive-prop-valued-funext ๐ค ๐ฅ = (X : ๐ค ฬ ) (Y : ๐ฅ ฬ )
โ is-prop Y
โ is-prop (X โ Y)
propositional-univalence : (๐ค : Universe) โ ๐ค โบ ฬ
propositional-univalence ๐ค = (P : ๐ค ฬ ) โ is-prop P โ (Y : ๐ค ฬ ) โ is-equiv (idtoeq P Y)
prop-eqtoid : propositional-univalence ๐ค
โ (P : ๐ค ฬ )
โ is-prop P
โ (Y : ๐ค ฬ )
โ P โ Y โ P โก Y
prop-eqtoid pu P i Y = inverse (idtoeq P Y) (pu P i Y)
propositional-โ-induction : (๐ค ๐ฅ : Universe) โ (๐ค โ ๐ฅ)โบ ฬ
propositional-โ-induction ๐ค ๐ฅ = (P : ๐ค ฬ )
โ is-prop P
โ (A : (Y : ๐ค ฬ ) โ P โ Y โ ๐ฅ ฬ )
โ A P (โ-refl P) โ (Y : ๐ค ฬ ) (e : P โ Y) โ A Y e
propositional-JEq : propositional-univalence ๐ค
โ (๐ฅ : Universe) โ propositional-โ-induction ๐ค ๐ฅ
propositional-JEq {๐ค} pu ๐ฅ P i A b Y e = ฮณ
where
A' : (Y : ๐ค ฬ ) โ P โก Y โ ๐ฅ ฬ
A' Y q = A Y (idtoeq P Y q)
b' : A' P refl
b' = b
f' : (Y : ๐ค ฬ ) (q : P โก Y) โ A' Y q
f' = Jbased P A' b'
g : A Y (idtoeq P Y (prop-eqtoid pu P i Y e))
g = f' Y (prop-eqtoid pu P i Y e)
ฮณ : A Y (id e)
ฮณ = transport (A Y) (inverses-are-sections (idtoeq P Y) (pu P i Y) e) g
prop-precomp-is-equiv : propositional-univalence ๐ค
โ (X Y Z : ๐ค ฬ )
โ is-prop X
โ (f : X โ Y)
โ is-equiv f
โ is-equiv (ฮป (g : Y โ Z) โ g โ f)
prop-precomp-is-equiv {๐ค} pu X Y Z i f ise =
propositional-JEq pu ๐ค X i (ฮป W e โ is-equiv (ฮป g โ g โ โ e โ))
(id-is-equiv (X โ Z)) Y (f , ise)
prop-precomp-is-equiv' : propositional-univalence ๐ค
โ (X Y Z : ๐ค ฬ )
โ is-prop Y
โ (f : X โ Y)
โ is-equiv f
โ is-equiv (ฮป (g : Y โ Z) โ g โ f)
prop-precomp-is-equiv' {๐ค} pu X Y Z i f ise =
prop-precomp-is-equiv pu X Y Z j f ise
where
j : is-prop X
j = equiv-to-prop (f , ise) i
propositional-univalence-gives-naive-prop-valued-funext : propositional-univalence ๐ค
โ naive-prop-valued-funext ๐ฅ ๐ค
propositional-univalence-gives-naive-prop-valued-funext {๐ค} {๐ฅ} pu X Y Y-is-prop fโ fโ = ฮณ
where
ฮ : ๐ค ฬ
ฮ = ฮฃ yโ ๊ Y , ฮฃ yโ ๊ Y , yโ โก yโ
ฮด : Y โ ฮ
ฮด y = (y , y , refl)
ฯโ ฯโ : ฮ โ Y
ฯโ (yโ , yโ , p) = yโ
ฯโ (yโ , yโ , p) = yโ
ฮด-is-equiv : is-equiv ฮด
ฮด-is-equiv = (ฯโ , ฮท) , (ฯโ , ฮต)
where
ฮท : (d : ฮ) โ ฮด (ฯโ d) โก d
ฮท (yโ , yโ , refl) = refl
ฮต : (y : Y) โ ฯโ (ฮด y) โก y
ฮต y = refl
ฯฮด : ฯโ โ ฮด โก ฯโ โ ฮด
ฯฮด = refl
ฯ : (ฮ โ Y) โ (Y โ Y)
ฯ ฯ = ฯ โ ฮด
ฯ-is-equiv : is-equiv ฯ
ฯ-is-equiv = prop-precomp-is-equiv pu Y ฮ Y Y-is-prop ฮด ฮด-is-equiv
ฯโ-equals-ฯโ : ฯโ โก ฯโ
ฯโ-equals-ฯโ = equivs-are-lc ฯ ฯ-is-equiv ฯฮด
ฮณ : fโ โก fโ
ฮณ = fโ โกโจ refl โฉ
(ฮป x โ fโ x) โกโจ refl โฉ
(ฮป x โ ฯโ (fโ x , fโ x , h x)) โกโจ ap (ฮป ฯ x โ ฯ (fโ x , fโ x , h x)) ฯโ-equals-ฯโ โฉ
(ฮป x โ ฯโ (fโ x , fโ x , h x)) โกโจ refl โฉ
(ฮป x โ fโ x) โกโจ refl โฉ
fโ โ
where
h : (x : X) โ fโ x โก fโ x
h x = Y-is-prop (fโ x) (fโ x)
\end{code}