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
|
2014-11-26 04:30:52 +00:00
|
|
|
open path equiv
|
2014-11-06 18:38:59 +00:00
|
|
|
|
2014-11-06 23:55:44 +00:00
|
|
|
--Ensure that the types compared are in the same universe
|
2014-11-20 02:31:19 +00:00
|
|
|
section
|
|
|
|
universe variable l
|
2014-11-20 17:05:45 +00:00
|
|
|
variables {A B : Type.{l}}
|
2014-11-06 23:35:31 +00:00
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
definition isequiv_path (H : A ≈ B) :=
|
2014-11-26 04:30:52 +00:00
|
|
|
(@is_equiv.transport Type (λX, X) A B H)
|
2014-11-06 23:35:31 +00:00
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
definition equiv_path (H : A ≈ B) : A ≃ B :=
|
2014-11-26 04:30:52 +00:00
|
|
|
equiv.mk _ (isequiv_path H)
|
2014-11-06 23:35:31 +00:00
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
end
|
2014-11-06 23:35:31 +00:00
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
inductive ua_type [class] : Type :=
|
2014-11-26 04:30:52 +00:00
|
|
|
mk : (Π (A B : Type), is_equiv (@equiv_path A B)) → ua_type
|
2014-11-06 23:35:31 +00:00
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
namespace ua_type
|
|
|
|
|
|
|
|
context
|
|
|
|
universe k
|
|
|
|
parameters [F : ua_type.{k}] {A B: Type.{k}}
|
|
|
|
|
|
|
|
-- Make the Equivalence given by the axiom an instance
|
2014-11-26 04:30:52 +00:00
|
|
|
protected definition inst [instance] : is_equiv (@equiv_path.{k} A B) :=
|
2014-11-20 06:08:23 +00:00
|
|
|
rec_on F (λ H, H A B)
|
2014-11-20 02:31:19 +00:00
|
|
|
|
|
|
|
-- This is the version of univalence axiom we will probably use most often
|
|
|
|
definition ua : A ≃ B → A ≈ B :=
|
2014-11-26 04:30:52 +00:00
|
|
|
@is_equiv.inv _ _ (@equiv_path A B) inst
|
2014-11-20 02:31:19 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end ua_type
|
2014-11-06 23:55:44 +00:00
|
|
|
|
|
|
|
-- One consequence of UA is that we can transport along equivalencies of types
|
|
|
|
namespace Equiv
|
2014-11-20 02:31:19 +00:00
|
|
|
universe variable l
|
2014-11-06 23:55:44 +00:00
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
protected definition subst [UA : ua_type] (P : Type → Type) {A B : Type.{l}} (H : A ≃ B)
|
2014-11-06 23:55:44 +00:00
|
|
|
: P A → P B :=
|
2014-11-20 02:31:19 +00:00
|
|
|
path.transport P (ua_type.ua H)
|
2014-11-06 23:55:44 +00:00
|
|
|
|
|
|
|
-- We can use this for calculation evironments
|
|
|
|
calc_subst subst
|
|
|
|
|
|
|
|
end Equiv
|