proof (rule disjE) for nested disjunction

馋奶兔 提交于 2019-12-01 04:20:37

While writing the question, I had an idea, and it turns out to be what I want:

from `a ∨ b ∨ c` have foo
proof(elim disjE)
  assume a
  show foo sorry
next
  assume b
  show foo sorry
next
  assume c
  show foo sorry
qed

Another canonical way to do this kind of case analysis is as follows:

{ assume a
  have foo sorry }
moreover
{ assume b
  have foo sorry }
moreover
{ assume c
  have foo sorry }
ultimately
have foo using `a ∨ b ∨ c` by blast

That is, let an automatic tool "figure out" the details at the end. This works especially well when considering arithmetical cases (with by arith as final step).

Update: Using the new consider statement it can be done as follows:

notepad
begin
  fix A B C assume "A ∨ B ∨ C"
  then consider A | B | C by blast
  then have "something"
  proof (cases)
    case 1
    show ?thesis sorry
  next
    case 2
    show ?thesis sorry
  next
    case 3
    show ?thesis sorry
  qed
end

Alternatively to do case distinction, it seems you can bend the more general induct method to do your bidding. For three cases, this would work like this: Prove a lemma disjCases3:

lemma disjCases3[consumes 1, case_names 1 2 3]:
  assumes ABC: "A ∨ B ∨ C"
  and AP: "A ⟹ P"
  and BP: "B ⟹ P"
  and CP: "C ⟹ P"
  shows "P"
proof -
  from ABC AP BP CP show ?thesis by blast
qed

You can use this lemma as follows:

from `a ∨ b ∨ c` have foo
proof(induct rule: disjCases3)
  case 1 thus ?case 
     sorry
next
  case 2 thus ?case 
     sorry
next
  case 3 thus ?case 
     sorry
qed

The disadvantage is you need a bunch of lemmas to cover any number of cases, disjCases2, disjCases3, disjCases4, disjCases5 etc., but otherwise it seems to work nicely.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!