coq中使用关键字“存在”的定义`
我试图使用以下语法定义一个名为isVector的实体coq中使用关键字“存在”的定义`,coq,exists,definition,Coq,Exists,Definition,我试图使用以下语法定义一个名为isVector的实体 Require Export Setoid. Require Export Coq.Reals.Reals. Require Export ArithRing. Definition Point := Type. Record MassPoint:Type:= cons{number : R ; point: Point}. Variable add_MP : MassPoint -> MassPoint -> MassP
Require Export Setoid.
Require Export Coq.Reals.Reals.
Require Export ArithRing.
Definition Point := Type.
Record MassPoint:Type:= cons{number : R ; point: Point}.
Variable add_MP : MassPoint -> MassPoint -> MassPoint .
Variable mult_MP : R -> MassPoint -> MassPoint .
Variable orthogonalProjection : Point -> Point -> Point -> Point.
Definition isVector (v:MassPoint):= exists A, B :Point , v= add_MP((−1)A)(1B).
COQIDE不断抱怨定义有语法错误。目前,我还没有弄明白。这里有很多问题 首先,你要写:
exists A B : Point, …
不同变量之间没有逗号
但是,右边也有语法错误。首先,我不确定1和-1操作是否存在。其次,函数调用的编写方式如下:
add_MP A B
你可以这样写:
add_MP(A)(B)
但从长远来看,您可能应该习惯于函数调用的语法只是一个空格!您可能需要像对其他操作进行公理化一样对-1操作进行公理化,除非它们是您在某处定义的符号,但没有在此处发布。这里有很多问题 首先,你要写:
exists A B : Point, …
不同变量之间没有逗号
但是,右边也有语法错误。首先,我不确定1和-1操作是否存在。其次,函数调用的编写方式如下:
add_MP A B
你可以这样写:
add_MP(A)(B)
但从长远来看,您可能应该习惯于函数调用的语法只是一个空格!您可能需要像对其他操作进行公理化一样对-1操作进行公理化,除非它们是您在某个地方定义的符号,但没有在此处发布。谢谢您的帮助。
经过一点实验。下面是有效的解决方案
Definition Point:= Type.
Record massPoint: Type := cons{number: R; point: Point}.
Variable add_MP: massPoint -> massPoint -> massPoint.
Variable mult_MP: R -> massPoint -> massPoint.
Definition tp (p:Point) := cons (-1) p.
Definition isVector(v:massPoint):= exists A B : Point, v = add_MP(cons (-1) A)(cons 1 B).
谢谢你的帮助。
经过一点实验。下面是有效的解决方案
Definition Point:= Type.
Record massPoint: Type := cons{number: R; point: Point}.
Variable add_MP: massPoint -> massPoint -> massPoint.
Variable mult_MP: R -> massPoint -> massPoint.
Definition tp (p:Point) := cons (-1) p.
Definition isVector(v:massPoint):= exists A B : Point, v = add_MP(cons (-1) A)(cons 1 B).
很高兴你明白了!很高兴你明白了!