diff --git a/src/elementary-number-theory/strict-inequality-integer-fractions.lagda.md b/src/elementary-number-theory/strict-inequality-integer-fractions.lagda.md index 8fff292158..d58fbf1f4c 100644 --- a/src/elementary-number-theory/strict-inequality-integer-fractions.lagda.md +++ b/src/elementary-number-theory/strict-inequality-integer-fractions.lagda.md @@ -26,6 +26,7 @@ open import elementary-number-theory.positive-integers open import elementary-number-theory.strict-inequality-integers open import foundation.action-on-identifications-functions +open import foundation.binary-transport open import foundation.cartesian-product-types open import foundation.conjunction open import foundation.coproduct-types @@ -340,3 +341,17 @@ module _ ( numerator-fraction-ℤ x) ( denominator-fraction-ℤ y)))) ``` + +### Negation reverses the order of strict inequality on integer fractions + +```agda +neg-le-fraction-ℤ : + (x y : fraction-ℤ) → + le-fraction-ℤ x y → + le-fraction-ℤ (neg-fraction-ℤ y) (neg-fraction-ℤ x) +neg-le-fraction-ℤ (m , n , p) (m' , n' , p') H = + binary-tr le-ℤ + ( inv (left-negative-law-mul-ℤ m' n)) + ( inv (left-negative-law-mul-ℤ m n')) + ( neg-le-ℤ (m *ℤ n') (m' *ℤ n) H) +``` diff --git a/src/elementary-number-theory/strict-inequality-integers.lagda.md b/src/elementary-number-theory/strict-inequality-integers.lagda.md index dde9a71571..107592ee5c 100644 --- a/src/elementary-number-theory/strict-inequality-integers.lagda.md +++ b/src/elementary-number-theory/strict-inequality-integers.lagda.md @@ -258,7 +258,6 @@ module _ module _ (x y : ℤ) (I : le-ℤ x y) where - abstract is-negative-le-negative-ℤ : is-negative-ℤ y → is-negative-ℤ x is-negative-le-negative-ℤ H = @@ -290,3 +289,14 @@ le-natural-le-ℤ (succ-ℕ m) (succ-ℕ n) mImports + +```agda +open import elementary-number-theory.positive-rational-numbers +open import elementary-number-theory.rational-numbers +open import elementary-number-theory.strict-inequality-rational-numbers + +open import foundation.cartesian-product-types +open import foundation.conjunction +open import foundation.coproduct-types +open import foundation.dependent-pair-types +open import foundation.disjunction +open import foundation.empty-types +open import foundation.existential-quantification +open import foundation.identity-types +open import foundation.logical-equivalences +open import foundation.negation +open import foundation.propositional-truncations +open import foundation.propositions +open import foundation.subtypes +open import foundation.transport-along-identifications +open import foundation.universe-levels + +open import real-numbers.dedekind-real-numbers +``` + + + +## Idea + +The {{#concept "negation" Disambiguation="Dedekind real number" Agda=neg-ℝ}} of +a [Dedekind real number](real-numbers.dedekind-real-numbers.md) with cuts +`(L, U)` has lower cut equal to the negation of elements of `U`, and upper cut +equal to the negation of elements in `L`. + +```agda +module _ + {l : Level} (x : ℝ l) + where + + lower-cut-neg-ℝ : subtype l ℚ + lower-cut-neg-ℝ q = upper-cut-ℝ x (neg-ℚ q) + + upper-cut-neg-ℝ : subtype l ℚ + upper-cut-neg-ℝ q = lower-cut-ℝ x (neg-ℚ q) + + is-inhabited-lower-cut-neg-ℝ : exists ℚ lower-cut-neg-ℝ + is-inhabited-lower-cut-neg-ℝ = + elim-exists + ( ∃ ℚ lower-cut-neg-ℝ) + ( λ q q-in-upper → + intro-exists + (neg-ℚ q) + (tr (is-in-upper-cut-ℝ x) (inv (neg-neg-ℚ q)) q-in-upper)) + ( is-inhabited-upper-cut-ℝ x) + + is-inhabited-upper-cut-neg-ℝ : exists ℚ upper-cut-neg-ℝ + is-inhabited-upper-cut-neg-ℝ = + elim-exists + ( ∃ ℚ upper-cut-neg-ℝ) + ( λ q q-in-lower → + intro-exists + (neg-ℚ q) + (tr (is-in-lower-cut-ℝ x) (inv (neg-neg-ℚ q)) q-in-lower)) + ( is-inhabited-lower-cut-ℝ x) + + is-rounded-lower-cut-neg-ℝ : + (q : ℚ) → + is-in-subtype lower-cut-neg-ℝ q ↔ + exists ℚ (λ r → (le-ℚ-Prop q r) ∧ (lower-cut-neg-ℝ r)) + pr1 (is-rounded-lower-cut-neg-ℝ q) in-neg-lower = + elim-exists + ( ∃ ℚ (λ r → le-ℚ-Prop q r ∧ lower-cut-neg-ℝ r)) + ( λ r (r<-q , in-upper-r) → + intro-exists + ( neg-ℚ r) + ( tr + ( λ x → le-ℚ x (neg-ℚ r)) + ( neg-neg-ℚ q) + ( neg-le-ℚ r (neg-ℚ q) r<-q) , + tr (is-in-upper-cut-ℝ x) (inv (neg-neg-ℚ r)) in-upper-r)) + ( forward-implication (is-rounded-upper-cut-ℝ x (neg-ℚ q)) in-neg-lower) + pr2 (is-rounded-lower-cut-neg-ℝ q) exists-r = + backward-implication + ( is-rounded-upper-cut-ℝ x (neg-ℚ q)) + ( elim-exists + ( ∃ ℚ (λ r → le-ℚ-Prop r (neg-ℚ q) ∧ upper-cut-ℝ x r)) + ( λ r (q