UF.UA-FunExt
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.{-# OPTIONS --safe --without-K #-} module UF.UA-FunExt where open import MLTT.Spartan open import UF.Equiv open import UF.FunExt open import UF.FunExt-Properties open import UF.LeftCancellable open import UF.SubtypeClassifier open import UF.Univalence 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)) οΌβ¨ I β© (Ξ» x β Οβ (fβ x , fβ x , h x)) οΌβ¨reflβ© (Ξ» x β fβ x) οΌβ¨reflβ© fβ β where I = ap (Ξ» Ο x β Ο (fβ x , fβ x , h x)) Οβ-equals-ΟβAdded 19th May 2018:univalence-gives-funext : is-univalent π€ β funext π€ π€ univalence-gives-funext ua = naive-funext-gives-funext (naive-univalence-gives-funext ua)Added 27 Jun 2018: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 Ξ©-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-propext ua) (univalence-gives-funext ua)April 2020. How much function extensionality do we get from propositional univalence?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)) οΌβ¨ I β© (Ξ» 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) I = ap (Ξ» Ο x β Ο (fβ x , fβ x , h x)) Οβ-equals-Οβ