2015-02-26 18:19:54 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2014 Jakob von Raumer. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Module: init.axioms.ua
|
|
|
|
Author: Jakob von Raumer
|
|
|
|
|
|
|
|
Ported from Coq HoTT
|
|
|
|
-/
|
|
|
|
|
2014-12-12 18:17:50 +00:00
|
|
|
prelude
|
|
|
|
import ..path ..equiv
|
2015-02-21 00:30:32 +00:00
|
|
|
open eq equiv is_equiv
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
|
|
--Ensure that the types compared are in the same universe
|
|
|
|
section
|
|
|
|
universe variable l
|
|
|
|
variables {A B : Type.{l}}
|
|
|
|
|
2015-02-21 00:30:32 +00:00
|
|
|
definition is_equiv_tr_of_eq (H : A = B) : is_equiv (transport (λX:Type, X) H) :=
|
|
|
|
(@is_equiv_tr Type (λX, X) A B H)
|
2014-12-12 04:14:53 +00:00
|
|
|
|
2015-02-21 00:30:32 +00:00
|
|
|
definition equiv_of_eq (H : A = B) : A ≃ B :=
|
|
|
|
equiv.mk _ (is_equiv_tr_of_eq H)
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2015-02-21 00:30:32 +00:00
|
|
|
axiom univalence (A B : Type) : is_equiv (@equiv_of_eq A B)
|
2014-12-12 04:14:53 +00:00
|
|
|
|
2015-02-21 00:30:32 +00:00
|
|
|
attribute univalence [instance]
|
2014-12-12 04:14:53 +00:00
|
|
|
|
2014-12-17 16:58:47 +00:00
|
|
|
-- This is the version of univalence axiom we will probably use most often
|
2015-02-28 06:16:20 +00:00
|
|
|
definition ua {A B : Type} : A ≃ B → A = B :=
|
2015-02-21 00:30:32 +00:00
|
|
|
(@equiv_of_eq A B)⁻¹
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
|
|
-- One consequence of UA is that we can transport along equivalencies of types
|
2015-02-21 00:30:32 +00:00
|
|
|
namespace equiv
|
2014-12-12 04:14:53 +00:00
|
|
|
universe variable l
|
|
|
|
|
2015-02-21 00:30:32 +00:00
|
|
|
protected definition transport_of_equiv (P : Type → Type) {A B : Type.{l}} (H : A ≃ B)
|
2014-12-17 16:58:47 +00:00
|
|
|
: P A → P B :=
|
|
|
|
eq.transport P (ua H)
|
2014-12-12 04:14:53 +00:00
|
|
|
|
|
|
|
-- We can use this for calculation evironments
|
2015-02-21 00:30:32 +00:00
|
|
|
calc_subst transport_of_equiv
|
2014-12-12 04:14:53 +00:00
|
|
|
|
2015-03-13 14:32:48 +00:00
|
|
|
definition rec_on_of_equiv_of_eq {A B : Type} {P : (A ≃ B) → Type}
|
|
|
|
(p : A ≃ B) (H : Π(q : A = B), P (equiv_of_eq q)) : P p :=
|
|
|
|
retr equiv_of_eq p ▹ H (ua p)
|
|
|
|
|
2015-02-21 00:30:32 +00:00
|
|
|
end equiv
|