[英]IndProp: re_not_empty_correct
Lemma re_not_empty_correct : forall T (re : @reg_exp T),
(exists s, s =~ re) <-> re_not_empty re = true.
Proof.
split.
- admit. (* I proved it myself *)
- intros. induction re.
+ simpl in H. discriminate H.
+ exists []. apply MEmpty.
+ exists [t]. apply MChar.
+ simpl in H. rewrite -> andb_true_iff in H. destruct H as [H1 H2].
apply IHre1 in H1. apply IHre2 in H2.
這是我們到目前為止所得到的:
1 subgoal (ID 505)
T : Type
re1, re2 : reg_exp
H1 : exists s : list T, s =~ re1
H2 : exists s : list T, s =~ re2
IHre1 : re_not_empty re1 = true -> exists s : list T, s =~ re1
IHre2 : re_not_empty re2 = true -> exists s : list T, s =~ re2
============================
exists s : list T, s =~ App re1 re2
現在我需要將 H1 和 H2 組合到exists s : list T, s =~ App re1 re2
或將目標分解為2 個子目標並分別使用H1 和H2 證明它們。 但我不知道,該怎么做。
您可以將exists
視為包含值及其屬性的對類型。 就像普通的pair類型一樣,你可以destruct
它。
例如,將destruct H1 as [s1 H1].
在這一點上給出
s1 : list T
H1 : s1 =~ re1
鑒於此,考慮如何在滿足s =~ App re1 re2
的目標中構造一個s
。 然后使用exists (your answer).
的策略exists (your answer).
(這會將目標更改為(your answer) =~ App re1 re2
)並填寫其余的證明(如果您的s
正確,則應該是微不足道的)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.