@@ -40,7 +40,7 @@ open import Relation.Binary
40
40
import Relation.Binary.Reasoning.Setoid as EqR
41
41
import Relation.Binary.Reasoning.Preorder as PreorderReasoning
42
42
open import Relation.Binary.PropositionalEquality as P
43
- using (_≡_; _≢_; _≗_; refl )
43
+ using (_≡_; _≢_; _≗_)
44
44
open import Relation.Nullary
45
45
open import Data.List.Membership.Propositional.Properties
46
46
@@ -115,7 +115,7 @@ module ⊆-Reasoning where
115
115
module _ {a k} {A : Set a} {x y : A} {xs ys} where
116
116
117
117
∷-cong : x ≡ y → xs ∼[ k ] ys → x ∷ xs ∼[ k ] y ∷ ys
118
- ∷-cong refl xs≈ys {y} =
118
+ ∷-cong P. refl xs≈ys {y} =
119
119
y ∈ x ∷ xs ↔⟨ SK-sym $ ∷↔ (y ≡_) ⟩
120
120
(y ≡ x ⊎ y ∈ xs) ∼⟨ (y ≡ x ∎) ⊎-cong xs≈ys ⟩
121
121
(y ≡ x ⊎ y ∈ ys) ↔⟨ ∷↔ (y ≡_) ⟩
@@ -244,8 +244,8 @@ commutativeMonoid {a} k A = record
244
244
245
245
empty-unique : ∀ {k a} {A : Set a} {xs : List A} →
246
246
xs ∼[ ⌊ k ⌋→ ] [] → xs ≡ []
247
- empty-unique {xs = []} _ = refl
248
- empty-unique {xs = _ ∷ _} ∷∼[] with ⇒→ ∷∼[] (here refl)
247
+ empty-unique {xs = []} _ = P. refl
248
+ empty-unique {xs = _ ∷ _} ∷∼[] with ⇒→ ∷∼[] (here P. refl)
249
249
... | ()
250
250
251
251
-- _++_ is idempotent (under set equality).
@@ -278,7 +278,7 @@ empty-unique {xs = _ ∷ _} ∷∼[] with ⇒→ ∷∼[] (here refl)
278
278
(fs ⊛ (xs₁ ++ xs₂)) ∼[ bag ] (fs ⊛ xs₁) ++ (fs ⊛ xs₂)
279
279
⊛-left-distributive {B = B} fs xs₁ xs₂ = begin
280
280
fs ⊛ (xs₁ ++ xs₂) ≡⟨⟩
281
- (fs >>= λ f → xs₁ ++ xs₂ >>= return ∘ f) ≡⟨ (MP.cong (refl {x = fs}) λ f →
281
+ (fs >>= λ f → xs₁ ++ xs₂ >>= return ∘ f) ≡⟨ (MP.cong (P. refl {x = fs}) λ f →
282
282
MP.right-distributive xs₁ xs₂ (return ∘ f)) ⟩
283
283
(fs >>= λ f → (xs₁ >>= return ∘ f) ++
284
284
(xs₂ >>= return ∘ f)) ≈⟨ >>=-left-distributive fs ⟩
@@ -297,7 +297,7 @@ private
297
297
¬-drop-cons : ∀ {a} {A : Set a} {x : A} →
298
298
¬ (∀ {xs ys} → x ∷ xs ∼[ set ] x ∷ ys → xs ∼[ set ] ys)
299
299
¬-drop-cons {x = x} drop-cons
300
- with FE.Equivalence.to x∼[] ⟨$⟩ here refl
300
+ with FE.Equivalence.to x∼[] ⟨$⟩ here P. refl
301
301
where
302
302
x,x≈x : (x ∷ x ∷ []) ∼[ set ] [ x ]
303
303
x,x≈x = ++-idempotent [ x ]
@@ -336,8 +336,8 @@ drop-cons {A = A} {x} {xs} {ys} x∷xs≈x∷ys =
336
336
(z ≡ x ⊎ z ∈ xs) ↔⟨ K-refl ⊎-cong ∈-index xs ⟩
337
337
(z ≡ x ⊎ ∃ λ i → z ≡ lookup xs i) ↔⟨ SK-sym $ inverse (λ { (zero , p) → inj₁ p; (suc i , p) → inj₂ (i , p) })
338
338
(λ { (inj₁ p) → zero , p; (inj₂ (i , p)) → suc i , p })
339
- (λ { (zero , _) → refl; (suc _ , _) → refl })
340
- (λ { (inj₁ _) → refl; (inj₂ _) → refl }) ⟩
339
+ (λ { (zero , _) → P. refl; (suc _ , _) → P. refl })
340
+ (λ { (inj₁ _) → P. refl; (inj₂ _) → P. refl }) ⟩
341
341
(∃ λ i → z ≡ lookup (x ∷ xs) i) ∎
342
342
where
343
343
open Related.EquationalReasoning
@@ -359,7 +359,7 @@ drop-cons {A = A} {x} {xs} {ys} x∷xs≈x∷ys =
359
359
Fin-length xs =
360
360
(∃ λ z → z ∈ xs) ↔⟨ Σ.cong K-refl (∈-index xs) ⟩
361
361
(∃ λ z → ∃ λ i → z ≡ lookup xs i) ↔⟨ ∃∃↔∃∃ _ ⟩
362
- (∃ λ i → ∃ λ z → z ≡ lookup xs i) ↔⟨ Σ.cong K-refl (inverse _ (λ _ → _ , refl) (λ { (_ , refl) → refl }) (λ _ → refl)) ⟩
362
+ (∃ λ i → ∃ λ z → z ≡ lookup xs i) ↔⟨ Σ.cong K-refl (inverse _ (λ _ → _ , P. refl) (λ { (_ , P. refl) → P. refl }) (const P. refl)) ⟩
363
363
(Fin (length xs) × ⊤) ↔⟨ ×-identityʳ _ _ ⟩
364
364
Fin (length xs) ∎
365
365
where
@@ -410,8 +410,8 @@ drop-cons {A = A} {x} {xs} {ys} x∷xs≈x∷ys =
410
410
(from (Fin-length xs) ⟨$⟩ (to (Fin-length xs) ⟨$⟩ (z , p))))
411
411
lemma z p with to (Fin-length xs) ⟨$⟩ (z , p)
412
412
| left-inverse-of (Fin-length xs) (z , p)
413
- lemma .(lookup xs i) .(from (∈-index xs) ⟨$⟩ (i , refl)) | i | refl =
414
- refl
413
+ lemma .(lookup xs i) .(from (∈-index xs) ⟨$⟩ (i , P. refl)) | i | P. refl =
414
+ P. refl
415
415
416
416
-- Bag equivalence isomorphisms preserve index equality. Note that
417
417
-- this means that, even if the underlying equality is proof
@@ -435,7 +435,7 @@ drop-cons {A = A} {x} {xs} {ys} x∷xs≈x∷ys =
435
435
-- The old inspect idiom.
436
436
437
437
inspect : ∀ {a} {A : Set a} (x : A) → ∃ (x ≡_)
438
- inspect x = x , refl
438
+ inspect x = x , P. refl
439
439
440
440
-- A function is "well-behaved" if any "left" element which is the
441
441
-- image of a "right" element is in turn not mapped to another
@@ -548,7 +548,7 @@ drop-cons {A = A} {x} {xs} {ys} x∷xs≈x∷ys =
548
548
to-from (∼→⊎↔⊎ inv) {x = inj₁ p} hyp₂ ⟩
549
549
index-of {xs = x ∷ xs} (to (∷↔ _) ⟨$⟩ (from (∼→⊎↔⊎ inv) ⟨$⟩ inj₁ q)) ≡⟨ P.cong index-of $
550
550
right-inverse-of (∷↔ _) (from inv ⟨$⟩ here q) ⟩
551
- index-of {xs = x ∷ xs} (to (SK-sym inv) ⟨$⟩ here q) ≡⟨ index-equality-preserved (SK-sym inv) refl ⟩
551
+ index-of {xs = x ∷ xs} (to (SK-sym inv) ⟨$⟩ here q) ≡⟨ index-equality-preserved (SK-sym inv) P. refl ⟩
552
552
index-of {xs = x ∷ xs} (to (SK-sym inv) ⟨$⟩ here p) ≡⟨ P.cong index-of $ P.sym $
553
553
right-inverse-of (∷↔ _) (from inv ⟨$⟩ here p) ⟩
554
554
index-of {xs = x ∷ xs} (to (∷↔ _) ⟨$⟩ (from (∼→⊎↔⊎ inv) ⟨$⟩ inj₁ p)) ≡⟨ P.cong (index-of ∘ (to (∷↔ (_ ≡_)) ⟨$⟩_)) $
@@ -578,23 +578,23 @@ module _ {a} {A : Set a} where
578
578
from xs↭ys = Any-resp-↭ (↭-sym xs↭ys)
579
579
580
580
from∘to : ∀ {xs ys} (p : xs ↭ ys) (q : v ∈ xs) → from p (to p q) ≡ q
581
- from∘to refl v∈xs = refl
582
- from∘to (prep _ _) (here refl) = refl
583
- from∘to (prep _ p) (there v∈xs) = P.cong there (from∘to p v∈xs)
584
- from∘to (swap x y p) (here refl) = refl
585
- from∘to (swap x y p) (there (here refl)) = refl
586
- from∘to (swap x y p) (there (there v∈xs)) = P.cong (there ∘ there) (from∘to p v∈xs)
581
+ from∘to refl v∈xs = P. refl
582
+ from∘to (prep _ _) (here P. refl) = P. refl
583
+ from∘to (prep _ p) (there v∈xs) = P.cong there (from∘to p v∈xs)
584
+ from∘to (swap x y p) (here P. refl) = P. refl
585
+ from∘to (swap x y p) (there (here P. refl)) = P. refl
586
+ from∘to (swap x y p) (there (there v∈xs)) = P.cong (there ∘ there) (from∘to p v∈xs)
587
587
from∘to (trans p₁ p₂) v∈xs
588
588
rewrite from∘to p₂ (Any-resp-↭ p₁ v∈xs)
589
- | from∘to p₁ v∈xs = refl
589
+ | from∘to p₁ v∈xs = P. refl
590
590
591
591
to∘from : ∀ {xs ys} (p : xs ↭ ys) (q : v ∈ ys) → to p (from p q) ≡ q
592
592
to∘from p with from∘to (↭-sym p)
593
593
... | res rewrite ↭-sym-involutive p = res
594
594
595
595
∼bag⇒↭ : _∼[ bag ]_ ⇒ _↭_
596
596
∼bag⇒↭ {[]} eq with empty-unique {A = A} (Inv.sym eq)
597
- ... | refl = refl
597
+ ... | P. refl = refl
598
598
∼bag⇒↭ {x ∷ xs} eq with ∈-∃++ (to ⟨$⟩ (here P.refl))
599
599
where open Inv.Inverse (eq {x})
600
600
... | zs₁ , zs₂ , p rewrite p = begin
0 commit comments