Proposition per_subobject_def {X : partial_setoid H} (φ : per_subobject X) {Γ : ty H} {Δ : form Γ} (x : tm Γ X) (p : Δ ⊢ φ [ x ]) : Δ ⊢ x ~ x. Proof. use (impl_elim p). pose proof (hyperdoctrine_proof_subst (!! : tm Γ 𝟙) (pr12 φ)) as q. cbn in q. rewrite forall_subst in q. pose proof (q' := forall_elim q x) ; clear q. rewrite hyperdoctrine_comp_subst in q'. rewrite impl_subst in q'. rewrite partial_setoid_subst in q'. rewrite hyperdoctrine_pr2_subst in q'. rewrite var_tm_subst in q'. rewrite hyperdoctrine_pair_subst in q'. rewrite hyperdoctrine_pair_pr2 in q'. rewrite hyperdoctrine_pr2_subst in q'. rewrite var_tm_subst in q'. rewrite hyperdoctrine_pair_pr2 in q'. rewrite hyperdoctrine_comp_subst in q'. rewrite hyperdoctrine_pr2_subst in q'. rewrite var_tm_subst in q'. rewrite hyperdoctrine_pair_pr2 in q'. rewrite truth_subst in q'. refine (hyperdoctrine_cut _ q'). apply truth_intro. Qed.
Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Prelude. Require Import UniMath.CategoryTheory.DisplayedCats.Core. Require Import UniMath.CategoryTheory.DisplayedCats.Isos. Require Import UniMath.CategoryTheory.DisplayedCats.Univalence. Require Import UniMath.CategoryTheory.DisplayedCats.Fibrations. 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.