Mercurial > hg > Members > kono > Proof > category
annotate deductive.agda @ 829:6c5cfb9b333e
fix deduction theorem
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 13 Jul 2019 00:18:17 +0900 |
parents | 82a8c1ab4ef5 |
children | 232cea484067 |
rev | line source |
---|---|
792
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
1 open import Level |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
2 open import Category |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
3 module deductive {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) where |
791 | 4 |
5 -- Deduction Theorem | |
6 | |
792
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
7 -- positive logic |
791 | 8 |
792
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
9 record PositiveLogic {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) : Set ( c₁ ⊔ c₂ ⊔ ℓ ) where |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
10 field |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
11 ⊤ : Obj A |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
12 ○ : (a : Obj A ) → Hom A a ⊤ |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
13 _∧_ : Obj A → Obj A → Obj A |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
14 <_,_> : {a b c : Obj A } → Hom A c a → Hom A c b → Hom A c (a ∧ b) |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
15 π : {a b : Obj A } → Hom A (a ∧ b) a |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
16 π' : {a b : Obj A } → Hom A (a ∧ b) b |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
17 _<=_ : (a b : Obj A ) → Obj A |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
18 _* : {a b c : Obj A } → Hom A (a ∧ b) c → Hom A a (c <= b) |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
19 ε : {a b : Obj A } → Hom A ((a <= b ) ∧ b) a |
5bee48f7c126
deduction theorem using category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
791
diff
changeset
|
20 |
791 | 21 |
798 | 22 module deduction-theorem ( L : PositiveLogic A ) where |
791 | 23 |
798 | 24 open PositiveLogic L |
25 _・_ = _[_o_] A | |
26 | |
27 -- every proof b → c with assumption a has following forms | |
28 | |
29 data φ {a : Obj A } ( x : Hom A ⊤ a ) : {b c : Obj A } → Hom A b c → Set ( c₁ ⊔ c₂ ) where | |
829 | 30 i : {b c : Obj A} {k : Hom A b c } → φ x k |
31 ii : φ x {⊤} {a} x | |
798 | 32 iii : {b c' c'' : Obj A } { f : Hom A b c' } { g : Hom A b c'' } (ψ : φ x f ) (χ : φ x g ) → φ x {b} {c' ∧ c''} < f , g > |
829 | 33 iv : {b c d : Obj A } { f : Hom A d c } { g : Hom A b d } (ψ : φ x f ) (χ : φ x g ) → φ x ( f ・ g ) |
34 v : {b c' c'' : Obj A } { f : Hom A (b ∧ c') c'' } (ψ : φ x f ) → φ x {b} {c'' <= c'} ( f * ) | |
798 | 35 |
36 α : {a b c : Obj A } → Hom A (( a ∧ b ) ∧ c ) ( a ∧ ( b ∧ c ) ) | |
37 α = < π ・ π , < π' ・ π , π' > > | |
38 | |
39 -- genetate (a ∧ b) → c proof from proof b → c with assumption a | |
40 | |
829 | 41 k : {a b c : Obj A } → ( x∈a : Hom A ⊤ a ) → {z : Hom A b c } → ( y : φ {a} x∈a z ) → Hom A (a ∧ b) c |
42 k x∈a {k} i = k ・ π' | |
43 k x∈a ii = π | |
44 k x∈a (iii ψ χ ) = < k x∈a ψ , k x∈a χ > | |
45 k x∈a (iv ψ χ ) = k x∈a ψ ・ < π , k x∈a χ > | |
46 k x∈a (v ψ ) = ( k x∈a ψ ・ α ) * |