2014-11-07 00:41:08 +00:00
|
|
|
-- Copyright (c) 2014 Jakob von Raumer. All rights reserved.
|
2014-11-06 18:38:59 +00:00
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
2014-11-07 00:41:08 +00:00
|
|
|
-- Author: Jakob von Raumer
|
2014-11-06 18:38:59 +00:00
|
|
|
-- Ported from Coq HoTT
|
|
|
|
import hott.path hott.equiv
|
|
|
|
open path Equiv
|
|
|
|
|
2014-11-06 23:55:44 +00:00
|
|
|
--Ensure that the types compared are in the same universe
|
2014-11-06 23:35:31 +00:00
|
|
|
universe l
|
|
|
|
variables (A B : Type.{l})
|
|
|
|
|
|
|
|
private 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)
|
|
|
|
|
|
|
|
axiom ua_equiv (A B : Type) : IsEquiv (equiv_path A B)
|
|
|
|
|
2014-11-06 23:55:44 +00:00
|
|
|
-- Make the Equivalence given by the axiom an instance
|
2014-11-06 23:35:31 +00:00
|
|
|
definition ua_inst [instance] {A B : Type} := (@ua_equiv A B)
|
|
|
|
|
2014-11-06 23:55:44 +00:00
|
|
|
-- This is the version of univalence axiom we will probably use most often
|
|
|
|
definition ua {A B : Type} : A ≃ B → A ≈ B :=
|
|
|
|
IsEquiv.inv (@equiv_path A B)
|
|
|
|
|
|
|
|
-- One consequence of UA is that we can transport along equivalencies of types
|
|
|
|
namespace Equiv
|
|
|
|
|
|
|
|
protected definition subst (P : Type → Type) {A B : Type.{l}} (H : A ≃ B)
|
|
|
|
: P A → P B :=
|
|
|
|
path.transport P (ua H)
|
|
|
|
|
|
|
|
-- We can use this for calculation evironments
|
|
|
|
calc_subst subst
|
|
|
|
|
|
|
|
end Equiv
|