Skip to content

Instantly share code, notes, and snippets.

@solson
Created May 6, 2018 10:59
Show Gist options
  • Select an option

  • Save solson/8706d5ce9af4b63729d01de1cdcbc393 to your computer and use it in GitHub Desktop.

Select an option

Save solson/8706d5ce9af4b63729d01de1cdcbc393 to your computer and use it in GitHub Desktop.
lemma range_core_step : ∀ (n : ℕ) (xs ys : list ℕ),
range_core n (xs ++ ys) = range_core n xs ++ ys
| 0 xs ys := rfl
| (n+1) xs ys := by rw [range_core, range_core, ←cons_append, range_core_step]
lemma range_step (n : ℕ) : range (n.succ) = range n ++ [n] :=
have h : range_core n [n] = range_core n (nil ++ [n]), by rw nil_append,
by rw [range, range, range_core, h, range_core_step]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment