chore(library/hott) make funext more general
This commit is contained in:
parent
12429c93c8
commit
228205634d
2 changed files with 8 additions and 10 deletions
|
@ -7,21 +7,19 @@
|
||||||
import hott.path hott.equiv
|
import hott.path hott.equiv
|
||||||
open path
|
open path
|
||||||
|
|
||||||
set_option pp.universes true
|
|
||||||
|
|
||||||
-- Funext
|
-- Funext
|
||||||
-- ------
|
-- ------
|
||||||
|
|
||||||
-- Define function extensionality as a type class
|
-- Define function extensionality as a type class
|
||||||
inductive funext.{l} [class] : Type.{l+3} :=
|
inductive funext [class] : Type :=
|
||||||
mk : (Π (A : Type.{l+1}) (P : A → Type.{l+2}) (f g : Π x, P x), IsEquiv (@apD10 A P f g))
|
mk : (Π (A : Type) (P : A → Type ) (f g : Π x, P x), IsEquiv (@apD10 A P f g))
|
||||||
→ funext.{l}
|
→ funext
|
||||||
|
|
||||||
namespace funext
|
namespace funext
|
||||||
|
|
||||||
context
|
context
|
||||||
universe l
|
universe variables l k
|
||||||
parameters [F : funext.{l}] {A : Type.{l+1}} {P : A → Type.{l+2}} (f g : Π x, P x)
|
parameters [F : funext.{l k}] {A : Type.{l}} {P : A → Type.{k}} (f g : Π x, P x)
|
||||||
|
|
||||||
protected definition ap [instance] : IsEquiv (@apD10 A P f g) :=
|
protected definition ap [instance] : IsEquiv (@apD10 A P f g) :=
|
||||||
rec_on F (λ (H : Π A P f g, _), !H)
|
rec_on F (λ (H : Π A P f g, _), !H)
|
||||||
|
|
|
@ -16,8 +16,8 @@ open path truncation sigma function
|
||||||
|
|
||||||
-- Naive funext is the simple assertion that pointwise equal functions are equal.
|
-- Naive funext is the simple assertion that pointwise equal functions are equal.
|
||||||
-- TODO think about universe levels
|
-- TODO think about universe levels
|
||||||
definition naive_funext.{l} :=
|
definition naive_funext.{l k} :=
|
||||||
Π {A : Type.{l+1}} {P : A → Type.{l+2}} (f g : Πx, P x), (f ∼ g) → f ≈ g
|
Π {A : Type.{l}} {P : A → Type.{k}} (f g : Πx, P x), (f ∼ g) → f ≈ g
|
||||||
|
|
||||||
-- Weak funext says that a product of contractible types is contractible.
|
-- Weak funext says that a product of contractible types is contractible.
|
||||||
definition weak_funext.{l} :=
|
definition weak_funext.{l} :=
|
||||||
|
@ -92,7 +92,7 @@ end
|
||||||
-- Now the proof is fairly easy; we can just use the same induction principle on both sides.
|
-- Now the proof is fairly easy; we can just use the same induction principle on both sides.
|
||||||
universe variable l
|
universe variable l
|
||||||
|
|
||||||
theorem weak_funext_implies_funext (wf : weak_funext.{l}) : funext.{l} :=
|
theorem weak_funext_implies_funext (wf : weak_funext.{l}) : funext.{l+1 l+2} :=
|
||||||
funext.mk (λ A B f g,
|
funext.mk (λ A B f g,
|
||||||
let eq_to_f := (λ g' x, f ≈ g') in
|
let eq_to_f := (λ g' x, f ≈ g') in
|
||||||
let sim2path := htpy_ind _ f eq_to_f idp in
|
let sim2path := htpy_ind _ f eq_to_f idp in
|
||||||
|
|
Loading…
Add table
Reference in a new issue