Skip to content

Commit

Permalink
chore(data/fin2): linting (#4426)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmill committed Oct 5, 2020
1 parent dd73dd2 commit 1501bf6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/data/fin2.lean
Expand Up @@ -16,12 +16,15 @@ inductive fin2 : ℕ → Type

namespace fin2

/-- Define a dependent function on `fin2 (succ n)` by giving its value at
zero (`H1`) and by giving a dependent function on the rest (`H2`). -/
@[elab_as_eliminator]
protected def cases' {n} {C : fin2 (succ n) → Sort u} (H1 : C fz) (H2 : Π n, C (fs n)) :
Π (i : fin2 (succ n)), C i
| fz := H1
| (fs n) := H2 n

/-- Ex falso. The dependent eliminator for the empty `fin2 0` type. -/
def elim0 {C : fin2 0Sort u} : Π (i : fin2 0), C i.

/-- convert a `fin2` into a `nat` -/
Expand Down Expand Up @@ -79,4 +82,6 @@ def of_nat' : Π {n} m [is_lt m n], fin2 n

local prefix `&`:max := of_nat'

instance : inhabited (fin2 1) := ⟨fz⟩

end fin2

0 comments on commit 1501bf6

Please sign in to comment.