1

The Coq manual (Simultaneous definition of terms and notations) states

Thanks to reserved notations, inductive, co-inductive, record, recursive and corecursive definitions can use customized notations.

I would like to define something like

Reserved Notation "A +' B" (at level 80).
Record foo T :=
  { add : T -> T ->T;
    commute a b : a +' b = b +' a 
      where "a +' b" := (add a b)
  }.

but I get

Error: Unknown interpretation for notation "_ +' _".
larsr
  • 5,447
  • 19
  • 38
  • 1
    Putting the "where" clause after the record brings up an error message: "where clause not supported for records". This looks like a bug, either in the manual or in the grammar. – Arthur Azevedo De Amorim Jul 30 '20 at 12:44

1 Answers1

1

One must define the notation before the first use in the Record, like this:

Reserved Notation "A +' B" (at level 60).
Record foo T :=
  { add : T -> T ->T where "A +' B" := (add A B);
    commute a b : a +' b = b +' a 
  }.
larsr
  • 5,447
  • 19
  • 38