leanprover-community / mathlib

  • Home
  • Zulip archive
  • API documentation
  • Lean web editor
  • Links

Zulip Chat Archive

Stream: new members

Topic: Non-empty list has last element


Martin Dvořák (Feb 05 2022 at 15:02):

How can I prove that a non-empty list has last element, please? See MWE below.

example (α : Type) (a : list α) (h: list.length a > 0) :
  ∃ x : α, ∃ xs : list α, a = xs ++ [x] :=
begin
  sorry,
end

Last updated: May 02 2025 at 03:31 UTC

Theme Simple by wildflame © 2016 Powered by jekyll