Proposition monic_to_per_subobject_mor_eq : partial_setoid_comp_morphism monic_to_per_subobject_mor φ = partial_setoid_comp_morphism (subobject_to_partial_setoid_incl monic_to_per_subobject) (id_partial_setoid_morphism X). Proof. use eq_partial_setoid_morphism. - use (exists_elim (hyperdoctrine_hyp _)). use weaken_right ; cbn. unfold ξ₁. simplify. pose (x₁ := π₁ (π₁ (tm_var ((X ×h X) ×h Y)))). pose (x₂ := π₂ (π₁ (tm_var ((X ×h X) ×h Y)))). pose (y := π₂ (tm_var ((X ×h X) ×h Y))). fold x₁ x₂ y. use exists_intro. + exact x₁. + unfold ζ. simplify_form. rewrite !partial_setoid_subst. simplify. fold x₁ x₂. repeat use conj_intro. * use weaken_left. use (partial_setoid_mor_cod_defined φ y x₁). apply hyperdoctrine_hyp. * use exists_intro. { exact y. } simplify. fold x₁. use weaken_left. apply hyperdoctrine_hyp. * use (partial_setoid_mor_unique_im φ). ** exact y. ** use weaken_left. apply hyperdoctrine_hyp. ** use weaken_right. apply hyperdoctrine_hyp. - use (exists_elim (hyperdoctrine_hyp _)). use weaken_right ; cbn. unfold ζ. simplify_form. rewrite !partial_setoid_subst. simplify. use hyp_sym. use hyp_rtrans. use hyp_sym. use (exists_elim (weaken_left (hyperdoctrine_hyp _) _)). rewrite conj_subst. use hyp_ltrans. use weaken_right. simplify_form. rewrite !partial_setoid_subst. simplify. pose (x₁ := π₁ (π₁ (π₁ (tm_var (((X ×h X) ×h X) ×h Y))))). pose (x₂ := π₂ (π₁ (π₁ (tm_var (((X ×h X) ×h X) ×h Y))))). pose (x₃ := π₂ (π₁ (tm_var (((X ×h X) ×h X) ×h Y)))). pose (y := π₂ (tm_var (((X ×h X) ×h X) ×h Y))). fold x₁ x₂ x₃ y. use exists_intro. + exact y. + unfold ξ₁. simplify. fold x₁ x₂. use conj_intro. * use weaken_right. apply hyperdoctrine_hyp. * use partial_setoid_mor_eq_defined. ** exact y. ** exact x₁. ** use weaken_right. use (partial_setoid_mor_dom_defined φ y x₁). apply hyperdoctrine_hyp. ** use weaken_left. use partial_setoid_trans. *** exact x₃. *** use weaken_right. apply hyperdoctrine_hyp. *** use weaken_left. apply hyperdoctrine_hyp. ** use weaken_right. 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.