@@ -26,7 +26,7 @@ open import Data.Vec.Properties using (lookup-map)
2626open import Data.Vec.Relation.Binary.Pointwise.Extensional as PW
2727 using (Pointwise; ext)
2828open import Function.Base using (_∘_; _$_; flip)
29- open import Relation.Binary.PropositionalEquality as P using (_≗_)
29+ open import Relation.Binary.PropositionalEquality as ≡ using (_≗_)
3030import Relation.Binary.Reflection as Reflection
3131
3232-- Expressions made up of variables and the operations of a boolean
@@ -68,7 +68,7 @@ module Naturality
6868 (f : Applicative.Morphism A₁ A₂)
6969 where
7070
71- open P .≡-Reasoning
71+ open ≡ .≡-Reasoning
7272 open Applicative.Morphism f
7373 open Semantics A₁ renaming (⟦_⟧ to ⟦_⟧₁)
7474 open Semantics A₂ renaming (⟦_⟧ to ⟦_⟧₂)
@@ -77,21 +77,21 @@ module Naturality
7777
7878 natural : ∀ {n} (e : Expr n) → op ∘ ⟦ e ⟧₁ ≗ ⟦ e ⟧₂ ∘ Vec.map op
7979 natural (var x) ρ = begin
80- op (Vec.lookup ρ x) ≡⟨ P .sym $ lookup-map x op ρ ⟩
80+ op (Vec.lookup ρ x) ≡⟨ ≡ .sym $ lookup-map x op ρ ⟩
8181 Vec.lookup (Vec.map op ρ) x ∎
8282 natural (e₁ or e₂) ρ = begin
8383 op (_∨_ <$>₁ ⟦ e₁ ⟧₁ ρ ⊛₁ ⟦ e₂ ⟧₁ ρ) ≡⟨ op-⊛ _ _ ⟩
84- op (_∨_ <$>₁ ⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ P .cong₂ _⊛₂_ (op-<$> _ _) P .refl ⟩
85- _∨_ <$>₂ op (⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ P .cong₂ (λ e₁ e₂ → _∨_ <$>₂ e₁ ⊛₂ e₂) (natural e₁ ρ) (natural e₂ ρ) ⟩
84+ op (_∨_ <$>₁ ⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ ≡ .cong₂ _⊛₂_ (op-<$> _ _) ≡ .refl ⟩
85+ _∨_ <$>₂ op (⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ ≡ .cong₂ (λ e₁ e₂ → _∨_ <$>₂ e₁ ⊛₂ e₂) (natural e₁ ρ) (natural e₂ ρ) ⟩
8686 _∨_ <$>₂ ⟦ e₁ ⟧₂ (Vec.map op ρ) ⊛₂ ⟦ e₂ ⟧₂ (Vec.map op ρ) ∎
8787 natural (e₁ and e₂) ρ = begin
8888 op (_∧_ <$>₁ ⟦ e₁ ⟧₁ ρ ⊛₁ ⟦ e₂ ⟧₁ ρ) ≡⟨ op-⊛ _ _ ⟩
89- op (_∧_ <$>₁ ⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ P .cong₂ _⊛₂_ (op-<$> _ _) P .refl ⟩
90- _∧_ <$>₂ op (⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ P .cong₂ (λ e₁ e₂ → _∧_ <$>₂ e₁ ⊛₂ e₂) (natural e₁ ρ) (natural e₂ ρ) ⟩
89+ op (_∧_ <$>₁ ⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ ≡ .cong₂ _⊛₂_ (op-<$> _ _) ≡ .refl ⟩
90+ _∧_ <$>₂ op (⟦ e₁ ⟧₁ ρ) ⊛₂ op (⟦ e₂ ⟧₁ ρ) ≡⟨ ≡ .cong₂ (λ e₁ e₂ → _∧_ <$>₂ e₁ ⊛₂ e₂) (natural e₁ ρ) (natural e₂ ρ) ⟩
9191 _∧_ <$>₂ ⟦ e₁ ⟧₂ (Vec.map op ρ) ⊛₂ ⟦ e₂ ⟧₂ (Vec.map op ρ) ∎
9292 natural (not e) ρ = begin
9393 op (¬_ <$>₁ ⟦ e ⟧₁ ρ) ≡⟨ op-<$> _ _ ⟩
94- ¬_ <$>₂ op (⟦ e ⟧₁ ρ) ≡⟨ P .cong (¬_ <$>₂_) (natural e ρ) ⟩
94+ ¬_ <$>₂ op (⟦ e ⟧₁ ρ) ≡⟨ ≡ .cong (¬_ <$>₂_) (natural e ρ) ⟩
9595 ¬_ <$>₂ ⟦ e ⟧₂ (Vec.map op ρ) ∎
9696 natural top ρ = begin
9797 op (pure₁ ⊤) ≡⟨ op-pure _ ⟩
0 commit comments