Skip to content

Commit

Permalink
feat(data/fin): last
Browse files Browse the repository at this point in the history
  • Loading branch information
spl committed Aug 23, 2018
1 parent 58cfe9f commit bd12c3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/fin.lean
Expand Up @@ -6,6 +6,12 @@ namespace fin

variable {n : ℕ}

/-- The greatest value of `fin (n+1)` -/
def last (n : ℕ) : fin (n+1) := ⟨_, n.lt_succ_self⟩

theorem le_last (i : fin (n+1)) : i ≤ last n :=
le_of_lt_succ i.is_lt

/-- Embedding of `fin n` in `fin (n+1)` -/
def raise (k : fin n) : fin (n + 1) := ⟨val k, lt_succ_of_lt (is_lt k)⟩

Expand Down

0 comments on commit bd12c3f

Please sign in to comment.