You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notation "x = y :> A" := (@paths A x y) : type_scope.
287
291
Notation "x = y" := (x = y :>_) : type_scope.
@@ -309,6 +313,11 @@ Proof.
309
313
exact u.
310
314
Defined.
311
315
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
+
312
321
Definition related_reflexive_path {A : Type} (R : Relation A) `{Reflexive A R}
313
322
{a b : A} (p : a = b)
314
323
: R a b.
@@ -328,6 +337,7 @@ Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
328
337
:= match p with idpath => idpath end.
329
338
330
339
Register inverse as core.identity.sym.
340
+
Register inverse as core.eq.sym.
331
341
332
342
(** 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. *)
333
343
Arguments inverse {A x y} p : simpl nomatch.
@@ -368,6 +378,7 @@ Instance transitive_paths {A} : Transitive (@paths A) | 0 := @concat A.
368
378
Arguments transitive_paths / .
369
379
370
380
Register concat as core.identity.trans.
381
+
Register concat as core.eq.trans.
371
382
372
383
(** 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]. *)
373
384
@@ -395,6 +406,16 @@ Arguments transport {A}%_type_scope P%_function_scope {x y} p%_path_scope u : si
395
406
(** 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. *)
(** 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
(** 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. *)
399
420
(** 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. *)
400
421
LocalLemma define_internal_paths_rew A x y P (u : P x) (H : x = y :> A) : P y.
(** 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]. *)
411
432
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". *)
413
433
414
-
Definition ap {A B : Type} (f : A -> B) {x y : A} (p : x = y) : f x = f y
(** 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]. *)
0 commit comments