Skip to content

Commit b375ba6

Browse files
author
Patrick Nicodemus
committed
initial commit
1 parent ce212b6 commit b375ba6

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

theories/Basics/Overture.v

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ Definition paths_rect := paths_ind.
282282
Register paths as core.identity.type.
283283
Register idpath as core.identity.refl.
284284
Register paths_rect as core.identity.ind.
285+
Register paths as core.eq.type.
286+
Register idpath as core.eq.refl.
287+
Register paths_ind as core.eq.ind.
288+
Register paths_rect as core.eq.rect.
285289

286290
Notation "x = y :> A" := (@paths A x y) : type_scope.
287291
Notation "x = y" := (x = y :>_) : type_scope.
@@ -309,6 +313,11 @@ Proof.
309313
exact u.
310314
Defined.
311315

316+
Definition paths_rect_r := @paths_ind_r.
317+
318+
Register paths_ind_r as core.eq.ind_r.
319+
Register paths_rect_r as core.eq.rect_r.
320+
312321
Definition related_reflexive_path {A : Type} (R : Relation A) `{Reflexive A R}
313322
{a b : A} (p : a = b)
314323
: R a b.
@@ -328,6 +337,7 @@ Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
328337
:= match p with idpath => idpath end.
329338

330339
Register inverse as core.identity.sym.
340+
Register inverse as core.eq.sym.
331341

332342
(** Declaring this as [simpl nomatch] prevents the tactic [simpl] from expanding it out into [match] statements. We only want [inverse] to simplify when applied to an identity path. *)
333343
Arguments inverse {A x y} p : simpl nomatch.
@@ -368,6 +378,7 @@ Instance transitive_paths {A} : Transitive (@paths A) | 0 := @concat A.
368378
Arguments transitive_paths / .
369379

370380
Register concat as core.identity.trans.
381+
Register concat as core.eq.trans.
371382

372383
(** Note that you can use the Coq tactics [reflexivity], [transitivity], [etransitivity], and [symmetry] when working with paths; we've redefined them above to use typeclasses and to unfold the instances so you get proof terms with [concat] and [inverse]. *)
373384

@@ -395,6 +406,16 @@ Arguments transport {A}%_type_scope P%_function_scope {x y} p%_path_scope u : si
395406
(** Transport is very common so it is worth introducing a parsing notation for it. However, we do not use the notation for output because it hides the fibration, and so makes it very hard to read involved transport expression. *)
396407
Notation "p # u" := (transport _ p u) (only parsing) : path_scope.
397408

409+
(** Functions act on paths: if [f : A -> B] and [p : x = y] is a path in [A], then [ap f p : f x = f y]. We typically pronounce [ap] as a single syllable, short for "application"; but it may also be considered as an acronym, "action on paths". *)
410+
411+
Definition ap {A B : Type} (f : A -> B) {x y : A} (p : x = y) : f x = f y
412+
:= match p with idpath => idpath end.
413+
414+
Global Arguments ap {A B}%_type_scope f%_function_scope {x y} p%_path_scope : simpl nomatch.
415+
416+
Register ap as core.identity.congr.
417+
Register ap as core.eq.congr.
418+
398419
(** The first time [rewrite] is used in each direction, it creates transport lemmas called [internal_paths_rew] and [internal_paths_rew_r]. See ../Tactics.v for how these compare to [transport]. We use [rewrite] here to trigger the creation of these lemmas. This ensures that they are defined outside of sections, so they are not unnecessarily polymorphic. The lemmas below are not used in the library. *)
399420
(** TODO: Since Coq 8.20 has PR#18299, once that is our minimum version we can instead register wrappers for [transport] to be used for rewriting. See the comment by Dan Christensen in that PR for how to do this. Then the tactics [internal_paths_rew_to_transport] and [rewrite_to_transport] can be removed from ../Tactics.v. *)
400421
Local Lemma define_internal_paths_rew A x y P (u : P x) (H : x = y :> A) : P y.
@@ -409,14 +430,7 @@ Arguments internal_paths_rew_r {A%_type_scope} {a y} P%_function_scope HC X.
409430

410431
(** Having defined transport, we can use it to talk about what a homotopy theorist might see as "paths in a fibration over paths in the base"; and what a type theorist might see as "heterogeneous equality in a dependent type". We will first see this appearing in the type of [apD]. *)
411432

412-
(** Functions act on paths: if [f : A -> B] and [p : x = y] is a path in [A], then [ap f p : f x = f y]. We typically pronounce [ap] as a single syllable, short for "application"; but it may also be considered as an acronym, "action on paths". *)
413433

414-
Definition ap {A B : Type} (f : A -> B) {x y : A} (p : x = y) : f x = f y
415-
:= match p with idpath => idpath end.
416-
417-
Global Arguments ap {A B}%_type_scope f%_function_scope {x y} p%_path_scope : simpl nomatch.
418-
419-
Register ap as core.identity.congr.
420434

421435
(** We introduce the convention that [apKN] denotes the application of a K-path between functions to an N-path between elements, where a 0-path is simply a function or an element. Thus, [ap] is a shorthand for [ap01]. *)
422436
Notation ap01 := ap (only parsing).

theories/Basics/PathGroupoids.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,8 @@ Proof.
808808
exact q.
809809
Defined.
810810

811+
Register ap011 as core.eq.congr2.
812+
811813
Definition ap011_V {A B C} (f : A -> B -> C) {x x' y y'} (p : x = x') (q : y = y')
812814
: ap011 f p^ q^ = (ap011 f p q)^.
813815
Proof.

0 commit comments

Comments
 (0)