Zulip Chat Archive
Stream: general
Topic: Type constructor for one obj but not the other?
debord (Sep 03 2024 at 22:51):
Hello. Here's the most MWE I can get from the context I'm working in:
import Mathlib.CategoryTheory.Products.Bifunctor
open CategoryTheory
universe vā uā
variable (š : Type uā) [Category.{vā} š]
structure CatObj where
F : šā„¤ š
structure CatHom (F F' : CatObj š) where
Īø : NatTrans F.F F'.F
instance Cat : Category (CatObj š) where
Hom X Y := CatHom š X Y
id := sorry
comp := sorry
id_comp := sorry
comp_id := sorry
assoc := sorry
instance TPObj (F F' : CatObj š) : CatObj š where
F := F'.F ā F.F
instance TPMapTheta (Īø : F ā¶ F') (Īø' : G ā¶ G') : NatTrans (TPObj š F G).F (TPObj š F' G').F where
app A := Īø.Īø.app (G.F.obj A) ā« F'.F.map (Īø'.Īø.app A)
naturality := sorry
instance TPMap (Īø : F ā¶ F') (Īø' : G ā¶ G') : (TPObj š F G) ā¶ (TPObj š F' G') where
Īø := TPMapTheta š Īø Īø'
instance TP : ((CatObj š) Ć (CatObj š)) ℤ (CatObj š) where
obj C := TPObj š C.1 C.2
map F := TPMap š F.1 F.2
map_id X := by
simp
#check (TPMap š (š X.1) (š X.2))
#check š (TPObj š X.1 X.2)
#check (TPMap š (š X.1) (š X.2)).Īø
#check (š (TPObj š X.1 X.2)).Īø
In the proof of map_id
, why exactly is it the case that (TPMap š (š X.1) (š X.2))
and š (TPObj š X.1 X.2)
are both objects of type TPObj š X.1 X.2 ā¶ TPObj š X.1 X.2
, and therefore should have the Īø
constructor from CatHom
, and (TPmap š (š X.1) (š X.2)).Īø
does indeed correctly check to have type NatTrans (TPObj š X.1 X.2).F (TPObj š X.1 X.2).F
, but (š (TPObj š X.1 X.2)).Īø
errors with
invalid field 'Īø', the environment does not contain 'Quiver.Hom.Īø'
š (TPObj š X.1 X.2)
has type
TPObj š X.1 X.2 ā¶ TPObj š X.1 X.2
and
invalid field notation, type is not of the form (C ...) where C is a constant
š (TPObj š X.1 X.2)
has type
CategoryStruct.toQuiver.1 (TPObj š X.1 X.2) (TPObj š X.1 X.2)
They're the same type, so why is the constructor accessible for one but not the other? What is even happening in the second error message, why is it occurring?
Kim Morrison (Sep 04 2024 at 02:54):
Surely
instance TPObj (F F' : CatObj š) : CatObj š where
F := F'.F ā F.F
is wrong. This isn't a class
, so you shouldn't be defining instances of it.
Kim Morrison (Sep 04 2024 at 02:56):
The problem is just that dot notation here doesn't know which structures to looking for the theta field in.
#check CatHom.Īø (š (TPObj š X.1 X.2))
works fine.
debord (Sep 04 2024 at 07:42):
Ah, so it was that simple. Thank you, I managed to prove the theorem now. Thank you also for the tip on the instances, I had them as def at one point but I changed a lot of stuff while just trying things troubleshooting.
Last updated: May 02 2025 at 03:31 UTC