forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList.lean
More file actions
30 lines (21 loc) · 902 Bytes
/
List.lean
File metadata and controls
30 lines (21 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/-
Copyright (c) 2021 Kim Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kim Morrison
-/
module
public import Mathlib.Logic.Small.Basic
public import Mathlib.Data.Vector.Basic
/-!
# Instances for `Small (List α)` and `Small (Vector α)`.
These must not be in `Logic.Small.Basic` as this is very low in the import hierarchy,
and is used by category theory files which do not need everything imported by `Data.Vector.Basic`.
-/
@[expose] public section
universe u v
open Mathlib
instance smallVector {α : Type v} {n : ℕ} [Small.{u} α] : Small.{u} (List.Vector α n) :=
small_of_injective (Equiv.vectorEquivFin α n).injective
instance smallList {α : Type v} [Small.{u} α] : Small.{u} (List α) := by
let e : (Σ n, List.Vector α n) ≃ List α := Equiv.sigmaFiberEquiv List.length
exact small_of_surjective e.surjective