Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save semorrison/f5128fcb8b5da4552153fa7acbccbe24 to your computer and use it in GitHub Desktop.
Save semorrison/f5128fcb8b5da4552153fa7acbccbe24 to your computer and use it in GitHub Desktop.
import data.list.basic
lemma list.nil_le {α : Type*} [linear_order α] (L : list α) : [] ≤ L :=
begin
cases L,
{ left, refl, },
{ right, constructor, },
end
lemma list.nil_lt {α : Type*} [linear_order α] (a : α) (L : list α) : [] < a :: L :=
begin
constructor,
end
lemma list.cons_le_iff {α : Type*} [linear_order α] (a a' : α) (L L' : list α) :
a :: L ≤ a' :: L' ↔ (a < a') ∨ (a = a' ∧ L ≤ L') :=
begin
fsplit,
{ intro h,
cases h,
{ injections with ha hL,
right,
split,
assumption,
left,
assumption, },
{ cases h,
{ right,
split,
refl,
right,
assumption, },
{ left, assumption, }}},
{ intro h,
cases h,
{ right, constructor, assumption, },
{ rcases h with ⟨rfl, ⟨rfl|h⟩⟩,
{ left, refl, },
{ right, constructor, assumption, }} },
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment