我是Coq的新手。 我有一个记录类型和一个定义:
Record t : Type := T {
width : nat;
}.
Definition indent shift f :=
match f with
| T w => T
(w + shift)
end.
我想证明一个琐碎的引理:
Lemma lemma :
forall (a:t) n, width a <= width (indent n a).
展开indent
子目标后变为:
(width a <= width match a with
| {| width := w |} => {| width := w + n |}
end)
如何简化术语?
答案 0 :(得分:0)
破坏简单。
那次归纳之后。
答案 1 :(得分:0)
使用其他定义,simpl
将完成工作:
Definition indent shift f := T (f.(width) + shift).
答案 2 :(得分:0)
当您看到其中带有match a with ... end
的术语时,可以通过执行destruct a
来简化它。另外,如果您需要摆脱let a := b in ...
,并且需要记住a
是什么,请执行destruct a eqn:Ha
。