From 2167866c53aa7f9cbb52e776bfb64f53acf3fa2c Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Sat, 2 Apr 2022 11:41:51 +0100 Subject: Add more properties for ordered structures. --- .../Algebra/Ordered/StrictTotal/Consequences.agda | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 src/Helium/Algebra/Ordered/StrictTotal/Consequences.agda (limited to 'src/Helium/Algebra/Ordered/StrictTotal/Consequences.agda') diff --git a/src/Helium/Algebra/Ordered/StrictTotal/Consequences.agda b/src/Helium/Algebra/Ordered/StrictTotal/Consequences.agda new file mode 100644 index 0000000..7696f98 --- /dev/null +++ b/src/Helium/Algebra/Ordered/StrictTotal/Consequences.agda @@ -0,0 +1,137 @@ +------------------------------------------------------------------------ +-- Agda Helium +-- +-- Relations between algebraic properties of ordered structures +------------------------------------------------------------------------ + +{-# OPTIONS --safe --without-K #-} + +open import Relation.Binary + +module Helium.Algebra.Ordered.StrictTotal.Consequences + {a ℓ₁ ℓ₂} + (strictTotalOrder : StrictTotalOrder a ℓ₁ ℓ₂) + where + +open StrictTotalOrder strictTotalOrder + renaming + ( Carrier to A + ; trans to <-trans + ; irrefl to <-irrefl + ; asym to <-asym + ) + +open import Helium.Relation.Binary.Properties.StrictTotalOrder strictTotalOrder +open import Relation.Binary.Reasoning.StrictPartialOrder strictPartialOrder + +open import Algebra.Core +open import Algebra.Definitions +open import Data.Product using (_,_) +open import Data.Sum using (inj₁; inj₂) +open import Function using (_∘_) +open import Function.Definitions +open import Helium.Algebra.Ordered.Definitions +open import Relation.Nullary using (¬_) + +---- +-- Consequences for a single unary operation +module _ {f : Op₁ A} where + cong₁+mono₁-<⇒mono₁-≤ : Congruent₁ _≈_ f → Congruent₁ _<_ f → Congruent₁ _≤_ f + cong₁+mono₁-<⇒mono₁-≤ cong mono (inj₁ x_ → f Preserves _≤_ ⟶ _≥_ + cong₁+anti-mono₁-<⇒anti-mono₁-≤ cong anti-mono (inj₁ x (<⇒≱ fx (<⇒≱ x_ → Injective _≤_ _≥_ f + anti-mono₁-<⇒anti-cancel₁-≤ anti-mono fx≥fy = ≮⇒≥ (≤⇒≯ fx≥fy ∘ anti-mono) + + anti-mono₁-≤⇒anti-cancel₁-< : f Preserves _≤_ ⟶ _≥_ → Injective _<_ _>_ f + anti-mono₁-≤⇒anti-cancel₁-< anti-mono fx>fy = ≰⇒> (<⇒≱ fx>fy ∘ anti-mono) + + mono₁-<⇒cancel₁ : Congruent₁ _<_ f → Injective _≈_ _≈_ f + mono₁-<⇒cancel₁ mono fx≈fy = ≮∧≯⇒≈ (<-irrefl fx≈fy ∘ mono) (<-irrefl (Eq.sym fx≈fy) ∘ mono) + + anti-mono₁-<⇒cancel₁ : f Preserves _<_ ⟶ _>_ → Injective _≈_ _≈_ f + anti-mono₁-<⇒cancel₁ anti-mono fx≈fy = ≮∧≯⇒≈ + (<-irrefl (Eq.sym fx≈fy) ∘ anti-mono) + (<-irrefl fx≈fy ∘ anti-mono) + +---- +-- Consequences for a single binary operation +module _ {_∙_ : Op₂ A} where + invariant⇒mono-< : Invariant _<_ _∙_ → Congruent₂ _<_ _∙_ + invariant⇒mono-< (invˡ , invʳ) {x} {y} {u} {v} x