@@ -92,32 +92,32 @@ fnoci-invariant x xs n (suc m) (suc i) c (s≤s i≤m)
9292
9393module Preservation (A : 𝔸) where
9494 translate'-preserves-conf : ∀ (x : Forest A) (xs : List (Forest A)) (n : ℕ) (i : ℕ) →
95- configure-all (conf (i + n)) (translate' n x xs ) ≡ VariantList.⟦ x ∷ xs ⟧ i
95+ configure-all (translate' n x xs) (conf (i + n) ) ≡ VariantList.⟦ x ∷ xs ⟧ i
9696 translate'-preserves-conf x [] n i =
9797 begin
98- configure-all (conf (i + n)) (encode-forest x )
98+ configure-all (encode-forest x) ( conf (i + n))
9999 ≡⟨ encode-idemp Forest A encoder (conf (i + n)) x ⟩
100100 x
101101 ≡⟨⟩
102102 VariantList.⟦ x ∷ [] ⟧ i
103103 ∎
104104 translate'-preserves-conf x (y ∷ ys) n zero rewrite ≡ᵇ-refl n =
105105 begin
106- configure-all (conf n) ( encode-forest x) ++ []
106+ configure-all (encode-forest x) (conf n ) ++ []
107107 ≡⟨ ++-identityʳ _ ⟩
108- configure-all (conf n) ( encode-forest x)
108+ configure-all (encode-forest x) (conf n )
109109 ≡⟨ encode-idemp Forest A encoder (conf n) x ⟩
110110 x
111111 ≡⟨⟩
112112 VariantList.⟦ x ∷ y ∷ ys ⟧ zero
113113 ∎
114114 translate'-preserves-conf x (y ∷ ys) n (suc i) rewrite m+n≢ᵇn i n =
115115 begin
116- configure-all (conf (suc i + n)) (translate' (suc n) y ys ) ++ []
116+ configure-all (translate' (suc n) y ys) (conf (suc i + n) ) ++ []
117117 ≡⟨ ++-identityʳ _ ⟩
118- configure-all (conf (suc i + n)) (translate' (suc n) y ys )
119- ≡⟨ cong (λ eq → configure-all (conf eq) ( translate' (suc n) y ys)) (+-suc i n) ⟨
120- configure-all (conf (i + suc n)) (translate' ( suc n) y ys )
118+ configure-all (translate' (suc n) y ys) (conf (suc i + n) )
119+ ≡⟨ cong (λ eq → configure-all (translate' (suc n) y ys) (conf eq )) (+-suc i n) ⟨
120+ configure-all (translate' ( suc n) y ys ) (conf (i + suc n))
121121 ≡⟨ translate'-preserves-conf y ys (suc n) i ⟩
122122 VariantList.⟦ y ∷ ys ⟧ i
123123 ≡⟨⟩
@@ -130,31 +130,31 @@ module Preservation (A : 𝔸) where
130130 begin
131131 VariantList.⟦ x ∷ xs ⟧ i
132132 ≡⟨ translate'-preserves-conf x xs zero i ⟨
133- configure-all (conf (i + zero)) (translate' zero x xs )
134- ≡⟨ cong (λ eq → configure-all (conf eq) ( translate' zero x xs)) (+-identityʳ i) ⟩
135- configure-all (conf i) ( translate' zero x xs)
133+ configure-all (translate' zero x xs) (conf (i + zero) )
134+ ≡⟨ cong (λ eq → configure-all (translate' zero x xs) (conf eq )) (+-identityʳ i) ⟩
135+ configure-all (translate' zero x xs) (conf i )
136136 ≡⟨⟩
137137 ⟦ translate (x ∷ xs) ⟧ (conf i)
138138 ∎
139139
140140 translate'-preserves-fnoc : ∀ (x : Forest A) (xs : List (Forest A)) (n : ℕ) (c : Configuration) →
141- configure-all c (translate' n x xs)
141+ configure-all (translate' n x xs) c
142142 ≡ VariantList.⟦ x ∷ xs ⟧ (fnoci n (List⁺.length (x ∷ xs)) (List⁺.length (x ∷ xs)) c)
143143 translate'-preserves-fnoc x [] n c = encode-idemp Forest A encoder c x
144144 translate'-preserves-fnoc x (y ∷ ys) n c with c n in eq
145145 ... | true rewrite n∸n≡0 (List⁺.length (y ∷ ys)) | +-identityʳ n | eq =
146146 begin
147- configure-all c (encode-forest x) ++ []
147+ configure-all (encode-forest x) c ++ []
148148 ≡⟨ ++-identityʳ _ ⟩
149- configure-all c (encode-forest x)
149+ configure-all (encode-forest x) c
150150 ≡⟨ encode-idemp Forest A encoder c x ⟩
151151 x
152152 ∎
153153 ... | false rewrite n∸n≡0 (List⁺.length (y ∷ ys)) | +-identityʳ n | eq =
154154 begin
155- configure-all c (translate' (suc n) y ys) ++ []
155+ configure-all (translate' (suc n) y ys) c ++ []
156156 ≡⟨ ++-identityʳ _ ⟩
157- configure-all c (translate' (suc n) y ys)
157+ configure-all (translate' (suc n) y ys) c
158158 ≡⟨ translate'-preserves-fnoc y ys (suc n) c ⟩
159159 VariantList.⟦ y ∷ ys ⟧
160160 (fnoci (suc n) (List⁺.length ( y ∷ ys)) (List⁺.length (y ∷ ys)) c)
@@ -169,7 +169,7 @@ module Preservation (A : 𝔸) where
169169 begin
170170 ⟦ translate (x ∷ xs) ⟧ c
171171 ≡⟨⟩
172- configure-all c (translate' zero x xs)
172+ configure-all (translate' zero x xs) c
173173 ≡⟨ translate'-preserves-fnoc x xs zero c ⟩
174174 VariantList.⟦ x ∷ xs ⟧ (fnoc (List⁺.length (x ∷ xs)) c)
175175 ∎
0 commit comments