-
Notifications
You must be signed in to change notification settings - Fork 273
Expand file tree
/
Copy pathFusion-Logic.agda
More file actions
62 lines (53 loc) · 2.12 KB
/
Copy pathFusion-Logic.agda
File metadata and controls
62 lines (53 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
----------------------------------------------------------------------------
-- The Agda standard library
--
-- Logic with 'fusion' connective + related proof
----------------------------------------------------------------------------
{-# OPTIONS --cubical-compatible --safe #-}
module Logic.Connectives.Fusion-Logic where
open import Logic.Logic
open import Data.Product using (_×_; proj₁; proj₂) renaming (_,_ to ⟨_,_⟩)
record Fusion-Logic
{Lang : Set} {Struct : Set} (S : Lang → Struct)
(_⊢_ : Struct → Lang → Set)
(C⟨_⟩ : Struct → Struct)
(_⨾_ : Struct → Struct → Struct)
(_⇒_ _∘_ : Lang → Lang → Lang) : Set where
field
is-logic : Logic S _⊢_ C⟨_⟩ _⨾_ _⇒_
fusion-introduction :
∀ {X Y : Struct} {A B : Lang} →
X ⊢ A → Y ⊢ B →
-------------------
(X ⨾ Y) ⊢ (A ∘ B)
fusion-elimination :
∀ {X : Struct} {A B C : Lang} →
X ⊢ (A ∘ B) →
------------------------------------------
C⟨ (S A) ⨾ (S B) ⟩ ⊢ C → C⟨ X ⟩ ⊢ C
-- Lemma 2.25 (Uniqueness of fusion)
fusion-unique :
∀ (Lang : Set) (Struct : Set) (S : Lang → Struct)
(_⊢_ : Struct → Lang → Set)
(C⟨_⟩ : Struct → Struct)
(_⨾_ : Struct → Struct → Struct)
(_⇒_ _∘₁_ _∘₂_ : Lang → Lang → Lang) →
Fusion-Logic S _⊢_ C⟨_⟩ _⨾_ _⇒_ _∘₁_ →
Fusion-Logic S _⊢_ C⟨_⟩ _⨾_ _⇒_ _∘₂_ →
∀ {A B : Lang} →
---------------------------------------------------------
(S (A ∘₁ B)) ⊢ (A ∘₂ B) × (S (A ∘₂ B)) ⊢ (A ∘₁ B)
fusion-unique Lang Struct S _⊢_ C⟨_⟩ _⨾_ _⇒_ _∘₁_ _∘₂_ x y =
⟨ Logic.context z
(Fusion-Logic.fusion-elimination x (Logic.hypothesis w))
(Fusion-Logic.fusion-introduction y
(Logic.hypothesis w)
(Logic.hypothesis w)) ,
Logic.context w
(Fusion-Logic.fusion-elimination y (Logic.hypothesis z))
(Fusion-Logic.fusion-introduction x
(Logic.hypothesis z)
(Logic.hypothesis z)) ⟩
where
z = Fusion-Logic.is-logic x
w = Fusion-Logic.is-logic y