Skip to content

Conversation

@AextraT
Copy link

@AextraT AextraT commented Jul 18, 2025

M Types in the case of Sets

klinashka and others added 5 commits July 17, 2025 10:19
Added :
- ComputationalMWithSets (WIP)
- SetBasedPolynomialFunctors
- Set truncation in MoreFoundations/Sets
New :
- "Equivalence" between being a final coalgebra in UU and in HSET.
- Proof that polynomial functors in sets are omega-continuous.
  The two first Lemmas of OmegeContPolynomialFunctors.v probably should be moved elsewhere.
- Proof that when the polynomial functor is defined with sets, all final coalgebras are sets
  and construction of such coalgebras using CoAdamek.
- Refinement of ComputationalM in the case of sets.
- Exemple of potentially infinite boolean trees labeled with booleans.
the crucial element is the total rewrite of the proof of Lemma P_isaprop
but there are many more changes described in the header info of the file
…gested by Niels)

The description of the previous commit should contain the following changes (that are now no longer in the header of the file):
- clearer mathematical display of what the refinement brings w.r.t. the supposed final coalgebra
- computable elements are now called purely coiterative elements, and their property is isolated
- more typing information given
- better use of documentation facilities
- new lemma destrM'_aux to encapsulate the equational part of destrM'
- more readable proof of eq_corecM0
Copy link
Owner

@rmatthes rmatthes left a comment

Choose a reason for hiding this comment

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

only on omega-continuity

@@ -0,0 +1,291 @@
(** ** Polynomial Functors are omega-continuous

Copy link
Owner

Choose a reason for hiding this comment

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

I would add "set-based" somewhere.


Context {A : ob HSET} (B : pr1hSet A → ob HSET).

Definition F' := MWithSets.F' B.
Copy link
Owner

Choose a reason for hiding this comment

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

This would be better a local definition - the name is just too short for the global name space.

This for all names that are not telling at all out of context.

apply (maponpaths (λ z, pr1 z) (pr2 (c_limcone cx ccx) (f'2,, f'2_cone_mor))).
Defined.

Lemma F'_omega_cont : is_omega_cont F'.
Copy link
Owner

Choose a reason for hiding this comment

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

This should now have a name for the outside world.

apply homotrefl.
Qed.

Lemma rev_proof {X : UU} {x y : X} (q : x = y) : y = x.
Copy link
Owner

Choose a reason for hiding this comment

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

this is in the library as pathsinv0, please use that one

Copy link
Owner

@rmatthes rmatthes left a comment

Choose a reason for hiding this comment

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

various comments on different files

apply homotfun.
induction p.
apply homotrefl.
Qed.
Copy link
Owner

Choose a reason for hiding this comment

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

I now this should be ended by Defined.

exact (limCoAlgTerminal SET_terminal (F'_omega_cont B) (LimConeHSET _ (termCochain SET_terminal (OmegaContPolynomialFunctors.F' B)))).
Defined.

Lemma F'CoalgAreSets (C : coalgebra F) (C_isfinal : is_final C) : isaset (pr1 C).
Copy link
Owner

Choose a reason for hiding this comment

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

Why F' in the name?


Local Definition F := MWithSets.F B.

Lemma SET_terminal : Terminal SET.
Copy link
Owner

Choose a reason for hiding this comment

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

This already exists as TerminalHSET in UniMath.CategoryTheory.Categories.HSET.Limits. Please replace.

@@ -0,0 +1,62 @@
(** ** Refinement of M-Types in the case of sets

Copy link
Owner

Choose a reason for hiding this comment

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

It should say more what is done in this file. It starts set-based just assuming a final coalgebra there and still uses ComputationalM to get the computation rule.

apply (isaset_total2_hSet c0' (λ m0, hProp_to_hSet (∃ (C : coalgebra F) (c : coalgebra_ob F C), (pr11 (finalC0 C)) c = m0))).
Defined.

Local Definition C' := MWithSets.C0' B C c_isaset.
Copy link
Owner

Choose a reason for hiding this comment

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

In this part, I think there should be much more type info - so that one can relate all these items and see where the good rule is obtained.

rmatthes added 2 commits July 18, 2025 13:16
this reverts the move from precategories to categories as parameters of adjunctions
the change is limited to replacement of category by precategory, no further adaptations are made
hence, it is the notion of adjunction that becomes again available for precategories, not the results
the motivation is the construction of an adjunction in the analysis of coalgebras for polynomial functors (endofunctors on type_precat that notoriously does not have homsets)
@@ -0,0 +1,124 @@
(** ** Exemple of construction of M Types using ComputationalMWithSets
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
(** ** Exemple of construction of M Types using ComputationalMWithSets
(** ** Example of construction of M Types using ComputationalMWithSets

Local Definition F := MWithSets.F B.
Local Definition F' := MWithSets.F' B.

(* The final coalgebra obtained corresponds to the type of possibly infinite binary trees labeled with booleands. *)
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
(* The final coalgebra obtained corresponds to the type of possibly infinite binary trees labeled with booleands. *)
(* The final coalgebra obtained corresponds to the type of possibly infinite binary trees labeled with booleans. *)

Local Definition C'1 := ComputationalMWithSets.C' B C' C'_isfinal.
Local Definition C'1_isfinal : isTerminal (CoAlg_category F') C'1 := ComputationalMWithSets.finalC' B C' C'_isfinal.
Local Definition corec_C1 := ComputationalMWithSets.corecC B C' C'_isfinal.
Local Definition c1 := pr11 C'1.
Copy link
Owner

Choose a reason for hiding this comment

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

Also in this part, I would hope for some more types.


Lemma Get_list_at_depth (t : c1) (depth : nat) : list bool.
Proof.
assert (l : list c1). (* List of subtrees at given depth *)
Copy link
Owner

Choose a reason for hiding this comment

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

In the time of the UniMath schools, this assert would not have worked because that list would not have been available in the sequel. The way out was transparent assert. Rocq has moved on...

AextraT and others added 5 commits July 18, 2025 15:50
Added the adjunction in MWithSets
This PR contains material about the Rezk completion.
More precisely, it is proven that the universal arrows/left adjoint
given by the Rezk completion lifts to
(a) pretopoi
(b) elementary topoi
(c) finite colimits

The material for result (b) was already in UniMath, with the exception
of the definition of the bicategory of elementary topoi.
Result (c) was also already in UniMath, with the exceptions of the
statement "if F : C -> D a weak equivalence, and C is closed under
colimits of a diagram, then D is also closed under that diagram" and the
bicategorical statement.
Results (a) and (b) have been extended to include natural numbers
objects.
To prove result (a), the Rezk completion for extensive categories
remained to be done.

Edit: The material about extensiveness and pretopoi has now been
removed.

---------

Co-authored-by: kfwullaert <kwullaer@hotmail.com>
Co-authored-by: Niels van der Weide <nmvdw@proton.me>
Co-authored-by: Niels van der Weide <nnmvdw@gmail.com>
@rmatthes
Copy link
Owner

I comment on the adjunction part: what is the advantage of having the dedicated file FunctorCoalgebras_legacy_alt_HSET.v ? Of course, this is then in parallel with the UU version. But the notion of morphism is not essentially changed w.r.t. FunctorCoalgebras.CoAlg_category F'. And being so inessential can be expressed by having weakly equivalent hom types, as follows:

Definition cat2_not_really_a_variant_of_coalgHSET (C1 C2 : cat2): cat2⟦C1, C2⟧ ≃ FunctorCoalgebras.CoAlg_category F' ⟦C1, C2⟧.
    Proof.
      use weq_iso.
      - intros [f Hyp].
        exists f.
        apply funextfun.
        intro x.
        simple refine (factor_through_squash _  _ (Hyp x)).
        + apply setproperty.
        + trivial.
      - intros [f Hyp].
        exists f.
        intro x.
        apply hinhpr.
        apply (toforallpaths _ _ _ Hyp).
      - intros [f Hyp].
        use total2_paths_f.
        + apply idpath.
        + show_id_type.
          assert (aux : isaprop TYPE).
          { apply impred.
            intro x.
            apply isapropishinh.
          }
          apply aux.
      - intros [f Hyp].
        use total2_paths_f.
        + apply idpath.
        + show_id_type.
          set (is_set := isaset_forall_hSet (pr11 C1) (λ _, F' (pr1 C2))).
          apply is_set.
    Defined.

I do not claim that this proof is exemplary. I think, minimally you should say that this definition was there only for convenience in something that is anyway more of an illustration. You could say that this produces a weakly equivalent notion of morphisms of coalgebras. But I suspect it would be easy enough to replace cat2 by just the ordinary one and adapt the reasoning.

AextraT and others added 9 commits July 21, 2025 10:50
commit 85597cbc2505e8f3b2b968d29077a7b9a7bdcaa0
Author: Arnoud van der Leer <tempestasludi@gmail.com>
Date:   Mon Jul 21 11:46:36 2025 +0200

    Rename FiniteSequences to FLists

commit 26e0adc28d5fe74aa048ce1f4dc23f90310cf7fd
Author: Arnoud van der Leer <tempestasludi@gmail.com>
Date:   Mon Jul 21 11:33:31 2025 +0200

    Rename FiniteSequences to FMatrices

commit e0da662dd1e01f2fcc936db2a51afa258b88ca86
Author: Arnoud van der Leer <tempestasludi@gmail.com>
Date:   Mon Jul 21 11:31:41 2025 +0200

    Rename FiniteSequences to FVectors
…date .package/files, redirect imports of FiniteSequences to the correct file(s)
Went back to a classic definition of coalgebra for HSET in the
adjunction of MWithSets (the variant definition was not needed here).
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.

5 participants