Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Data/List/Fresh/Relation/Unary/All/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ module Data.List.Fresh.Relation.Unary.All.Properties where

open import Data.List.Fresh using (List#; []; cons; _∷#_; _#_)
open import Data.List.Fresh.Relation.Unary.All using (All; []; _∷_; append)
open import Data.Empty using (⊥; ⊥-elim)
open import Data.Nat.Base using (ℕ; zero; suc)
open import Data.Product.Base using (_,_)
open import Function.Base using (_∘′_)
open import Level using (Level; _⊔_; Lift)
open import Relation.Nullary.Negation.Core using (¬_)
open import Relation.Unary as U using (Pred)
open import Relation.Binary.Core using (Rel)
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong)
Expand Down
7 changes: 3 additions & 4 deletions src/Data/List/Fresh/Relation/Unary/Any/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
module Data.List.Fresh.Relation.Unary.Any.Properties where

open import Data.Bool.Base using (true; false)
open import Data.Empty using (⊥; ⊥-elim)
open import Data.List.Fresh using (List#; _∷#_; _#_; NonEmpty; cons; length; [])
open import Data.List.Fresh.Relation.Unary.All using (All; _∷_; append; [])
open import Data.List.Fresh.Relation.Unary.Any using (Any; here; there; _─_)
Expand All @@ -19,12 +18,12 @@ open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂)
open import Function.Base using (_∘′_)
open import Level using (Level; _⊔_; Lift)
open import Relation.Nullary.Reflects using (invert)
open import Relation.Nullary.Negation.Core using (¬_)
open import Relation.Nullary.Decidable.Core
open import Relation.Unary as U using (Pred)
open import Relation.Binary.Core using (Rel)
open import Relation.Nary using (∀[_]; _⇒_; ∁; Decidable)
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong)
open import Relation.Nullary.Negation.Core using (contradiction; ¬_)

private
variable
Expand Down Expand Up @@ -56,15 +55,15 @@ module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} (P⇒¬Q : ∀[ P ⇒ ∁ Q
module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} (P? : Decidable P) where

¬All⇒Any : {xs : List# A R} → ¬ (All P xs) → Any (∁ P) xs
¬All⇒Any {xs = []} ¬ps = ⊥-elim (¬ps [])
¬All⇒Any {xs = []} ¬ps = contradiction [] ¬ps
¬All⇒Any {xs = x ∷# xs} ¬ps with P? x
... | true because [p] = there (¬All⇒Any (¬ps ∘′ (invert [p] ∷_)))
... | false because [¬p] = here (invert [¬p])

¬Any⇒All : {xs : List# A R} → ¬ (Any P xs) → All (∁ P) xs
¬Any⇒All {xs = []} ¬ps = []
¬Any⇒All {xs = x ∷# xs} ¬ps with P? x
... | true because [p] = ⊥-elim (¬ps (here (invert [p])))
... | true because [p] = contradiction (here (invert [p])) ¬ps
... | false because [¬p] = invert [¬p] ∷ ¬Any⇒All (¬ps ∘′ there)

------------------------------------------------------------------------
Expand Down