File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2152,7 +2152,8 @@ Other minor changes
21522152
21532153 length-isMagmaHomomorphism : (A : Set a) → IsMagmaHomomorphism (++-rawMagma A) +-rawMagma length
21542154 length-isMonoidHomomorphism : (A : Set a) → IsMonoidHomomorphism (++-[]-rawMonoid A) +-0-rawMonoid length
2155-
2155+
2156+ take-all : n ≥ length xs → take n xs ≡ xs
21562157 take-[] : ∀ m → take m [] ≡ []
21572158 drop-[] : ∀ m → drop m [] ≡ []
21582159 ```
Original file line number Diff line number Diff line change @@ -759,6 +759,12 @@ length-take zero xs = refl
759759length-take (suc n) [] = refl
760760length-take (suc n) (x ∷ xs) = cong suc (length-take n xs)
761761
762+ -- If you take at least as many elements from a list as it has, you get the whole list.
763+ take-all : (n : ℕ) (xs : List A) → n ≥ length xs → take n xs ≡ xs
764+ take-all zero [] _ = refl
765+ take-all (suc _) [] _ = refl
766+ take-all (suc n) (x ∷ xs) (s≤s pf) = cong (x ∷_) (take-all n xs pf)
767+
762768-- Taking from an empty list does nothing.
763769take-[] : ∀ m → take {A = A} m [] ≡ []
764770take-[] zero = refl
You can’t perform that action at this time.
0 commit comments