Isabelle 如何用偏函数证明引理?

Isabelle 如何用偏函数证明引理?,isabelle,Isabelle,你能建议如何证明这个简单引理吗 datatype val = BVal bool | IVal int lemma the_unif: "the (x :: val option) = the (y :: val option) ⟹ x = y" apply (induct x; induct y) apply simp 我试图用归纳法证明它,但我坚持用case⋀选项None=(某些选项)⟹ 无=某些选项 选项可以等于BVal x或IVal x。它永远不会等于无。因此,在这种情况下,

你能建议如何证明这个简单引理吗

datatype val = BVal bool | IVal int

lemma the_unif:
"the (x :: val option) = the (y :: val option) ⟹ x = y"
  apply (induct x; induct y)
  apply simp
我试图用归纳法证明它,但我坚持用case
⋀选项None=(某些选项)⟹ 无=某些选项

选项
可以等于
BVal x
IVal x
。它永远不会等于无。因此,在这种情况下,假设值总是错误的

更新:

我可以证明以下引理:

lemma the_none_ne_the_some:
  "x ≠ the None ⟹ the None ≠ the (Some x)"
  by simp
lemma the_unif:
  "x ≠ Some (the None) ⟹ y ≠ Some (the None) ⟹ the x = the y ⟹ x = y"
  by (induct x; induct y; simp)
所以我想,第一个引理也可以被证明

一般引理无法被证明,因为它确实不成立:

lemma the_unif:
  "the x = the y ⟹ x = y"
反例:

x = None
y = Some (the None)
但是在第一引理中,
x
y
都不能等于
Some(None)
。所以我找不到第一引理的反例

哦,我知道了,我可以证明以下引理:

lemma the_none_ne_the_some:
  "x ≠ the None ⟹ the None ≠ the (Some x)"
  by simp
lemma the_unif:
  "x ≠ Some (the None) ⟹ y ≠ Some (the None) ⟹ the x = the y ⟹ x = y"
  by (induct x; induct y; simp)
但是如何证明
x::val选项
意味着
x≠ 一些(无)

更新2:

似乎无法证明:

lemma val_not_the_none:
  "x = BVal b ∨ x = IVal i ⟹ x ≠ the None"

但是如果引理不成立,那么它们一定有反例?你能提供一个吗?

你试图证明的东西根本站不住脚<代码>无是未指定的–本质上,没有任何非琐碎的东西可以证明。因此,说“它永远不会等于无”是空洞的,因为你不知道无是什么。

我已经为这个问题添加了一个更新。你能建议如何证明
x::val选项
意味着
x吗≠ 一些(无)
?似乎这实际上是不可能的。。。但在这种情况下,引理必须有一个反例。如果没有,也许可以用矛盾来证明?既没有例子也没有反例。正如我所说,这是未指明的。