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
|
|
|
|
|
|
|
|
|
|
-- TODO: take a look at the Coq tricks
|
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
|
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
|
set_option pp.universes true
|
|
|
|
|
|
2014-08-12 00:35:25 +00:00
|
|
|
|
-- Funext
|
|
|
|
|
-- ------
|
|
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
|
-- Define function extensionality as a type class
|
|
|
|
|
inductive funext.{l} [class] : Type.{l+3} :=
|
|
|
|
|
mk : (Π {A : Type.{l+1}} {P : A → Type.{l+2}} (f g : Π x, P x), IsEquiv (@apD10 A P f g))
|
|
|
|
|
→ funext.{l}
|
|
|
|
|
|
|
|
|
|
namespace funext
|
|
|
|
|
|
|
|
|
|
context
|
|
|
|
|
universe l
|
|
|
|
|
parameters [F : funext.{l}] {A : Type.{l+1}} {P : A → Type.{l+2}} (f g : Π x, P x)
|
|
|
|
|
|
2014-11-20 04:54:34 +00:00
|
|
|
|
protected definition apply [instance] : IsEquiv (@apD10 A P f g) :=
|
2014-11-20 02:31:19 +00:00
|
|
|
|
rec_on F (λ H, sorry)
|
|
|
|
|
|
|
|
|
|
definition path_forall : f ∼ g → f ≈ g :=
|
2014-11-20 04:54:34 +00:00
|
|
|
|
@IsEquiv.inv _ _ (@apD10 A P f g) apply
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
|
end
|
2014-11-04 14:49:07 +00:00
|
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
|
definition path_forall2 [F : funext] {A B : Type} {P : A → B → Type}
|
|
|
|
|
(f g : Πx y, P x y) : (Πx y, f x y ≈ g x y) → f ≈ g :=
|
|
|
|
|
λ E, path_forall f g (λx, path_forall (f x) (g x) (E x))
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
2014-11-20 02:31:19 +00:00
|
|
|
|
end funext
|