From 7579d3da25a75ee8213bf2241aef759e61751292 Mon Sep 17 00:00:00 2001 From: Alex Gryzlov Date: Wed, 6 Nov 2024 22:21:41 +0100 Subject: [PATCH] propositionally truncated version --- src/Data/AF/Base.agda | 43 ++-------------------- src/Data/AF/Examples.agda | 70 ++++++++++++++---------------------- src/Data/AF/Prop.agda | 76 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 83 deletions(-) create mode 100644 src/Data/AF/Prop.agda diff --git a/src/Data/AF/Base.agda b/src/Data/AF/Base.agda index 43332b90..4abcd805 100644 --- a/src/Data/AF/Base.agda +++ b/src/Data/AF/Base.agda @@ -9,10 +9,10 @@ open import Meta.Effect.Idiom open import Data.Empty.Base open import Data.Unit.Base open import Data.Sum.Base + open import Data.List.Base open import Data.List.Correspondences.Unary.Any open import Data.List.Membership -open import Data.Truncation.Propositional as ∥-∥₁ _↑_ : ∀ {ℓ ℓ′} {A : 𝒰 ℓ} → (A → A → 𝒰 ℓ′) → A → A → A → 𝒰 ℓ′ (R ↑ a) x y = R x y ⊎ R a x @@ -21,17 +21,10 @@ data AF {ℓ ℓ′} {A : 𝒰 ℓ} (R : A → A → 𝒰 ℓ′) : 𝒰 (ℓ AFfull : (∀ x y → R x y) → AF R AFlift : (∀ a → AF (R ↑ a)) → AF R -{- -data AF₁ {ℓ ℓ′} {A : 𝒰 ℓ} (R : A → A → 𝒰 ℓ′) : 𝒰 (ℓ ⊔ ℓ′) where - AF₁full : (∀ x y → ∥ R x y ∥₁) → AF₁ R - AF₁lift : (∀ a → AF₁ (R ↑ a)) → AF₁ R --} - private variable ℓ ℓ′ ℓ″ : Level A B : 𝒰 ℓ R T : A → A → 𝒰 ℓ′ --- T : A → A → 𝒰 ℓ″ ↑-mono : (∀ {x y} → R x y → T x y) -- TODO subseteq → ∀ {x y a} → (R ↑ a) x y → (T ↑ a) x y @@ -72,15 +65,6 @@ af-mono sub (AFfull f) = af-mono sub (AFlift l) = AFlift λ a → af-mono (λ {x} {y} → ↑-mono sub {x} {y} {a}) (l a) -{- -af₁-mono : (∀ {x y} → R x y → T x y) -- TODO subseteq - → AF₁ R → AF₁ T -af₁-mono sub (AF₁full f) = - AF₁full λ x y → map sub (f x y) -af₁-mono sub (AF₁lift l) = - AF₁lift λ a → af₁-mono (λ {x} {y} → ↑-mono sub {x} {y} {a}) (l a) --} - af-comap : ∀ {ℓa ℓb ℓr} {A : 𝒰 ℓa} {B : 𝒰 ℓb} {R : A → A → 𝒰 ℓr} → (f : B → A) → AF R → AF (λ x y → R (f x) (f y)) @@ -116,6 +100,8 @@ af-rel-morph f surj mor (AFlift al) = (inr ra₁) → inr (mor a x₁ x y₁ fa f₁ ra₁)) (al a) +-- derived versions + af-mono′ : (∀ {x y} → R x y → T x y) → AF R → AF T af-mono′ {T} f = @@ -136,26 +122,3 @@ af-map′ : ∀ {ℓa ℓb ℓr ℓt} {A : 𝒰 ℓa} {B : 𝒰 ℓb} af-map′ {R} {f} fr = af-rel-morph (λ x y → x = f y) (λ y → f y , refl) λ x₁ x₂ y₁ y₂ e₁ e₂ → fr y₁ y₂ ∘ subst (λ q → R q (f y₂)) e₁ ∘ subst (R x₁) e₂ - --- af-rel-morph (λ x y → x = fst y) (λ y → fst y , refl) --- λ x₁ x₂ y₁ y₂ e₁ e₂ → subst (λ q → R q (fst y₂)) e₁ ∘ subst (R x₁) e₂ -{- -af₁-rel-morph : ∀ {ℓa ℓb ℓr ℓt} {A : 𝒰 ℓa} {B : 𝒰 ℓb} {R : A → A → 𝒰 ℓr} {T : B → B → 𝒰 ℓt} - → (f : A → B → 𝒰 ℓ) - → ((y : B) → ∃[ x ꞉ A ] (f x y)) - → ((x₁ x₂ : A) → (y₁ y₂ : B) → f x₁ y₁ → f x₂ y₂ → R x₁ x₂ → T y₁ y₂) - → AF₁ R → AF₁ T -af₁-rel-morph f surj mor (AF₁full af) = - AF₁full λ x y → - (surj x) & ∥-∥₁.elim (λ _ → squash₁) - λ where (a , fa) → - (surj y) & ∥-∥₁.elim (λ _ → squash₁) - λ where (b , fb) → - (af a b) & ∥-∥₁.elim (λ _ → squash₁) - λ r → ∣ mor a b x y fa fb r ∣₁ -af₁-rel-morph f surj mor (AF₁lift al) = - AF₁lift λ x → - (surj x) & ∥-∥₁.elim (λ _ → {!squash₁!}) - λ where (a , fa) → - {!!} --} diff --git a/src/Data/AF/Examples.agda b/src/Data/AF/Examples.agda index 6b6f2fb8..fcd08109 100644 --- a/src/Data/AF/Examples.agda +++ b/src/Data/AF/Examples.agda @@ -38,27 +38,19 @@ Rfl (x₁ , x₂) (y₁ , y₂) = (x₁ ≤ y₁) × (x₂ ≤ y₂) Tfl-empty-intersect : ∀ {x₁ x₂ y₁ y₂} → Plus Tfl (x₁ , x₂) (y₁ , y₂) - → y₁ ≤ x₁ - → y₂ ≤ x₂ + → Rfl (y₁ , y₂) (x₁ , x₂) → ⊥ -Tfl-empty-intersect [ inl x