Is it possible to somehow "one line" a proof by cases/induction, where the proof in each case is easy? I ask because these proofs feel quite redundant. Here is an example of a proof I wrote with this issue (the cases are , , and the whole space):
lemma open_interval_connected:
assumes "open_interval I" "x ∈ I" "y ∈ I" "z ∈ carrier L" "z between x y"
shows "z ∈ I"
using assms proof (induction rule: open_interval.induct)
case (both a b)
thus ?case by (metis (no_types, lifting) btw_def lless_eq lless_trans mem_Collect_eq)
next
case (lower a)
thus ?case by (metis (no_types, lifting) btw_def lless_eq lless_trans mem_Collect_eq)
next
case (upper b)
thus ?case by (metis (no_types, lifting) btw_def lless_eq lless_trans mem_Collect_eq)
next
case carrier
then show ?case by blast
qed
Something like this?
lemma open_interval_connected:
assumes "open_interval I" "x ∈ I" "y ∈ I" "z ∈ carrier L" "z between x y"
shows "z ∈ I"
using assms by (induction rule: open_interval.induct; (metis (no_types, lifting) btw_def lless_eq lless_trans mem_Collect_eq))
You could place a method after the qed
to solve all remaining cases. Something like
lemma "foo"
proof(induction ...)
case 1
<complicated proof>
qed (something that solves all other suboals)
Last updated: Dec 21 2024 at 16:20 UTC