@@ -47,7 +47,7 @@ open import Relation.Binary.PropositionalEquality.Core
4747open import Relation.Nullary.Reflects using (invert)
4848open import Relation.Nullary.Negation.Core using (¬_; contradiction)
4949open import Relation.Nullary.Decidable
50- using (Dec; does; yes; no; _because_; ¬?; decidable-stable)
50+ using (Dec; does; yes; no; _because_; ¬?; decidable-stable; dec-true )
5151open import Relation.Unary
5252 using (Decidable; Pred; Universal; ∁; _∩_; _⟨×⟩_) renaming (_⊆_ to _⋐_)
5353open import Relation.Unary.Properties using (∁?)
@@ -461,6 +461,11 @@ all-head-dropWhile P? (x ∷ xs) with P? x
461461... | yes px = all-head-dropWhile P? xs
462462... | no ¬px = just ¬px
463463
464+ all⇒dropWhile≡[] : (P? : Decidable P) → All P xs → dropWhile P? xs ≡ []
465+ all⇒dropWhile≡[] P? [] = refl
466+ all⇒dropWhile≡[] P? (px ∷ pxs) rewrite dec-true (P? _) px
467+ = all⇒dropWhile≡[] P? pxs
468+
464469take⁺ : ∀ n → All P xs → All P (take n xs)
465470take⁺ zero pxs = []
466471take⁺ (suc n) [] = []
@@ -484,6 +489,11 @@ all-takeWhile P? (x ∷ xs) with P? x
484489... | yes px = px ∷ all-takeWhile P? xs
485490... | no ¬px = []
486491
492+ all⇒takeWhile≗id : (P? : Decidable P) → All P xs → takeWhile P? xs ≡ xs
493+ all⇒takeWhile≗id P? [] = refl
494+ all⇒takeWhile≗id P? (px ∷ pxs) rewrite dec-true (P? _) px
495+ = cong (_ ∷_) (all⇒takeWhile≗id P? pxs)
496+
487497------------------------------------------------------------------------
488498-- applyUpTo
489499
0 commit comments