What is the difference between “Qed” and “Defined”?

后端 未结 1 567
Happy的楠姐
Happy的楠姐 2021-02-08 03:07

In the interactive theorem prover Coq, any interactive proof or definition can be terminated with either Qed or Defined. There is some concept of \"opa

1条回答
  •  时光说笑
    2021-02-08 04:05

    You are not really able to use the value of x, but only its type. For example, since x is false, try to prove that x = false or that x = true, and you won't be able to. You can unfold the definition of not_x (its definition is the same as that of x, but using Defined), but you won't be able to inspect the value of x, you only know that it is a boolean.

    Lemma not_x_is_true : not_x = true.
    Proof.
    unfold not_x. (* this one is fine *)
    unfold x. (* This one is not. Error: Cannot coerce x to an evaluable reference. *)
    

    The idea behind Qed vs Defined is that in some cases, you don't want to look at the content of proof term (because it is not relevant, or just a really huge term you don't want to unfold), and all you need to know is that the statement is true, not why it is true. In the end, the question you have to ask before using Qed or Defined is: Do I need to know why one theorem is true, or do I only need to know that it is true?

    0 讨论(0)
提交回复
热议问题