From 1f6b6ff8e6ef39e649558d4044015b212a018813 Mon Sep 17 00:00:00 2001 From: Jakob von Raumer Date: Thu, 20 Nov 2014 12:05:45 -0500 Subject: [PATCH] chore(library/hott) adjust funext_from_ua.lea to typeclass axioms --- library/hott/axioms/ua.lean | 8 ++++---- library/hott/funext_from_ua.lean | 24 +++++++----------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/library/hott/axioms/ua.lean b/library/hott/axioms/ua.lean index fa3179006..302648177 100644 --- a/library/hott/axioms/ua.lean +++ b/library/hott/axioms/ua.lean @@ -8,18 +8,18 @@ open path Equiv --Ensure that the types compared are in the same universe section universe variable l - variables (A B : Type.{l}) + variables {A B : Type.{l}} definition isequiv_path (H : A ≈ B) := (@IsEquiv.transport Type (λX, X) A B H) definition equiv_path (H : A ≈ B) : A ≃ B := - Equiv.mk _ (isequiv_path A B H) + Equiv.mk _ (isequiv_path H) end inductive ua_type [class] : Type := - mk : (Π (A B : Type), IsEquiv (equiv_path A B)) → ua_type + mk : (Π (A B : Type), IsEquiv (@equiv_path A B)) → ua_type namespace ua_type @@ -28,7 +28,7 @@ namespace ua_type parameters [F : ua_type.{k}] {A B: Type.{k}} -- Make the Equivalence given by the axiom an instance - protected definition inst [instance] : IsEquiv (equiv_path.{k} A B) := + protected definition inst [instance] : IsEquiv (@equiv_path.{k} A B) := rec_on F (λ H, H A B) -- This is the version of univalence axiom we will probably use most often diff --git a/library/hott/funext_from_ua.lean b/library/hott/funext_from_ua.lean index 490c200ed..4d82491c6 100644 --- a/library/hott/funext_from_ua.lean +++ b/library/hott/funext_from_ua.lean @@ -2,35 +2,25 @@ -- Released under Apache 2.0 license as described in the file LICENSE. -- Author: Jakob von Raumer -- Ported from Coq HoTT -import hott.equiv hott.funext_varieties +import hott.equiv hott.funext_varieties hott.axioms.ua import data.prod data.sigma data.unit -open path function prod sigma truncation Equiv IsEquiv unit - -definition isequiv_path {A B : Type} (H : A ≈ B) := - (@IsEquiv.transport Type (λX, X) A B H) - - -definition equiv_path {A B : Type} (H : A ≈ B) : A ≃ B := - Equiv.mk _ (isequiv_path H) - --- First, define an axiom free variant of Univalence -definition ua_type := Π (A B : Type), IsEquiv (@equiv_path A B) +open path function prod sigma truncation Equiv IsEquiv unit ua_type context universe variables l - parameter {ua : ua_type.{l+1}} + parameter [UA : ua_type.{l+1}] protected theorem ua_isequiv_postcompose {A B : Type.{l+1}} {C : Type} {w : A → B} {H0 : IsEquiv w} : IsEquiv (@compose C A B w) := let w' := Equiv.mk w H0 in - let eqinv : A ≈ B := (equiv_path⁻¹ w') in + let eqinv : A ≈ B := ((@IsEquiv.inv _ _ _ (@ua_type.inst UA A B)) w') in let eq' := equiv_path eqinv in IsEquiv.adjointify (@compose C A B w) (@compose C B A (IsEquiv.inv w)) (λ (x : C → B), have eqretr : eq' ≈ w', - from (@retr _ _ (@equiv_path A B) (ua A B) w'), + from (@retr _ _ (@equiv_path A B) (@ua_type.inst UA A B) w'), have invs_eq : (equiv_fun eq')⁻¹ ≈ (equiv_fun w')⁻¹, from inv_eq eq' w' eqretr, have eqfin : (equiv_fun eq') ∘ ((equiv_fun eq')⁻¹ ∘ x) ≈ x, @@ -48,7 +38,7 @@ context ) (λ (x : C → A), have eqretr : eq' ≈ w', - from (@retr _ _ (@equiv_path A B) (ua A B) w'), + from (@retr _ _ (@equiv_path A B) ua_type.inst w'), have invs_eq : (equiv_fun eq')⁻¹ ≈ (equiv_fun w')⁻¹, from inv_eq eq' w' eqretr, have eqfin : (equiv_fun eq')⁻¹ ∘ ((equiv_fun eq') ∘ x) ≈ x, @@ -124,7 +114,7 @@ context from (λ x, @equiv_contr_unit(P x) (allcontr x)), have psim : Π (x : A), P x ≈ U x, from (λ x, @IsEquiv.inv _ _ - (@equiv_path (P x) (U x)) (ua2 (P x) (U x)) (pequiv x)), + equiv_path ua_type.inst (pequiv x)), have p : P ≈ U, from @ua_implies_funext_nondep.{l+2 l+1} ua3 A Type.{l+2} P U psim, have tU' : is_contr (A → unit),