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

Set-enriched categories #1467

Open
wants to merge 62 commits into
base: master
Choose a base branch
from

Conversation

umedaikiti
Copy link
Contributor

This PR includes the following.

I believe that the proof of biequivalence is straightforward but I would like to finish it later because it requires a lot of efforts.

langston-barrett and others added 30 commits November 22, 2021 23:27
Duality involutions, rework discrete bicats
@benediktahrens
Copy link
Member

The CI error comes from one of the "sanity" checks:

--- checking the ordering prescribed by the files UniMath/*/.packages/files ---
error: *** UniMath/CategoryTheory/Enriched/ChangeOfBase.vo should not require UniMath/CategoryTheory/Enriched/BicatOfEnrichedCat.vo
error: *** UniMath/CategoryTheory/Enriched/ChangeOfBase.vo should not require UniMath/Bicategories/Core/Bicat.vo
error: *** UniMath/CategoryTheory/Enriched/ChangeOfBase.vo should not require UniMath/Bicategories/PseudoFunctors/PseudoFunctor.vo
error: *** UniMath/CategoryTheory/Enriched/ChangeOfBase.vo should not require UniMath/Bicategories/PseudoFunctors/Display/PseudoFunctorBicat.vo
error: *** UniMath/CategoryTheory/Enriched/BicatOfEnrichedCat.vo should not require UniMath/Bicategories/Core/Bicat.vo
error: *** UniMath/CategoryTheory/Enriched/HSETEnriched.vo should not require UniMath/Bicategories/Core/Bicat.vo
error: *** UniMath/CategoryTheory/Enriched/HSETEnriched.vo should not require UniMath/Bicategories/PseudoFunctors/PseudoFunctor.vo
error: *** UniMath/CategoryTheory/Enriched/HSETEnriched.vo should not require UniMath/Bicategories/PseudoFunctors/Display/PseudoFunctorBicat.vo
error: *** UniMath/CategoryTheory/Enriched/HSETEnriched.vo should not require UniMath/Bicategories/Transformations/PseudoTransformation.vo
error: *** UniMath/CategoryTheory/Enriched/HSETEnriched.vo should not require UniMath/Bicategories/Core/Examples/BicatOfCats.vo
error: *** UniMath/CategoryTheory/Enriched/HSETEnriched.vo should not require UniMath/Bicategories/PseudoFunctors/Examples/Composition.vo
error: *** UniMath/CategoryTheory/Enriched/HSETEnriched.vo should not require UniMath/Bicategories/PseudoFunctors/Biequivalence.vo
12 dependency order errors in package listings
make: *** [Makefile:321: .check-prescribed-ordering.okay] Error 1

In general, the list of files in .package/files should be considered to be ordered by dependency. A file B importing file A should be listed after file A.
Here, this means that the file Enriched/HSETEnriched.v should be listed after the files mentioned in the message above.

@umedaikiti
Copy link
Contributor Author

The sanity checks passed, but the build script failed with the message "Error: Universe inconsistency." I don't think I did anything strange. No error occurs when I run make in my local environment. Do you have any idea about the reason for this failure?

@benediktahrens benediktahrens requested a review from rmatthes March 7, 2022 09:05
@benediktahrens
Copy link
Member

The sanity checks passed, but the build script failed with the message "Error: Universe inconsistency." I don't think I did anything strange. No error occurs when I run make in my local environment. Do you have any idea about the reason for this failure?

There are two builds launched for each PR:

  1. A build of UniMath itself, called "CI-Build-UniMath / Build-UniMath-and-Sanity-Checks".
  2. A build of parts of UniMath, and a complete build of the satellite repositories, called "CI-Build-Satellites / build".

It is the second one that failed, specifically when building the satellite repository https://github.com/UniMath/SetHITs.

@nmvdw : could you assist in investigating this error?

Comment on lines +29 to +34
+ intros x y.
cbn.
abstract (
rewrite postcompose_identity, precompose_identity, id_left;
reflexivity
).
Copy link
Member

Choose a reason for hiding this comment

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

Here and elsewhere, the abstract(...) could/should also include the intros.... cbn. tactics.


(** The arrow from p1 to p2 induced by the projections from p1 is an iso *)
Lemma product_unique (p1 p2 : Product I C c) :
is_iso (ProductArrow _ _ p2 (ProductPr I C p1)).
Copy link
Member

Choose a reason for hiding this comment

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

We are transitioning to is_z_iso, so maybe it would be best to state this lemma directly in terms of it? The proof should be the same after is_iso_qinv.

apply funextsec; intro.
rewrite ProductPrCommutes.
now rewrite id_left.
Qed.
Copy link
Member

Choose a reason for hiding this comment

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

This proof should be transparent, at least in part, to allow for the extraction of the inverse.

unfold isProduct.
do 2 (apply impred; intro).
apply isapropiscontr.
Defined.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Defined.
Qed.

Local Definition r_pr2 {x y z : C} : C ⟦x ⊠ (y ⊠ z), y⟧ := π2 · π1.
Local Definition r_pr3 {x y z : C} : C ⟦x ⊠ (y ⊠ z), z⟧ := π2 · π2.

Lemma right_assoc_ternary_product :
Copy link
Member

Choose a reason for hiding this comment

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

It might be good to make parts of this construction opaque.

Local Definition l_pr2 {x y z : C} : C ⟦(x ⊠ y) ⊠ z, y⟧ := π1 · π2.
Local Definition l_pr3 {x y z : C} : C ⟦(x ⊠ y) ⊠ z, z⟧ := π2.

Lemma left_assoc_ternary_product :
Copy link
Member

Choose a reason for hiding this comment

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

It might be good to make parts of this construction opaque.

isweq BinproductsToProductsBool.
Proof.
apply (isweq_iso _ ProductsBoolToBinproducts).
- intros x.
Copy link
Member

Choose a reason for hiding this comment

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

It might be good to make parts of this construction opaque.

@@ -696,6 +701,15 @@ Arguments isBinProduct' _ _ _ _ _ : clear implicits.

(** ** Terminal object as the unit (up to isomorphism) of binary products *)

(** Generalize [maponpaths_2] to this lemma *)
Local Lemma f_equal_2 :
Copy link
Member

Choose a reason for hiding this comment

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

There are already two constructions for this:

two_arg_paths:
  ∏ (A B C : UU) (f : A → B → C) (a1 : A) (b1 : B) 
  (a2 : A) (b2 : B), a1 = a2 → b1 = b2 → f a1 b1 = f a2 b2
map_on_two_paths:
  ∏ (X Y Z : UU) (f : X → Y → Z) (x x' : X) (y y' : Y),
  x = x' → y = y' → f x y = f x' y'

@nmvdw
Copy link
Collaborator

nmvdw commented Mar 7, 2022

The sanity checks passed, but the build script failed with the message "Error: Universe inconsistency." I don't think I did anything strange. No error occurs when I run make in my local environment. Do you have any idea about the reason for this failure?

There are two builds launched for each PR:

  1. A build of UniMath itself, called "CI-Build-UniMath / Build-UniMath-and-Sanity-Checks".
  2. A build of parts of UniMath, and a complete build of the satellite repositories, called "CI-Build-Satellites / build".

It is the second one that failed, specifically when building the satellite repository https://github.com/UniMath/SetHITs.

@nmvdw : could you assist in investigating this error?

Interestingly, the error happens in the following line: Require Export UniMath.CategoryTheory.limits.binproducts.. The same error message is given if I replace it by Require Import UniMath.CategoryTheory.limits.binproducts..

The error can be avoided by adding -arg "-type-in-type" in the _CoqProject file.

My guess is that one of the additions to UniMath.CategoryTheory.limits.binproducts requires impredicativity of universes.

Copy link
Collaborator

@nmvdw nmvdw left a comment

Choose a reason for hiding this comment

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

Some tips for constructing the biequivalence:

Another thing that I am wondering about, is how do you envision the role of univalence in your development and what are your plans in this regard? For both categories and bicategories, the main focus in univalent foundations tends to be on the univalent ones.

- exact (@pre_whisker Mon_V).
- exact (@post_whisker Mon_V).
- intros C D F.
use make_enriched_nat_trans.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be good to add a separate definition for this natural transformation and the next one.

- exact (@change_of_base_enriched_functor _ _ F).
- exact (@change_of_base_enriched_nat_trans _ _ F).
- intro C.
use make_enriched_nat_trans.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here it would also be good to add separate definitions for the two natural transformations

- exact change_of_base_psfunctor_laws.
- split.
+ intros.
use make_is_invertible_2cell.
Copy link
Collaborator

Choose a reason for hiding this comment

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

For categories, one can prove that a natural transformation is an invertible 2-cell if it is a pointwise isomorphism. I guess the same holds in the enriched case.

To improve the usability of your code, it would be good to add the notion of an isomorphism in an enriched category and to add the statement that a natural transformation is an invertible 2 -cell if and only if it is a pointwise isomorphism (this can be done in a separate PR though).

exact (F x).
+ intros x y f.
exact (enriched_functor_on_morphisms F _ _ f).
- split.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be made opaque.

use make_nat_trans.
- intro x.
exact (a x tt).
- intros x y f.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be made opaque.

use make_is_z_isomorphism.
* apply binprod_assoc_r.
* apply assoc_l_qinv_assoc_r.
- intros a b; cbn.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The parts following this need to be made opaque.

Copy link
Member

@m-lindgren m-lindgren left a comment

Choose a reason for hiding this comment

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

With these changes SetHITs should not have to enable -type-in-type.

I would prefer if there wasn't duplication of material, but since this PR has been around a while I don't mind, we can clean it up later.

I have no comments on the mathematics of this, I just looked at the SetHIT-problem.

UniMath/CategoryTheory/limits/binproducts.v Outdated Show resolved Hide resolved
UniMath/CategoryTheory/limits/binproducts.v Outdated Show resolved Hide resolved
UniMath/CategoryTheory/limits/binproducts.v Outdated Show resolved Hide resolved
Let α {x y z} : C⟦(x ⊠ y) ⊠ z, x ⊠ (y ⊠ z)⟧ := binprod_assoc x y z.

(** A type with three inhabitants, used for indexing ternary products *)
Let three : UU := coprod unit bool.
Copy link
Member

Choose a reason for hiding this comment

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

There's already a type like this in Combinatorics/StandardFiniteSets.v

UniMath/CategoryTheory/limits/binproducts.v Outdated Show resolved Hide resolved
UniMath/CategoryTheory/limits/binproducts.v Outdated Show resolved Hide resolved
benediktahrens and others added 6 commits November 7, 2022 10:11
Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
@m-lindgren
Copy link
Member

Can we try and merge master into this and see if it compiles with the recent changes to UniMath?

@benediktahrens
Copy link
Member

Can we try and merge master into this and see if it compiles with the recent changes to UniMath?

Done!

Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
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.

6 participants