3
Require Import Relations RelationClasses.

Section MySection.
  Variable A : Type.
  Variable R : relation A.
  (* ... *)
End MySection.

How could I require R to be a partial order?

2
  • 1
    Congrats! This is the 1000th Coq question on Stackoverflow! Commented Jun 27, 2017 at 19:57
  • This is awesome! Commented Jun 28, 2017 at 3:39

1 Answer 1

3

There is the Context syntax, see The Coq Reference manual, §20.4:

To ease the parametrization of developments by type classes, we provide a new way to introduce variables into section contexts, compatible with the implicit argument mechanism. The new command works similarly to the Variables vernacular (see 1.3.1), except it accepts any binding context as argument.

Example:

From Coq Require Import RelationClasses.

Generalizable Variable A eqA R.

Section MySection.
  Context `{PO : PartialOrder A eqA R}.
  (* ... *)
End MySection.
1

Not the answer you're looking for? Browse other questions tagged or ask your own question.