Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right adjoint to Functor.Slice.Free #408

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Right adjoint to Functor.Slice.Free #408

wants to merge 8 commits into from

Conversation

Taneb
Copy link
Member

@Taneb Taneb commented Jan 10, 2024

Supercedes #370

I started over with a better understanding of the problem space, on top of the cleaned up version of the module. Also, I'm making this branch in the agda repo rather than my own fork so it's easier for other contributors to make commits.

  • Functor
  • Adjoint
  • Corresponding functor and adjoint for base changes

Even with what I have so far there's a lot of potential for simplifying the proofs.

An insight I've had is that the proof passed in to universal constructions (and other ways to construct a morphism or object from a proof) should generally be abstract. for compilation times. Other proofs don't matter nearly as much in this respect. This is because we generally have many many copies of the morphism term in other terms and types.

@Taneb
Copy link
Member Author

Taneb commented Jan 10, 2024

This isn't complete but it's at a point where I'd like some other eyes on it if anyone wants to take a look

Copy link
Collaborator

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking really good. Tiny tweaks to do in one spot, otherwise, it's just comments.

Free⊣Coforgetful = record
{ unit = ntHelper record
{ η = λ X → p.universal (sliceobj π₁) (λ-unique₂′ (unit-pb X))
; commute = λ {S} {T} f → p.unique-diagram (sliceobj π₁) !-unique₂ $ begin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these longer proofs, best to put them either in where or named in a private block. Purely for efficiency.

λg ((eval′ ∘ first (p.p₂ X) ∘ swap) ∘ eval′) ∘ p.p₂ (sliceobj π₁) ∘ p.universal (sliceobj π₁) _ ≈⟨ refl⟩∘⟨ p.p₂∘universal≈h₂ (sliceobj π₁) ⟩
λg ((eval′ ∘ first (p.p₂ X) ∘ swap) ∘ eval′) ∘ λg swap ≈⟨ subst ⟩
λg (((eval′ ∘ first (p.p₂ X) ∘ swap) ∘ eval′) ∘ first (λg swap)) ≈⟨ λ-cong (pullʳ β′) ⟩
λg ((eval′ ∘ first (p.p₂ X) ∘ swap) ∘ swap) ≈⟨ λ-cong (pull-last swap∘swap) ⟩
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cancel-r ?

open Terminal terminal
open BinaryProducts products

-- Needs better name!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does. Ask on the category theory Zulip? It feels like it ought to have a name. (Does the 1lab have this yet?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1lab calls this functor exponentiable→product, and what we call Free they call constant-family. I can't see a counterpart to our Forgetful but I've asked in their Discord.

I would like to, following Polynomial Functors and Polynomial Monads (the paper I'm slowly working towards formalize here), call Forgetful Σ, Free Δ, and Coforgetful Π, but those names are even less indicative of their function than what we currently have. Aspects of Topoi uses the same names for Forgetful and Coforgetful, but calls Free ×.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, those single-letter names are even worse. The 1lab's names don't seem so bad?

I could try to summon @TOTBWF to see if he has opinions.

Copy link
Collaborator

@TOTBWF TOTBWF Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been SUMMONED ✨🧊 🧙✨

To get a good idea for names, it's good to understand exactly what is going on with slices. The intuition here is that a slice f : X -> I is how we can encode an I-indexed family of objects X_i without any sort of classifying object like Type. In places like Set, we can move between the two by taking the fibres of f and by forming the total space π₁ : Σ[ i ∈ I ] (P i) → I, but in a general category we cannot do this, so slices it is.

As such, base change pullback-functorial should really be thought of as a functor on slices C/B -> C/A for a morphism A -> B: from the perspective of families, this restricts a family f : X -> B to a new family P -> A along f potentially duplicating or deleting fibres. In other words, we take the fibre product: IE, the pullback. By composing with the projection out of the slice, we've essentially "forgotten" the indexing, and are just looking at the total space of the reindexed family.

From this perspective, Free isn't really the free slice, but rather the constant family on I: each fibre over is a copy of X. Furthermore, Forgetful doesn't really "forget" a slice: it returns the total space of a family by discarding the indexing.

Coforgetful is the trickiest: the bottom leg of the pullback is an obfuscation of the identity morphism, and the right leg is more or less postcomposition by the projection out of the family X -> I. Therefore, this pullback consists of sections of the family X -> I internalized as a exponential objects.

With all that background out of the way, here are my suggestions:

  • Make pullback-functorial a functor on slices, and rename it to Base-change or Reindex
  • Free becomes Constant-family
  • Forgteful becomes Total-space or Total
  • Coforgetful becomes Internal-sections or Sections

PS: this is some really great work!

Copy link
Member Author

@Taneb Taneb Jan 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these names a lot! Thanks for the explanation.

While switching to them, I noticed that pullback-functorial (after @TOTBWF's suggestion to make it less forgetful) looks a lot like Categories.Functor.Slice.BaseChange.BaseChange*. I haven't quite been able to convince myself that they are the same thing, because there's a lot of redirection and it's a little confusing to get my head around, but if they are, I'd like to remove pullback-functorial entirely.

EDIT: I was able to write a NaturalIsomorphism between the two where almost everything was trivial (one use of universal-resp-≈ was necessary for commute), so I went ahead and deleted what was once pullback-functorial

I also fiddled with pbarr a bit to make its equality argument abstract
It was pretty much exactly the same as Functor.Slice.BaseChange.BaseChange*
@Taneb
Copy link
Member Author

Taneb commented Jan 27, 2024

Looks like I've broken Categories.Category.CartesianClosed.Locally.Properties, a module which I had honestly forgotten about, but I think I should be able to entirely replace that with Categories.Functor.Slice.BaseChange, with an actual proof of adjointness soon. It's making me wonder if there's a simpler implementation of InternalSections, though

Copy link
Collaborator

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really nice!

@Taneb
Copy link
Member Author

Taneb commented May 15, 2024

I'd like to finish this off... but I've gotten lost with what was going on with it :(

@JacquesCarette
Copy link
Collaborator

Anything I could do to help?

@Taneb
Copy link
Member Author

Taneb commented May 15, 2024

Remaining considerations:

  • Define the next base change functor (composition of slice⇒slice-slice and InternalSections)
  • Define the base change adunction
  • Can the proofs be simplified? They're huge and scary
  • Can the environment of InternalSections be simplified? We don't need all products
  • Is BaseChange⁎ in Categories.Category.CartesianClosed.Locally the same thing as what we're defining in this PR? Is it a viable way to simplify the definitions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants