1

Let's think of something like this Section as an example

Section myList.

Variable X : Type.

Definition myListApp2 (l1 l2       : list X) :=
  app l1 l2.

Definition myListApp3 (l1 l2 l3    : list X) :=
  app (app l1 l2) l3.

Definition NoXUse n := S n.

Definition myListApp4 (l1 l2 l3 l4 : list X) :=
  app (app (app l1 l2) l3) l4.

End myList.

Arguments myListApp2 {X}.
Arguments myListApp3 {X}.
Arguments myListApp4 {X}.

after the End of Section I need to set the first argument of all the definitions implicit by hand, is there any way to tell Coq that the Variable X is always implicit?

1 Answers1

2

The Context command is a variant of Variable that allows this.

Section myList.

Context {X : Type}.

Definition myListApp2 (l1 l2       : list X) :=
  app l1 l2.

Definition myListApp3 (l1 l2 l3    : list X) :=
  app (app l1 l2) l3.

Definition NoXUse n := S n.

Definition myListApp4 (l1 l2 l3 l4 : list X) :=
  app (app (app l1 l2) l3) l4.

End myList.
Li-yao Xia
  • 31,896
  • 2
  • 33
  • 56