Skip to content

Commit cce0761

Browse files
Merge pull request #459 from agda/indexed-products-more-implicits
Make inferable arguments implicit in Product.Indexed.{commute,unqiue}
2 parents 5331251 + 818edf3 commit cce0761

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

src/Categories/Category/Complete/Properties/Construction.agda

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Categories.Category.Complete.Properties.Construction {o ℓ e} (C : Categ
66

77
open import Level
88
open import Data.Product using (∃₂; _,_; -,_)
9+
open import Function.Base using (_$_)
910

1011
open import Categories.Category.Complete
1112
open import Categories.Diagram.Equalizer C
@@ -60,9 +61,9 @@ module _ (prods : AllProductsOf (o′ ⊔ ℓ′)) (equalizer : ∀ {A B} (f g :
6061
; apex = record
6162
{ ψ = λ X OP.π (lift X) C.∘ eq.arr
6263
; commute = λ {X Y} f begin
63-
F₁ f C.∘ OP.π (lift X) C.∘ eq.arr ≈˘⟨ pushˡ (MP.commute ψ⇒ _)
64+
F₁ f C.∘ OP.π (lift X) C.∘ eq.arr ≈˘⟨ pushˡ MP.commute ⟩
6465
(MP.π (-, -, f) C.∘ ψ) C.∘ eq.arr ≈˘⟨ pushʳ eq.equality ⟩
65-
MP.π (-, -, f) C.∘ ϕ C.∘ eq.arr ≈⟨ pullˡ (MP.commute ϕ⇒ _ )
66+
MP.π (-, -, f) C.∘ ϕ C.∘ eq.arr ≈⟨ pullˡ MP.commute ⟩
6667
OP.π (lift Y) C.∘ eq.arr ∎
6768
}
6869
}
@@ -74,17 +75,17 @@ module _ (prods : AllProductsOf (o′ ⊔ ℓ′)) (equalizer : ∀ {A B} (f g :
7475
K⇒ : K.N C.⇒ src
7576
K⇒ = OP.⟨ (λ j K.ψ (lower j)) ⟩
7677

77-
Keq : (i : ∃₂ J._⇒_) ϕ⇒ i C.∘ K⇒ C.≈ ψ⇒ i C.∘ K⇒
78-
Keq i@(A , B , f) = begin
79-
ϕ⇒ i C.∘ K⇒ ≈⟨ OP.commute _ _
80-
K.ψ B ≈˘⟨ K.commute _ ⟩
81-
F₁ f C.∘ K.ψ A ≈˘⟨ pullʳ (OP.commute _ _)
82-
ψ⇒ i C.∘ K⇒ ∎
78+
Keq : {i : ∃₂ J._⇒_} ϕ⇒ i C.∘ K⇒ C.≈ ψ⇒ i C.∘ K⇒
79+
Keq = begin
80+
_ C.∘ K⇒ ≈⟨ OP.commute ⟩
81+
K.ψ _ ≈˘⟨ K.commute _ ⟩
82+
F₁ _ C.∘ K.ψ _ ≈˘⟨ pullʳ OP.commute ⟩
83+
_ C.∘ K⇒
8384

8485
!-eq : ϕ C.∘ K⇒ C.≈ ψ C.∘ K⇒
8586
!-eq = begin
8687
ϕ C.∘ K⇒ ≈⟨ MP.⟨⟩∘ _ _ ⟩
87-
MP.⟨ (λ i ϕ⇒ i C.∘ K⇒) ⟩ ≈⟨ MP.⟨⟩-cong _ _ Keq ⟩
88+
MP.⟨ (λ i ϕ⇒ i C.∘ K⇒) ⟩ ≈⟨ MP.⟨⟩-cong Keq ⟩
8889
MP.⟨ (λ i ψ⇒ i C.∘ K⇒) ⟩ ≈˘⟨ MP.⟨⟩∘ _ _ ⟩
8990
ψ C.∘ K⇒ ∎
9091

@@ -93,19 +94,19 @@ module _ (prods : AllProductsOf (o′ ⊔ ℓ′)) (equalizer : ∀ {A B} (f g :
9394
{ arr = eq.equalize {h = K⇒} !-eq
9495
; commute = λ {j} begin
9596
(OP.π (lift j) C.∘ eq.arr) C.∘ eq.equalize !-eq ≈˘⟨ pushʳ eq.universal ⟩
96-
OP.π (lift j) C.∘ K⇒ ≈⟨ OP.commute _ _
97+
OP.π (lift j) C.∘ K⇒ ≈⟨ OP.commute ⟩
9798
K.ψ j ∎
9899
}
99100

100101
!-unique : (f : Co.Cones F [ K , ⊤ ]) Co.Cones F [ ! ≈ f ]
101102
!-unique f = ⟺ (eq.unique eq)
102103
where module f = Co.Cone⇒ F f
103104
eq : K⇒ C.≈ eq.arr C.∘ f.arr
104-
eq = OP.unique′ _ _ λ i begin
105-
OP.π i C.∘ K⇒ ≈⟨ OP.commute _ _
106-
K.ψ (lower i) ≈˘⟨ f.commute ⟩
107-
(OP.π i C.∘ eq.arr) C.∘ f.arr ≈⟨ C.assoc ⟩
108-
OP.π i C.∘ eq.arr C.∘ f.arr ∎
105+
eq = OP.unique′ $ begin
106+
OP.π _ C.∘ K⇒ ≈⟨ OP.commute ⟩
107+
K.ψ _ ≈˘⟨ f.commute ⟩
108+
(OP.π _ C.∘ eq.arr) C.∘ f.arr ≈⟨ C.assoc ⟩
109+
OP.π _ C.∘ eq.arr C.∘ f.arr ∎
109110

110111
complete : Limit F
111112
complete = record

src/Categories/Category/Complete/Properties/SolutionSet.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ module _ {C : Category o ℓ e} (Com : Complete (o ⊔ ℓ ⊔ o′) (o ⊔ ℓ
6565

6666
prop : (f : W.X ⇒ W.X) f ∘ equalizer.arr ≈ equalizer.arr
6767
prop f = begin
68-
f ∘ equalizer.arr ≈˘⟨ pullˡ (Warr.commute _ f)
68+
f ∘ equalizer.arr ≈˘⟨ pullˡ Warr.commute ⟩
6969
Warr.π f ∘ Γ ∘ equalizer.arr ≈˘⟨ refl⟩∘⟨ equalizer.equality ⟩
70-
Warr.π f ∘ Δ ∘ equalizer.arr ≈⟨ cancelˡ (Warr.commute _ f)
70+
Warr.π f ∘ Δ ∘ equalizer.arr ≈⟨ cancelˡ Warr.commute ⟩
7171
equalizer.arr ∎
7272

7373
! : A equalizer.obj ⇒ A

src/Categories/Object/Coproduct/Indexed.agda

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ record IndexedCoproductOf {i} {I : Set i} (P : I → Obj) : Set (i ⊔ o ⊔ e
1818
ι : i P i ⇒ X
1919
[_] : {Y} ( i P i ⇒ Y) X ⇒ Y
2020

21-
commute : {Y} (f : i P i ⇒ Y) i [ f ] ∘ ι i ≈ f i
22-
unique : {Y} (h : X ⇒ Y) (f : i P i ⇒ Y) ( i h ∘ ι i ≈ f i) [ f ] ≈ h
21+
commute : {Y} {f : i P i ⇒ Y} {i} [ f ] ∘ ι i ≈ f i
22+
unique : {Y} {h : X ⇒ Y} {f : i P i ⇒ Y} ( {i} h ∘ ι i ≈ f i) [ f ] ≈ h
2323

2424
η : {Y} (h : X ⇒ Y) [ (λ i h ∘ ι i) ] ≈ h
25-
η h = unique _ _ λ _ refl
25+
η h = unique refl
2626

2727
∘[] : {Y Z} (f : i P i ⇒ Y) (g : Y ⇒ Z) g ∘ [ f ] ≈ [ (λ i g ∘ f i) ]
28-
∘[] f g = sym (unique _ _ λ i pullʳ (commute _ _))
28+
∘[] f g = sym (unique (pullʳ commute))
2929

30-
[]-cong : {Y} (f g : i P i ⇒ Y) ( i f i ≈ g i) [ f ] ≈ [ g ]
31-
[]-cong f g eq = unique _ _ λ i trans (commute _ _) (sym (eq i))
30+
[]-cong : {Y} {f g : i P i ⇒ Y} ( {i} f i ≈ g i) [ f ] ≈ [ g ]
31+
[]-cong eq = unique (trans commute (sym eq))
3232

33-
unique′ : {Y} (h h′ : X ⇒ Y) ( i h′ ∘ ι i ≈ h ∘ ι i) h′ ≈ h
34-
unique′ h h′ f = trans (sym (unique _ _ f)) (η _)
33+
unique′ : {Y} {h h′ : X ⇒ Y} ( {i} h′ ∘ ι i ≈ h ∘ ι i) h′ ≈ h
34+
unique′ f = trans (sym (unique f)) (η _)
3535

3636
AllCoproductsOf : i Set (o ⊔ ℓ ⊔ e ⊔ suc i)
3737
AllCoproductsOf i = {I : Set i} (P : I Obj) IndexedCoproductOf P

src/Categories/Object/Product/Indexed.agda

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ record IndexedProductOf {i} {I : Set i} (P : I → Obj) : Set (i ⊔ o ⊔ e ⊔
2222
π : i X ⇒ P i
2323
⟨_⟩ : {Y} ( i Y ⇒ P i) Y ⇒ X
2424

25-
commute : {Y} (f : i Y ⇒ P i) i π i ∘ ⟨ f ⟩ ≈ f i
26-
unique : {Y} (h : Y ⇒ X) (f : i Y ⇒ P i) ( i π i ∘ h ≈ f i) ⟨ f ⟩ ≈ h
25+
commute : {Y} {f : i Y ⇒ P i} {i} π i ∘ ⟨ f ⟩ ≈ f i
26+
unique : {Y} {h : Y ⇒ X} {f : i Y ⇒ P i} ( {i} π i ∘ h ≈ f i) ⟨ f ⟩ ≈ h
2727

2828
η : {Y} (h : Y ⇒ X) ⟨ (λ i π i ∘ h) ⟩ ≈ h
29-
η h = unique _ _ λ _ refl
29+
η h = unique refl
3030

3131
⟨⟩∘ : {Y Z} (f : i Y ⇒ P i) (g : Z ⇒ Y) ⟨ f ⟩ ∘ g ≈ ⟨ (λ i f i ∘ g) ⟩
32-
⟨⟩∘ f g = ⟺ (unique _ _ λ i pullˡ (commute _ _))
32+
⟨⟩∘ f g = ⟺ (unique (pullˡ commute))
3333

34-
⟨⟩-cong : {Y} (f g : i Y ⇒ P i) (eq : i f i ≈ g i) ⟨ f ⟩ ≈ ⟨ g ⟩
35-
⟨⟩-cong f g eq = unique _ _ λ i trans (commute _ _) (⟺ (eq i))
34+
⟨⟩-cong : {Y} {f g : i Y ⇒ P i} (eq : {i} f i ≈ g i) ⟨ f ⟩ ≈ ⟨ g ⟩
35+
⟨⟩-cong eq = unique (trans commute (⟺ eq))
3636

37-
unique′ : {Y} (h h′ : Y ⇒ X) ( i π i ∘ h′ ≈ π i ∘ h) h′ ≈ h
38-
unique′ h h′ f = trans (⟺ (unique _ _ f)) (η _)
37+
unique′ : {Y} {h h′ : Y ⇒ X} ( {i} π i ∘ h′ ≈ π i ∘ h) h′ ≈ h
38+
unique′ f = trans (⟺ (unique f)) (η _)
3939

4040
AllProductsOf : i Set (o ⊔ ℓ ⊔ e ⊔ suc i)
4141
AllProductsOf i = {I : Set i} (P : I Obj) IndexedProductOf P

src/Categories/Object/Product/Indexed/Properties.agda

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ module _ {i} (Com : Complete (i ⊔ o′) (i ⊔ ℓ′) (i ⊔ e′) C) where
4242
{ X = L.apex
4343
; π = λ i L.proj (lift i)
4444
; ⟨_⟩ = λ f L.rep (K f)
45-
; commute = λ f _ Cone⇒.commute (L.rep-cone (K f))
46-
; unique = λ f g eq L.terminal.!-unique {A = K g} record
47-
{ arr = f
48-
; commute = eq _
45+
; commute = Cone⇒.commute (L.rep-cone (K _))
46+
; unique = λ eq L.terminal.!-unique record
47+
{ commute = eq
4948
}
5049
}

0 commit comments

Comments
 (0)