Proposition monic_to_per_subobject_inv_comm : partial_setoid_comp_morphism monic_to_per_subobject_inv (subobject_to_partial_setoid_incl monic_to_per_subobject) = partial_setoid_comp_morphism φ (id_partial_setoid_morphism X). Proof. use eq_partial_setoid_morphism. - use (exists_elim (hyperdoctrine_hyp _)). use weaken_right ; cbn ; unfold ξ₂. simplify_form. rewrite !partial_setoid_subst. simplify. pose (y := π₁ (π₁ (tm_var ((Y ×h X) ×h X)))). pose (x₁ := π₂ (π₁ (tm_var ((Y ×h X) ×h X)))). pose (x₂ := π₂ (tm_var ((Y ×h X) ×h X))). fold x₁ x₂ y. use exists_intro. { exact x₁. } simplify_form. rewrite !partial_setoid_subst. simplify. fold x₁ x₂ y. use conj_intro. + use partial_setoid_mor_eq_defined. * exact y. * exact x₂. * use weaken_left. use (partial_setoid_mor_dom_defined φ y x₂). apply hyperdoctrine_hyp. * use weaken_right. use weaken_left. apply hyperdoctrine_hyp. * use weaken_left. apply hyperdoctrine_hyp. + use weaken_right. use weaken_left. exact (partial_setoid_refl_r (hyperdoctrine_hyp _)). - use (exists_elim (hyperdoctrine_hyp _)). use weaken_right ; cbn ; unfold ξ₂, ζ. simplify_form. rewrite !partial_setoid_subst. simplify. pose (y := π₁ (π₁ (tm_var ((Y ×h X) ×h X)))). pose (x₁ := π₂ (π₁ (tm_var ((Y ×h X) ×h X)))). pose (x₂ := π₂ (tm_var ((Y ×h X) ×h X))). fold x₁ x₂ y. use exists_intro. { exact x₁. } simplify_form. rewrite !partial_setoid_subst. simplify. fold x₁ x₂ y. repeat use conj_intro. + use partial_setoid_mor_eq_defined. * exact y. * exact x₂. * use weaken_left. use (partial_setoid_mor_dom_defined φ y x₂). apply hyperdoctrine_hyp. * use weaken_right. apply hyperdoctrine_hyp. * use weaken_left. apply hyperdoctrine_hyp. + use weaken_right. exact (partial_setoid_refl_r (hyperdoctrine_hyp _)). + use exists_intro. { exact y. } simplify. use partial_setoid_mor_eq_defined. * exact y. * exact x₂. * use weaken_left. use (partial_setoid_mor_dom_defined φ y x₂). apply hyperdoctrine_hyp. * use weaken_right. apply hyperdoctrine_hyp. * use weaken_left. apply hyperdoctrine_hyp. Qed.
Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Prelude. Require Import UniMath.CategoryTheory.Monics. Require Import UniMath.CategoryTheory.DisplayedCats.Core. Require Import UniMath.CategoryTheory.DisplayedCats.Functors. Require Import UniMath.CategoryTheory.DisplayedCats.Isos. Require Import UniMath.CategoryTheory.DisplayedCats.Examples.MonoCodomain. Require Import UniMath.CategoryTheory.DisplayedCats.MonoCodomain.FiberMonoCod. Require Import UniMath.CategoryTheory.Hyperdoctrines.Hyperdoctrine. Require Import UniMath.CategoryTheory.Hyperdoctrines.FirstOrderHyperdoctrine. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERs. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERMorphisms. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERCategory. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERMonomorphisms. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.Logic.SubobjectDispCat.