mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
minor
This commit is contained in:
parent
32e29aedb8
commit
98cdfffdb9
2 changed files with 14 additions and 18 deletions
|
@ -44,7 +44,7 @@ module _ (A : Set c) where
|
||||||
later : Delay′ → Delay
|
later : Delay′ → Delay
|
||||||
record Delay′ : Set c where
|
record Delay′ : Set c where
|
||||||
coinductive
|
coinductive
|
||||||
constructor dela
|
constructor delay
|
||||||
field force : Delay
|
field force : Delay
|
||||||
open Delay′ public
|
open Delay′ public
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ Now we show that `iter` defines an Elgot algebra structure on `Delay≈`
|
||||||
iter≈-fixpoint : ∀ {A X : Setoid ℓ ℓ} {f : X ⟶ (Delay≈.₀ A ⊎ₛ X)} {x : ∣ X ∣} → [ A ][ iter {A} {X} < f > x ≈ [ Function.id , iter {A} {X} < f > ] (f ⟨$⟩ x) ]
|
iter≈-fixpoint : ∀ {A X : Setoid ℓ ℓ} {f : X ⟶ (Delay≈.₀ A ⊎ₛ X)} {x : ∣ X ∣} → [ A ][ iter {A} {X} < f > x ≈ [ Function.id , iter {A} {X} < f > ] (f ⟨$⟩ x) ]
|
||||||
iter≈-fixpoint {A} {X} {f} {x} with < f > x in eqx
|
iter≈-fixpoint {A} {X} {f} {x} with < f > x in eqx
|
||||||
... | inj₁ a = ≈-refl A
|
... | inj₁ a = ≈-refl A
|
||||||
... | inj₂ a = ≈-trans A (≈-sym A later-self) (≈-refl A)
|
... | inj₂ a = ≈-sym A later-self
|
||||||
|
|
||||||
-- iter satisfies the uniformity law
|
-- iter satisfies the uniformity law
|
||||||
iter-uni : ∀ {A X Y : Setoid ℓ ℓ} {f : X ⟶ (Delay≈.₀ A ⊎ₛ X)} {g : Y ⟶ (Delay≈.₀ A ⊎ₛ Y)} {h : X ⟶ Y}
|
iter-uni : ∀ {A X Y : Setoid ℓ ℓ} {f : X ⟶ (Delay≈.₀ A ⊎ₛ X)} {g : Y ⟶ (Delay≈.₀ A ⊎ₛ Y)} {h : X ⟶ Y}
|
||||||
|
@ -335,24 +335,20 @@ Now we show that helper # is iteration preserving:
|
||||||
preserves' {X} {g} {x} = ≡-trans ⟦ B ⟧ step₁ step₂
|
preserves' {X} {g} {x} = ≡-trans ⟦ B ⟧ step₁ step₂
|
||||||
where
|
where
|
||||||
step₁ : [ ⟦ B ⟧ ][ (delay-lift≈ ∘ (iter≈ {A} {X} g)) ⟨$⟩ x ≡ ([ inj₁ₛ ∘ (helper #) , inj₂ₛ ]ₛ ∘ (disc-dom g)) # ⟨$⟩ x ]
|
step₁ : [ ⟦ B ⟧ ][ (delay-lift≈ ∘ (iter≈ {A} {X} g)) ⟨$⟩ x ≡ ([ inj₁ₛ ∘ (helper #) , inj₂ₛ ]ₛ ∘ (disc-dom g)) # ⟨$⟩ x ]
|
||||||
step₁ = ≡-trans ⟦ B ⟧ (≡-trans ⟦ B ⟧ (cong (helper #) (iter-g-var g)) (sub-step₁ (disc-dom g) {inj₂ x})) (≡-sym ⟦ B ⟧ (#-Compositionality B {f = helper} {h = disc-dom g}))
|
step₁ = ≡-trans ⟦ B ⟧ (≡-trans ⟦ B ⟧ (cong (helper #) (iter-g-var g)) (≡-sym ⟦ B ⟧ (#-Uniformity B {h = [ idₛ (Delay∼.₀ A) , iter∼ (disc-dom g) ]ₛ} (λ {y} → by-uni {y})))) (≡-sym ⟦ B ⟧ (#-Compositionality B {f = helper} {h = disc-dom g}))
|
||||||
where
|
where
|
||||||
sub-step₁ : (g : ‖ X ‖ ⟶ ((Delay∼.₀ A) ⊎ₛ ‖ X ‖)) → ∀ {x} → [ ⟦ B ⟧ ][ ((helper #) ∘ [ idₛ (Delay∼.₀ A) , iter∼ g ]ₛ) ⟨$⟩ x
|
by-uni : ∀ {x} → [ ⟦ B ⟧ ⊎ₛ (Delay∼.₀ A) ][ [ inj₁ₛ , inj₂ₛ ∘ [ idₛ (Delay∼.₀ A) , iter∼ (disc-dom g) ]ₛ ]ₛ ∘ [ [ inj₁ₛ , inj₂ₛ ∘ inj₁ₛ ]ₛ ∘ helper , inj₂ₛ ∘ inj₂ₛ ]ₛ ∘ [ inj₁ₛ , (disc-dom g) ]ₛ ⟨$⟩ x ≡ (helper ∘ [ idₛ (Delay∼.₀ A) , iter∼ (disc-dom g) ]ₛ) ⟨$⟩ x ]
|
||||||
≡ ([ [ inj₁ₛ , inj₂ₛ ∘ inj₁ₛ ]ₛ ∘ helper , inj₂ₛ ∘ inj₂ₛ ]ₛ ∘ [ inj₁ₛ , g ]ₛ) # ⟨$⟩ x ]
|
by-uni {inj₁ (now a)} = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
||||||
sub-step₁ g {u} = ≡-sym ⟦ B ⟧ (#-Uniformity B {h = [ idₛ (Delay∼.₀ A) , iter∼ g ]ₛ} (λ {y} → last-step {y}))
|
by-uni {inj₁ (later a)} = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
||||||
where
|
by-uni {inj₂ a} with (disc-dom g) ⟨$⟩ a in eqb
|
||||||
last-step : ∀ {x} → [ ⟦ B ⟧ ⊎ₛ (Delay∼.₀ A) ][ [ inj₁ₛ , inj₂ₛ ∘ [ idₛ (Delay∼.₀ A) , iter∼ g ]ₛ ]ₛ ∘ [ [ inj₁ₛ , inj₂ₛ ∘ inj₁ₛ ]ₛ ∘ helper , inj₂ₛ ∘ inj₂ₛ ]ₛ ∘ [ inj₁ₛ , g ]ₛ ⟨$⟩ x ≡ (helper ∘ [ idₛ (Delay∼.₀ A) , iter∼ g ]ₛ) ⟨$⟩ x ]
|
|
||||||
last-step {inj₁ (now a)} = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
|
||||||
last-step {inj₁ (later a)} = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
|
||||||
last-step {inj₂ a} with g ⟨$⟩ a in eqb
|
|
||||||
... | inj₁ (now b) = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
... | inj₁ (now b) = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
||||||
... | inj₁ (later b) = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
... | inj₁ (later b) = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
||||||
... | inj₂ b = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
... | inj₂ b = ≡-refl (⟦ B ⟧ ⊎ₛ (Delay∼.₀ A))
|
||||||
step₂ : [ ⟦ B ⟧ ][ ([ inj₁ₛ ∘ (helper #) , inj₂ₛ ]ₛ ∘ (disc-dom g)) # ⟨$⟩ x ≡ ([ inj₁ₛ ∘ delay-lift≈ , inj₂ₛ ]ₛ ∘ g) # ⟨$⟩ x ]
|
step₂ : [ ⟦ B ⟧ ][ ([ inj₁ₛ ∘ (helper #) , inj₂ₛ ]ₛ ∘ (disc-dom g)) # ⟨$⟩ x ≡ ([ inj₁ₛ ∘ delay-lift≈ , inj₂ₛ ]ₛ ∘ g) # ⟨$⟩ x ]
|
||||||
step₂ = #-Uniformity B {h = ‖‖-quote} sub-step₂
|
step₂ = #-Uniformity B {h = ‖‖-quote} by-uni
|
||||||
where
|
where
|
||||||
sub-step₂ : ∀ {x} → [ ⟦ B ⟧ ⊎ₛ X ][([ inj₁ₛ , inj₂ₛ ]ₛ ∘ ([ inj₁ₛ ∘ (helper #) , inj₂ₛ ]ₛ ∘ (disc-dom g))) ⟨$⟩ x ≡ ([ inj₁ₛ ∘ delay-lift≈ , inj₂ₛ ]ₛ ∘ g) ⟨$⟩ x ]
|
by-uni : ∀ {x} → [ ⟦ B ⟧ ⊎ₛ X ][([ inj₁ₛ , inj₂ₛ ]ₛ ∘ ([ inj₁ₛ ∘ (helper #) , inj₂ₛ ]ₛ ∘ (disc-dom g))) ⟨$⟩ x ≡ ([ inj₁ₛ ∘ delay-lift≈ , inj₂ₛ ]ₛ ∘ g) ⟨$⟩ x ]
|
||||||
sub-step₂ {x} with g ⟨$⟩ x
|
by-uni {x} with g ⟨$⟩ x
|
||||||
... | inj₁ y = ≡-refl (⟦ B ⟧ ⊎ₛ X)
|
... | inj₁ y = ≡-refl (⟦ B ⟧ ⊎ₛ X)
|
||||||
... | inj₂ y = ≡-refl (⟦ B ⟧ ⊎ₛ X)
|
... | inj₂ y = ≡-refl (⟦ B ⟧ ⊎ₛ X)
|
||||||
open Elgot-Algebra-Morphism using (preserves) renaming (h to <<_>>)
|
open Elgot-Algebra-Morphism using (preserves) renaming (h to <<_>>)
|
||||||
|
|
Loading…
Reference in a new issue