feat(library/data/list/basic): add a lemma length_pos_of_mem

This commit is contained in:
Haitao Zhang 2015-07-14 19:20:54 -07:00 committed by Leonardo de Moura
parent 9d523bae6b
commit 721d3781ca

View file

@ -272,6 +272,10 @@ theorem not_mem_append {x : T} {s t : list T} : x ∉ s → x ∉ t → x ∉ s+
(λ xins, by contradiction)
(λ xint, by contradiction)
lemma length_pos_of_mem {a : T} : ∀ {l : list T}, a ∈ l → 0 < length l
| [] := assume Pinnil, by contradiction
| (b::l) := assume Pin, !zero_lt_succ
local attribute mem [reducible]
local attribute append [reducible]
theorem mem_split {x : T} {l : list T} : x ∈ l → ∃s t : list T, l = s ++ (x::t) :=