Definition rel_weq {X Y : UU} (R₁ R₂ : X → Y → hProp) : (R₁ = R₂) ≃ ∏ (x : X) (y : Y), (R₁ x y → R₂ x y) × (R₂ x y → R₁ x y) := (weqonsecfibers _ _ (λ x, weqonsecfibers _ _ (λ y, hProp_weq _ _ ∘ UA_for_HLevels _ _ _)) ∘ weqonsecfibers _ _ (λ x, invweq (weqfunextsec (λ _, hProp) (R₁ x) (R₂ x))) ∘ invweq (weqfunextsec (λ _, Y → hProp) R₁ R₂))%weq.
Require Import UniMath.Foundations.All. Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Categories. Require Import UniMath.CategoryTheory.Core.Functors. Require Import UniMath.CategoryTheory.Core.Isos. Require Import UniMath.CategoryTheory.Categories.HSET.Core. Require Import UniMath.CategoryTheory.TwoSidedDisplayedCats.TwoSidedDispCat. Require Import UniMath.CategoryTheory.TwoSidedDisplayedCats.Isos. Require Import UniMath.CategoryTheory.TwoSidedDisplayedCats.Univalence. Require Import UniMath.CategoryTheory.TwoSidedDisplayedCats.Discrete. Require Import UniMath.CategoryTheory.TwoSidedDisplayedCats.TwoSidedFibration.