Sibi
Sibi

Reputation: 48654

Coq : Admit assert

Is there a way to admit asserts in Coq ?

Suppose I have a theorem like this:

Theorem test : forall m n : nat,
    m * n = n * m.
Proof.
  intros n m.
  assert (H1: m + m * n = m * S n). { Admitted. }
Abort.

The above assert doesn't seem to work for me.

The error I receive is:

Error: No focused proof (No proof-editing in progress).

What I want is something like undefined in Haskell. Baiscally, I will come back to this later and prove it. Is there something like that in Coq to achieve it ?

Upvotes: 5

Views: 4938

Answers (1)

ichistmeinname
ichistmeinname

Reputation: 1500

In general the tactic admit (lower-case first letter) admits the current subgoal. Thus assert <your assertion>. admit. should work in your case.

Or in its full glory as follows.

Theorem test : forall m n : nat,
  m * n = n * m.
Proof.
  intros n m.
  assert (H1: m + m * n = m * S n). admit.
Abort.

Edit: The version with ; is nonsense, because you do not want to admit all subgoals.

Upvotes: 7

Related Questions