coq

How to define axiom of a line as two points in Coq

╄→гoц情女王★ 提交于 2019-12-02 04:45:23
I am trying to find an example axiom in Coq of something like the line axiom in geometry: If given two points, there exist a line between those two points. I would like to see how this could be defined in Coq. Inherently choosing this simple line axiom to see how something very primitive is defined, because I'm having a hard time defining it outside natural language. Specifically, I have seen these two axioms and would like to know how in Coq to define both: Any two distinct points always determine a line Any two distinct points of a line determine this line uniquely It almost seems like you

How to run Athena | Coq | Isabelle codes remotely?

帅比萌擦擦* 提交于 2019-12-02 03:04:26
问题 I' ve been creating a Web IDE (WIDE) for theorem proving in Computer Science. You may know, there are 3 most common proof assitants which names Athena, Isabelle and Coq. Most of computer scientist might forget their syntax, scopes etc. My Web IDE works with drag and drop desing and examples. You can edit and write additional code on it, you can download it, you can share it, you can save it etc. It has also own parser. So far everything is OK. Watch out! Here is my question: How can I run the

Best way to perform universal instantiation in Coq

谁说胖子不能爱 提交于 2019-12-02 02:59:49
问题 Suppose I have an hypothesis H : forall ( x : X ), P x and a variable x : X in the context. I want to perform universal instantiation and obtain a new hypothesis H' : P x . What is the most painless way to do this? Apparently apply H in x does not work. assert ( P x ) followed by apply H does, but it can get very messy if P is complex. There's a similar question that seems somewhat related. Not sure if it can be applied here, though. 回答1: pose proof (H x) as H'. The parentheses are optional.

How to run Athena | Coq | Isabelle codes remotely?

青春壹個敷衍的年華 提交于 2019-12-02 01:20:58
I' ve been creating a Web IDE (WIDE) for theorem proving in Computer Science. You may know, there are 3 most common proof assitants which names Athena, Isabelle and Coq. Most of computer scientist might forget their syntax, scopes etc. My Web IDE works with drag and drop desing and examples. You can edit and write additional code on it, you can download it, you can share it, you can save it etc. It has also own parser. So far everything is OK. Watch out! Here is my question: How can I run the users' codes and get the result (especially for Athena http://proofcentral.org/ ) when user would like

Eval compute is incomplete when own decidability is used in Coq

回眸只為那壹抹淺笑 提交于 2019-12-01 20:37:17
问题 The Eval compute command does not always evaluate to a simple expression. Consider the code: Require Import Coq.Lists.List. Require Import Coq.Arith.Peano_dec. Import ListNotations. Inductive I : Set := a : nat -> I | b : nat -> nat -> I. Lemma I_eq_dec : forall x y : I, {x = y}+{x <> y}. Proof. repeat decide equality. Qed. And, if I execute the following command: Eval compute in (if (In_dec eq_nat_dec 10 [3;4;5]) then 1 else 2). Coq tells me that the result is 2 . However, when I execute the

Eval compute is incomplete when own decidability is used in Coq

做~自己de王妃 提交于 2019-12-01 19:20:59
The Eval compute command does not always evaluate to a simple expression. Consider the code: Require Import Coq.Lists.List. Require Import Coq.Arith.Peano_dec. Import ListNotations. Inductive I : Set := a : nat -> I | b : nat -> nat -> I. Lemma I_eq_dec : forall x y : I, {x = y}+{x <> y}. Proof. repeat decide equality. Qed. And, if I execute the following command: Eval compute in (if (In_dec eq_nat_dec 10 [3;4;5]) then 1 else 2). Coq tells me that the result is 2 . However, when I execute the following expression: Eval compute in (if (In_dec I_eq_dec (a 2) [(a 1);(a 2)]) then 1 else 2). I get

Defining constants using existence proofs in Coq

萝らか妹 提交于 2019-12-01 19:06:38
After proving an existence statement, it is often notationally convenient to introduce a constant symbol for some witness of this theorem. As a simple example, it is much more simple to write (in typical mathematical notation) ∀x. ∅ ⊆ x. than it is to write ∀x. ∃y. empty(y) and y ⊆ x. I am looking to replicate this effect in Coq. Here is the basic scenario I am encountering and my attempt which leads to an error (now in real Coq code): Variable A:Type. Hypothesis inhabited: exists x:A, x=x. Definition inhabitant:A. destruct inhabited. (*Error: Case analysis on sort Type is not allowed for

Defining constants using existence proofs in Coq

萝らか妹 提交于 2019-12-01 18:16:04
问题 After proving an existence statement, it is often notationally convenient to introduce a constant symbol for some witness of this theorem. As a simple example, it is much more simple to write (in typical mathematical notation) ∀x. ∅ ⊆ x. than it is to write ∀x. ∃y. empty(y) and y ⊆ x. I am looking to replicate this effect in Coq. Here is the basic scenario I am encountering and my attempt which leads to an error (now in real Coq code): Variable A:Type. Hypothesis inhabited: exists x:A, x=x.

Coq: Ltac definitions over variable argument lists?

。_饼干妹妹 提交于 2019-12-01 17:57:41
问题 While trying to create an Ltac definition that loops over a variable-length argument list, I encountered the following unexpected behavior on Coq 8.4pl2. Can anyone explain it to me? Ltac ltac_loop X := match X with | 0 => idtac "done" | _ => (fun Y => idtac "hello"; ltac_loop Y) end. Goal True. ltac_loop 0. (* prints "done" as expected *) ltac_loop 1 0. (* prints "hello" then "done" as expected *) ltac_loop 1 1 0. (* unexpectedly yields "Error: Illegal tactic application." *) 回答1: Let's

Confused by Coq imports

余生颓废 提交于 2019-12-01 17:50:24
Can someone please tell me the differences between Require Name . Require Import Name . Import Name ? Require : load an external library (typically from the standard library or the user-contribs/ folder); Import : imports the names in a module. For example, if you have a function f in a module M , by doing Import M. , you will only need to type f instead of M.f ; Require Import : does both Require and Import . 来源: https://stackoverflow.com/questions/33854672/confused-by-coq-imports