如何证明Mizar(数学定理证明语言)的自然数等于1?

时间:2018-11-28 04:29:35

标签: theorem-proving theorem mizar

我想用我能想到的Mizar数学定理证明者语言编写最简单的证明。所以我想到了以下几点:

  

在Nat中存在x \:x = 1

我能想到的没有什么比这更简单的了。我做了以下尝试:

:: example of a comment
environ
  vocabularies MY_MIZAR;
  :: adding Natural Numbers
  requirments SUBSET, NUMERALS, ARITHM;
::>         *210
begin

theorem Th1:
    ex x being Nat st x=1
proof
    ::consider x = 1
    :: proof is done
    x = 1;
    thus Th1;
end;
::>
::> 210: Wrong item in environment declaration

但是您可以看到Mizar不喜欢我的证明。我想念什么?


这仍然行不通:

::: example of a comment
environ
  vocabularies MY_MIZAR;
  ::: adding Natural Numbers
  requirements SUBSET, NUMERALS, ARITHM;
::>                 *856      *825
begin

theorem Th1:
    ex x being Nat st x=1
proof
    :::consider x = 1
    ::: proof is done
    set x=1;
    take x;
    thus thesis;
end;
::>
::> 825: Cannot find constructors name on constructor list
::> 856: Inaccessible requirements directive

2 个答案:

答案 0 :(得分:1)

有几种方法可以做到这一点:

尽管您的陈述不完全是一个示例(由于您使用的是“ Nat”类型,所以它也不完全是您的陈述)。

environ

 vocabularies NUMBERS;
 constructors ARYTM_0;
 notations NUMBERS;
 registrations ORDINAL1;
 requirements NUMERALS, SUBSET, BOOLE;

begin

1 in NAT;

ex x be object st x = 1;

ex x be object st x in NAT & x = 1;

mizar验证了这3个陈述的正确性,真实性和示范性。

如果未证明(在荒谬的意义上),它将表示* 4错误,甚至有时是* 1错误。

对于此处的3条陈述,没有明确说明证据。它包含在环境中,因为Mizar不需要您指示所有步骤,其中某些步骤是自动的。

可以以这种方式呈现,Mizar也可以接受。

environ

 vocabularies NUMBERS;
 constructors ARYTM_0;
 notations NUMBERS;
 registrations ORDINAL1;
 requirements NUMERALS, SUBSET, BOOLE;

begin

1 in NAT
proof
  thus thesis;
end;

ex x be object st x = 1
proof
  thus thesis;
end;

ex x be object st x in NAT & x = 1
proof
  thus thesis;
end;

但是在这种情况下,完整的表达方式

proof
  thus thesis;
end;

是多余的。

返回到最初的问题,并使用建议(user10715283和user10715216)。 “我们可以采用较小的环境吗?”:是的,使用特定工具(clearenv.pl,由Mizar-System提供)

environ

 vocabularies NAT_1;
 constructors NUMBERS, XCMPLX_0, XREAL_0, BINOP_1;
 notations ORDINAL1;
 registrations ORDINAL1;
 requirements NUMERALS, SUBSET;

begin

theorem Th1:
    ex x being Nat st x=1
proof
    set x=1;
    take x;
    thus thesis;
end;

答案 1 :(得分:1)

您可以尝试以下操作:

1)修复210:错误:

x  requirments (wrong spelling)
o  requirements

2)可能会有一些新的错误 关于那行的内容,所以当 您刚开始,通常 “借用”已经起作用的环境,例如, 您可以使用其中之一的环境线 关于自然数的Mizar文章,例如 NAT_1.miz:

environ
:: adding Natural Numbers
vocabularies NUMBERS, ORDINAL1, REAL_1, SUBSET_1, CARD_1, ARYTM_3, TARSKI,
  RELAT_1, XXREAL_0, XCMPLX_0, ARYTM_1, XBOOLE_0, FINSET_1, FUNCT_1, NAT_1,
  FUNCOP_1, PBOOLE, PARTFUN1, FUNCT_7, SETFAM_1, ZFMISC_1;
notations TARSKI, XBOOLE_0, ENUMSET1, ZFMISC_1, SUBSET_1, SETFAM_1, ORDINAL1,
  FINSET_1, CARD_1, PBOOLE, NUMBERS, XCMPLX_0, XREAL_0, XXREAL_0, RELAT_1,
  FUNCT_1, PARTFUN1, FUNCOP_1, FUNCT_2, BINOP_1;
constructors NUMBERS, XCMPLX_0, XXREAL_0, XREAL_0, CARD_1, WELLORD2, FUNCT_2,
  PARTFUN1, FUNCOP_1, FUNCT_4, ENUMSET1, RELSET_1, PBOOLE, ORDINAL1,
  SETFAM_1, ZFMISC_1, BINOP_1;
registrations SUBSET_1, ORDINAL1, NUMBERS, XXREAL_0, XREAL_0, CARD_1,
  RELSET_1, FUNCT_2, PBOOLE;
requirements REAL, NUMERALS, SUBSET, BOOLE, ARITHM;
definitions SETFAM_1, TARSKI, XBOOLE_0, RELAT_1;
equalities ORDINAL1, XBOOLE_0, CARD_1;
expansions SETFAM_1, ORDINAL1, TARSKI, XBOOLE_0;
theorems AXIOMS, ORDINAL1, XCMPLX_1, XREAL_1, XXREAL_0, TARSKI, ORDINAL2,
  XBOOLE_0, CARD_1, FUNCT_2, FUNCT_1, FUNCOP_1, PBOOLE, RELSET_1, RELAT_1,
  PARTFUN1, SUBSET_1, NUMBERS, ENUMSET1, XBOOLE_1;
schemes SUBSET_1, ORDINAL2, FUNCT_2, PBOOLE, BINOP_1;

3)要以“ 1”为例,可以使用“ set”,“ take”:

proof
  set x=1;
  take x;
  thus thesis;
end;

希望这会有所帮助。