Mercurial > hg > Members > kono > Proof > category
annotate src/S.agda @ 1124:f683d96fbc93 default tip
safe fix done
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 07 Jul 2024 22:28:50 +0900 |
parents | 45de2b31bf02 |
children |
rev | line source |
---|---|
1110
45de2b31bf02
add original library and fix for safe mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
949
diff
changeset
|
1 |
608 | 2 --I'd like to write the Limit in Sets Category using Agda. Assuming local smallness, a functor is a pair of map on Set OC and I, like this. |
3 -- | |
4 -- sobj : OC → Set c₂ | |
5 -- smap : { i j : OC } → (f : I ) → sobj i → sobj j | |
6 -- | |
7 --A cone for the functor is a record with two fields. Using the record, commutativity of the cone and the propertiesy of the Limit | |
8 --are easity shown, except uniquness. The uniquness of the Limit turned out that congruence of the record with two fields. | |
9 -- | |
10 --In the following agda code, I'd like to prove snat-cong lemma. | |
11 | |
1110
45de2b31bf02
add original library and fix for safe mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
949
diff
changeset
|
12 -- {-# OPTIONS --cubical-compatible --safe #-} |
608 | 13 open import Level |
14 module S where | |
15 | |
16 open import Relation.Binary.Core | |
17 open import Function | |
1110
45de2b31bf02
add original library and fix for safe mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
949
diff
changeset
|
18 open import Relation.Binary.PropositionalEquality |
663
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
19 open import Relation.Binary.HeterogeneousEquality using (_≅_;refl) |
608 | 20 |
21 record snat { c₂ } { I OC : Set c₂ } ( sobj : OC → Set c₂ ) | |
22 ( smap : { i j : OC } → (f : I ) → sobj i → sobj j ) : Set c₂ where | |
23 field | |
24 snmap : ( i : OC ) → sobj i | |
25 sncommute : ( i j : OC ) → ( f : I ) → smap f ( snmap i ) ≡ snmap j | |
26 smap0 : { i j : OC } → (f : I ) → sobj i → sobj j | |
27 smap0 {i} {j} f x = smap f x | |
28 | |
29 open snat | |
30 | |
672 | 31 -- snat-cong' : { c : Level } { I OC : Set c } { SObj : OC → Set c } { SMap : { i j : OC } → (f : I )→ SObj i → SObj j } |
32 -- ( s t : snat SObj SMap ) | |
33 -- → ( ( λ i → snmap s i ) ≡ ( λ i → snmap t i ) ) | |
34 -- → ( ( λ i j f → smap0 s f ( snmap s i ) ≡ snmap s j ) ≡ ( ( λ i j f → smap0 t f ( snmap t i ) ≡ snmap t j ) ) ) | |
35 -- → s ≡ t | |
36 -- snat-cong' s t refl refl = {!!} | |
663
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
37 |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
38 snat-cong : {c : Level} |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
39 {I OC : Set c} |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
40 {sobj : OC → Set c} |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
41 {smap : {i j : OC} → (f : I) → sobj i → sobj j} |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
42 → (s t : snat sobj smap) |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
43 → (snmap-≡ : snmap s ≡ snmap t) |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
44 → (sncommute-≅ : sncommute s ≅ sncommute t) |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
45 → s ≡ t |
855e497a9c8f
introducd HeterogeneousEquality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
608
diff
changeset
|
46 snat-cong _ _ refl refl = refl |
608 | 47 |
48 --This is quite simlar to the answer of | |
49 -- | |
50 -- Equality on dependent record types | |
51 -- https://stackoverflow.com/questions/37488098/equality-on-dependent-record-types | |
52 -- | |
53 --So it should work something like | |
54 -- | |
55 -- snat-cong s t refl refl = refl | |
56 -- | |
57 --but it gives an error like this. | |
58 -- | |
59 -- .sncommute i j f != sncommute t i j f of type | |
60 -- .SMap f (snmap t i) ≡ snmap t j | |
61 -- | |
62 --Is there any help? |