Using Tactics

Other topics

Trivial example of a case analysis

In Coq, destruct more or less corresponds to a case analysis. It is similar to induction except that there's no induction hypothesis. Here is a (admittedly rather trivial) example of this tactic:

Require Import Coq.Arith.Lt.

Theorem atLeastZero : forall a,
0 <= a.
Proof.
  intros.
  destruct a. (* Case analysis *)
  - reflexivity. (* 0 >= 0 *)
  - apply le_0_n. (* S a is always greater than zero *)
  Qed.

Contributors

Topic Id: 8335

Example Ids: 26740

This site is not affiliated with any of the contributors.