@@ -1156,13 +1156,13 @@ module _ {P : Pred A p} (P? : Decidable P) where
11561156 filter-all : ∀ {xs} → All P xs → filter P? xs ≡ xs
11571157 filter-all {[]} [] = refl
11581158 filter-all {x ∷ xs} (px ∷ pxs) with P? x
1159- ... | no ¬px = contradiction px ¬px
1160- ... | true because _ = cong (x ∷_) (filter-all pxs)
1159+ ... | false because [ ¬px] = contradiction px (invert [ ¬px])
1160+ ... | true because _ = cong (x ∷_) (filter-all pxs)
11611161
11621162 filter-notAll : ∀ xs → Any (∁ P) xs → length (filter P? xs) < length xs
11631163 filter-notAll (x ∷ xs) (here ¬px) with P? x
1164- ... | false because _ = s≤s (length-filter xs)
1165- ... | yes px = contradiction px ¬px
1164+ ... | false because _ = s≤s (length-filter xs)
1165+ ... | true because [px] = contradiction (invert [px]) ¬px
11661166 filter-notAll (x ∷ xs) (there any) with ih ← filter-notAll xs any | does (P? x)
11671167 ... | false = m≤n⇒m≤1+n ih
11681168 ... | true = s≤s ih
@@ -1178,8 +1178,8 @@ module _ {P : Pred A p} (P? : Decidable P) where
11781178 filter-none : ∀ {xs} → All (∁ P) xs → filter P? xs ≡ []
11791179 filter-none {[]} [] = refl
11801180 filter-none {x ∷ xs} (¬px ∷ ¬pxs) with P? x
1181- ... | false because _ = filter-none ¬pxs
1182- ... | yes px = contradiction px ¬px
1181+ ... | false because _ = filter-none ¬pxs
1182+ ... | true because [px] = contradiction (invert [px]) ¬px
11831183
11841184 filter-complete : ∀ {xs} → length (filter P? xs) ≡ length xs →
11851185 filter P? xs ≡ xs
@@ -1190,13 +1190,13 @@ module _ {P : Pred A p} (P? : Decidable P) where
11901190
11911191 filter-accept : ∀ {x xs} → P x → filter P? (x ∷ xs) ≡ x ∷ (filter P? xs)
11921192 filter-accept {x} Px with P? x
1193- ... | true because _ = refl
1194- ... | no ¬Px = contradiction Px ¬Px
1193+ ... | true because _ = refl
1194+ ... | false because [ ¬Px] = contradiction Px (invert [ ¬Px])
11951195
11961196 filter-reject : ∀ {x xs} → ¬ P x → filter P? (x ∷ xs) ≡ filter P? xs
11971197 filter-reject {x} ¬Px with P? x
1198- ... | yes Px = contradiction Px ¬Px
1199- ... | false because _ = refl
1198+ ... | true because [Px] = contradiction (invert [Px]) ¬Px
1199+ ... | false because _ = refl
12001200
12011201 filter-idem : filter P? ∘ filter P? ≗ filter P?
12021202 filter-idem [] = refl
@@ -1234,13 +1234,13 @@ module _ {R : Rel A p} (R? : B.Decidable R) where
12341234
12351235 derun-reject : ∀ {x y} xs → R x y → derun R? (x ∷ y ∷ xs) ≡ derun R? (y ∷ xs)
12361236 derun-reject {x} {y} xs Rxy with R? x y
1237- ... | yes _ = refl
1238- ... | no ¬Rxy = contradiction Rxy ¬Rxy
1237+ ... | true because _ = refl
1238+ ... | false because [ ¬Rxy] = contradiction Rxy (invert [ ¬Rxy])
12391239
12401240 derun-accept : ∀ {x y} xs → ¬ R x y → derun R? (x ∷ y ∷ xs) ≡ x ∷ derun R? (y ∷ xs)
12411241 derun-accept {x} {y} xs ¬Rxy with R? x y
1242- ... | yes Rxy = contradiction Rxy ¬Rxy
1243- ... | no _ = refl
1242+ ... | true because [ Rxy] = contradiction (invert [ Rxy]) ¬Rxy
1243+ ... | false because _ = refl
12441244
12451245------------------------------------------------------------------------
12461246-- partition
@@ -1253,7 +1253,7 @@ module _ {P : Pred A p} (P? : Decidable P) where
12531253 ... | true = cong (Product.map (x ∷_) id) ih
12541254 ... | false = cong (Product.map id (x ∷_)) ih
12551255
1256- length-partition : ∀ xs → (let ( ys , zs) = partition P? xs) →
1256+ length-partition : ∀ xs → (let ys , zs = partition P? xs) →
12571257 length ys ≤ length xs × length zs ≤ length xs
12581258 length-partition [] = z≤n , z≤n
12591259 length-partition (x ∷ xs) with ih ← length-partition xs | does (P? x)
0 commit comments