Skip to content

Commit

Permalink
lib: add length_tail_nonempty
Browse files Browse the repository at this point in the history
Signed-off-by: Michael McInerney <[email protected]>
  • Loading branch information
michaelmcinerney committed Feb 20, 2024
1 parent dce36cc commit 66b399a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Lib.thy
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,10 @@ lemma list_not_last:
"Suc 0 < length ls \<Longrightarrow> ls \<noteq> [last ls]"
by (cases ls; clarsimp)

lemma length_tail_nonempty:
"Suc 0 < length list \<Longrightarrow> tl list \<noteq> []"
by (cases list, simp, simp)

text \<open>Prevent clarsimp and others from creating Some from not None by folding this and unfolding
again when safe.\<close>

Expand Down

0 comments on commit 66b399a

Please sign in to comment.