Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix binding of type_scope to Sortclass #2038

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/HoTTBookExercises.v
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ End Book_4_5.
Section Book_4_6_i.

Definition is_qinv {A B : Type} (f : A -> B)
:= { g : B -> A & ((f o g == idmap) * (g o f == idmap))%type }.
:= { g : B -> A & (f o g == idmap) * (g o f == idmap) }.
Definition qinv (A B : Type)
:= { f : A -> B & is_qinv f }.
Definition qinv_id A : qinv A A
Expand Down
6 changes: 4 additions & 2 deletions theories/Basics/Notations.v
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
(** [type_scope] must be declared and bound early on so that later reserved notations register correctly. *)
Declare Scope type_scope.
Bind Scope type_scope with Sortclass.

(** To reserve this notation, we must first bootstrap, and preserve the underlying [forall] notation *)
Notation "'forall' x .. y , P" := (forall x , .. (forall y, P) ..) (at level 200, x binder, y binder, right associativity).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, this notation was declared before the bind which meant when -> was defined in Overture.v it registered the parser before the binding. By switching the order, we can get the correct binding behaviour.

Reserved Notation "'exists' x .. y , p"
Expand Down Expand Up @@ -112,7 +116,7 @@
Reserved Notation "x .2" (at level 1, format "x '.2'").

(** Paths *)
Reserved Notation "p ^" (at level 1, format "p '^'").

Check warning on line 119 in theories/Basics/Notations.v

View workflow job for this annotation

GitHub Actions / build (dev, --warnings)

Notations "_ ^ _" defined at level 30 with arguments constr

Check warning on line 119 in theories/Basics/Notations.v

View workflow job for this annotation

GitHub Actions / opam-build (dev, ubuntu-latest)

Notations "_ ^ _" defined at level 30 with arguments constr
Reserved Notation "p @ q" (at level 20).
Reserved Notation "p # x" (right associativity, at level 65).
Reserved Notation "p # x" (right associativity, at level 65).
Expand Down Expand Up @@ -225,8 +229,8 @@
Reserved Notation "!! P" (at level 35, right associativity).
Reserved Notation "u ~~ v" (at level 30).
Reserved Notation "! x" (at level 3, format "'!' x").
Reserved Notation "x \\ F" (at level 40, left associativity).

Check warning on line 232 in theories/Basics/Notations.v

View workflow job for this annotation

GitHub Actions / build (dev, --warnings)

Notations "_ \ CAT" defined at level 1 with arguments constr

Check warning on line 232 in theories/Basics/Notations.v

View workflow job for this annotation

GitHub Actions / opam-build (dev, ubuntu-latest)

Notations "_ \\ CAT" defined at level 1 with arguments constr
Reserved Notation "x // F" (at level 40, left associativity).

Check warning on line 233 in theories/Basics/Notations.v

View workflow job for this annotation

GitHub Actions / build (dev, --warnings)

Notations "_ // CAT" defined at level 1 with arguments constr

Check warning on line 233 in theories/Basics/Notations.v

View workflow job for this annotation

GitHub Actions / opam-build (dev, ubuntu-latest)

Notations "_ // CAT" defined at level 1 with arguments constr
Reserved Notation "{ { xL | xR // xcut } }" (at level 0, xR at level 39, format "{ { xL | xR // xcut } }").
Reserved Notation "x \ F" (at level 40, left associativity).
Reserved Notation "x <> y" (at level 70, no associativity).
Expand Down Expand Up @@ -265,7 +269,6 @@
(** We define various scopes and open them in the order we expect to use them. *)
Declare Scope core_scope.
Declare Scope function_scope.
Declare Scope type_scope.
Declare Scope equiv_scope.
Declare Scope path_scope.
Declare Scope fibration_scope.
Expand All @@ -290,4 +293,3 @@
Global Open Scope core_scope.

Bind Scope function_scope with Funclass.
Bind Scope type_scope with Sortclass.
2 changes: 1 addition & 1 deletion theories/Spaces/BAut/Cantor.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Section Assumptions.
Proof.
intros Z.
(** Here is the important part of this definition. *)
exists (Z + Cantor)%type.
exists (Z + Cantor).
(** The rest is just a proof that [Z+Cantor] is again equivalent to [Cantor], using [cantor_fold] and the assumption that [Z] is equivalent to [Cantor]. *)
pose (e := Z.2); simpl in e; clearbody e.
strip_truncations.
Expand Down
4 changes: 2 additions & 2 deletions theories/Spaces/Nat/Arithmetic.v
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Proof.
Defined.

Proposition diseq_implies_lt (n m : nat)
: n <> m -> sum (n < m) (n > m).
: n <> m -> (n < m) + (n > m).
Proof.
intros diseq.
destruct (dec (n < m)) as [| a]; [ now left |].
Expand Down Expand Up @@ -271,7 +271,7 @@ Proof.
Defined.

Definition nleqSm_dichot {n m : nat}
: (n <= m.+1) -> sum (n <= m) (n = m.+1).
: (n <= m.+1) -> (n <= m) + (n = m.+1).
Proof.
revert m; simple_induction n n IHn.
- intro. left. exact (leq_0_n m).
Expand Down
2 changes: 1 addition & 1 deletion theories/Spaces/No/Addition.v
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Section Addition.
refine (path_No_easy _ _ _ _ eL eR _ _ _ _);
intros;
repeat match goal with
| [ H : (?A + ?B)%type |- _ ] => destruct H
| [ H : (?A + ?B) |- _ ] => destruct H
end;
repeat match goal with
| [ |- context[@equiv_fun ?A ?B ?e ?v] ]
Expand Down
4 changes: 2 additions & 2 deletions theories/Tactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Lemma path_forall_recr_beta' `{Funext} A B x0 P f g e Px
g
(@path_forall _ _ _ _ _ e)
Px
= @transport ((forall a, B a) * B x0)%type
= @transport ((forall a, B a) * B x0)
(fun x => P (fst x) (snd x))
(f, f x0)
(g, g x0)
Expand Down Expand Up @@ -140,7 +140,7 @@ Ltac transport_path_forall_hammer :=
(** An example showing that it works *)
Lemma path_forall_2_beta' `{Funext} A B x0 x1 P f g e Px
: @transport (forall a : A, B a) (fun f => P (f x0) (f x1)) f g (@path_forall _ _ _ _ _ e) Px
= @transport (B x0 * B x1)%type (fun x => P (fst x) (snd x)) (f x0, f x1) (g x0, g x1) (path_prod' (e x0) (e x1)) Px.
= @transport (B x0 * B x1) (fun x => P (fst x) (snd x)) (f x0, f x1) (g x0, g x1) (path_prod' (e x0) (e x1)) Px.
Proof.
transport_path_forall_hammer.
repeat match goal with
Expand Down
Loading