@@ -454,22 +454,14 @@ module _ {R : A → A → Set ℓ} where
454
454
------------------------------------------------------------------------
455
455
-- nested lists
456
456
457
+ map∷⁻ : xs ∈ map (y ∷_) xss → ∃[ ys ] ys ∈ xss × xs ≡ y ∷ ys
458
+ map∷⁻ = ∈-map⁻ (_ ∷_)
459
+
457
460
[]∉map∷ : (List A ∋ []) ∉ map (x ∷_) xss
458
- []∉map∷ {xss = _ ∷ _} (there p) = []∉ map∷ p
461
+ []∉map∷ p with () ← map∷⁻ p
459
462
460
463
map∷-decomp∈ : (List A ∋ x ∷ xs) ∈ map (y ∷_) xss → x ≡ y × xs ∈ xss
461
- map∷-decomp∈ {xss = _ ∷ _} = λ where
462
- (here refl) → refl , here refl
463
- (there p) → map₂ there $ map∷-decomp∈ p
464
-
465
- map∷-decomp : xs ∈ map (y ∷_) xss → ∃[ ys ] ys ∈ xss × y ∷ ys ≡ xs
466
- map∷-decomp {xss = _ ∷ _} (here refl) = -, here refl , refl
467
- map∷-decomp {xs = []} {xss = _ ∷ _} (there xs∈) = contradiction xs∈ []∉map∷
468
- map∷-decomp {xs = x ∷ xs} {xss = _ ∷ _} (there xs∈) =
469
- let eq , p = map∷-decomp∈ xs∈
470
- in -, there p , cong (_∷ _) (sym eq)
464
+ map∷-decomp∈ p with _ , xs∈xss , refl ← map∷⁻ p = refl , xs∈xss
471
465
472
466
∈-map∷⁻ : xs ∈ map (x ∷_) xss → x ∈ xs
473
- ∈-map∷⁻ {xss = _ ∷ _} = λ where
474
- (here refl) → here refl
475
- (there p) → ∈-map∷⁻ p
467
+ ∈-map∷⁻ p with _ , _ , refl ← map∷⁻ p = here refl
0 commit comments