2014-08-12 00:35:25 +00:00
|
|
|
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
2014-10-23 05:24:31 +00:00
|
|
|
|
-- Author: Jeremy Avigad, Jakob von Raumer
|
2014-08-12 00:35:25 +00:00
|
|
|
|
-- Ported from Coq HoTT
|
|
|
|
|
|
2014-11-06 18:34:57 +00:00
|
|
|
|
import hott.path hott.equiv
|
2014-09-09 20:20:04 +00:00
|
|
|
|
open path
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
|
|
|
|
-- Funext
|
|
|
|
|
-- ------
|
|
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
|
-- Define function extensionality as a type class
|
2014-11-22 00:07:34 +00:00
|
|
|
|
inductive funext [class] : Type :=
|
2014-11-26 04:30:52 +00:00
|
|
|
|
mk : (Π (A : Type) (P : A → Type ) (f g : Π x, P x), is_equiv (@apD10 A P f g))
|
2014-11-22 00:07:34 +00:00
|
|
|
|
→ funext
|
2014-11-20 02:31:19 +00:00
|
|
|
|
|
|
|
|
|
namespace funext
|
|
|
|
|
|
2014-12-05 04:35:38 +00:00
|
|
|
|
universe variables l k
|
|
|
|
|
variables [F : funext.{l k}] {A : Type.{l}} {P : A → Type.{k}}
|
2014-11-20 02:31:19 +00:00
|
|
|
|
|
2014-12-05 04:35:38 +00:00
|
|
|
|
include F
|
|
|
|
|
protected definition ap [instance] (f g : Π x, P x) : is_equiv (@apD10 A P f g) :=
|
|
|
|
|
rec_on F (λ(H : Π A P f g, _), !H)
|
2014-11-20 02:31:19 +00:00
|
|
|
|
|
2014-12-05 04:35:38 +00:00
|
|
|
|
definition path_pi {f g : Π x, P x} : f ∼ g → f ≈ g :=
|
|
|
|
|
is_equiv.inv (@apD10 A P f g)
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
2014-12-05 04:35:38 +00:00
|
|
|
|
omit F
|
|
|
|
|
definition path_pi2 [F : funext] {A B : Type} {P : A → B → Type}
|
2014-11-20 02:31:19 +00:00
|
|
|
|
(f g : Πx y, P x y) : (Πx y, f x y ≈ g x y) → f ≈ g :=
|
2014-12-05 04:35:38 +00:00
|
|
|
|
λ E, path_pi (λx, path_pi (E x))
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
|
end funext
|