diff --git a/src/complex-numbers.lagda.md b/src/complex-numbers.lagda.md index bb5ba406cb..8302d4d3fe 100644 --- a/src/complex-numbers.lagda.md +++ b/src/complex-numbers.lagda.md @@ -4,13 +4,16 @@ module complex-numbers where open import complex-numbers.addition-complex-numbers public +open import complex-numbers.addition-nonzero-complex-numbers public open import complex-numbers.apartness-complex-numbers public open import complex-numbers.complex-numbers public open import complex-numbers.conjugation-complex-numbers public open import complex-numbers.eisenstein-integers public +open import complex-numbers.field-of-complex-numbers public open import complex-numbers.gaussian-integers public open import complex-numbers.large-additive-group-of-complex-numbers public open import complex-numbers.large-ring-of-complex-numbers public +open import complex-numbers.local-ring-of-complex-numbers public open import complex-numbers.magnitude-complex-numbers public open import complex-numbers.multiplication-complex-numbers public open import complex-numbers.multiplicative-inverses-nonzero-complex-numbers public diff --git a/src/complex-numbers/addition-nonzero-complex-numbers.lagda.md b/src/complex-numbers/addition-nonzero-complex-numbers.lagda.md new file mode 100644 index 0000000000..c74857b7bf --- /dev/null +++ b/src/complex-numbers/addition-nonzero-complex-numbers.lagda.md @@ -0,0 +1,53 @@ +# Addition of nonzero complex numbers + +```agda +module complex-numbers.addition-nonzero-complex-numbers where +``` + +
Imports + +```agda +open import complex-numbers.addition-complex-numbers +open import complex-numbers.complex-numbers +open import complex-numbers.nonzero-complex-numbers + +open import foundation.disjunction +open import foundation.functoriality-disjunction +open import foundation.universe-levels + +open import real-numbers.addition-nonzero-real-numbers +open import real-numbers.nonzero-real-numbers +``` + +
+ +## Idea + +This file describes properties of +[addition](complex-numbers.addition-complex-numbers.md) of +[nonzero](complex-numbers.nonzero-complex-numbers.md) +[complex numbers](complex-numbers.complex-numbers.md). + +## Properties + +### If the sum of two complex numbers is nonzero, one of them is nonzero + +```agda +abstract + is-nonzero-either-is-nonzero-add-ℂ : + {l1 l2 : Level} (z : ℂ l1) (w : ℂ l2) → is-nonzero-ℂ (z +ℂ w) → + disjunction-type (is-nonzero-ℂ z) (is-nonzero-ℂ w) + is-nonzero-either-is-nonzero-add-ℂ z@(a +iℂ b) w@(c +iℂ d) = + elim-disjunction + ( is-nonzero-prop-ℂ z ∨ is-nonzero-prop-ℂ w) + ( λ a+c≠0 → + map-disjunction + ( inl-disjunction) + ( inl-disjunction) + ( is-nonzero-either-is-nonzero-add-ℝ a c a+c≠0)) + ( λ b+d≠0 → + map-disjunction + ( inr-disjunction) + ( inr-disjunction) + ( is-nonzero-either-is-nonzero-add-ℝ b d b+d≠0)) +``` diff --git a/src/complex-numbers/apartness-complex-numbers.lagda.md b/src/complex-numbers/apartness-complex-numbers.lagda.md index 03c9a2a251..2a7ff16fcd 100644 --- a/src/complex-numbers/apartness-complex-numbers.lagda.md +++ b/src/complex-numbers/apartness-complex-numbers.lagda.md @@ -8,7 +8,9 @@ module complex-numbers.apartness-complex-numbers where ```agda open import complex-numbers.complex-numbers +open import complex-numbers.similarity-complex-numbers +open import foundation.apartness-relations open import foundation.dependent-pair-types open import foundation.disjunction open import foundation.empty-types @@ -17,6 +19,7 @@ open import foundation.functoriality-disjunction open import foundation.large-apartness-relations open import foundation.negation open import foundation.propositions +open import foundation.tight-apartness-relations open import foundation.universe-levels open import real-numbers.apartness-real-numbers @@ -100,3 +103,42 @@ symmetric-Large-Apartness-Relation large-apartness-relation-ℂ = cotransitive-Large-Apartness-Relation large-apartness-relation-ℂ = cotransitive-apart-ℂ ``` + +### The apartness relation of complex numbers at a particular universe level + +```agda +apartness-relation-ℂ : (l : Level) → Apartness-Relation l (ℂ l) +apartness-relation-ℂ l = + apartness-relation-Large-Apartness-Relation large-apartness-relation-ℂ l +``` + +### If two complex numbers at the same universe level are not apart, they are equal + +```agda +abstract + is-tight-apartness-relation-ℂ : + (l : Level) → is-tight-Apartness-Relation (apartness-relation-ℂ l) + is-tight-apartness-relation-ℂ l (a +iℂ b) (c +iℂ d) ¬a+ib#c+id = + eq-ℂ + ( is-tight-apartness-relation-ℝ l a c (¬a+ib#c+id ∘ inl-disjunction)) + ( is-tight-apartness-relation-ℝ l b d (¬a+ib#c+id ∘ inr-disjunction)) + +tight-apartness-relation-ℂ : (l : Level) → Tight-Apartness-Relation l (ℂ l) +tight-apartness-relation-ℂ l = + ( apartness-relation-ℂ l , + is-tight-apartness-relation-ℂ l) +``` + +### Apartness is preserved by similarity + +```agda +abstract + apart-right-sim-ℂ : + {l1 l2 l3 : Level} → + (z : ℂ l1) (x : ℂ l2) (y : ℂ l3) → + sim-ℂ x y → apart-ℂ z x → apart-ℂ z y + apart-right-sim-ℂ (a +iℂ b) (c +iℂ d) (e +iℂ f) (c~e , d~f) = + map-disjunction + ( apart-right-sim-ℝ a c e c~e) + ( apart-right-sim-ℝ b d f d~f) +``` diff --git a/src/complex-numbers/complex-numbers.lagda.md b/src/complex-numbers/complex-numbers.lagda.md index 0b7cc5fcf8..83e96a2e63 100644 --- a/src/complex-numbers/complex-numbers.lagda.md +++ b/src/complex-numbers/complex-numbers.lagda.md @@ -14,6 +14,7 @@ open import foundation.cartesian-product-types open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.identity-types +open import foundation.negated-equality open import foundation.sets open import foundation.universe-levels @@ -99,6 +100,14 @@ i-ℂ : ℂ lzero i-ℂ = (zero-ℝ , one-ℝ) ``` +### `0 ≠ 1` in the complex numbers + +```agda +abstract + neq-zero-one-ℂ : zero-ℂ ≠ one-ℂ + neq-zero-one-ℂ 0=1ℂ = neq-zero-one-ℝ (ap re-ℂ 0=1ℂ) +``` + ### Negation of complex numbers ```agda diff --git a/src/complex-numbers/field-of-complex-numbers.lagda.md b/src/complex-numbers/field-of-complex-numbers.lagda.md new file mode 100644 index 0000000000..c555456af6 --- /dev/null +++ b/src/complex-numbers/field-of-complex-numbers.lagda.md @@ -0,0 +1,65 @@ +# The field of complex numbers + +```agda +module complex-numbers.field-of-complex-numbers where +``` + +
Imports + +```agda +open import commutative-algebra.heyting-fields +open import commutative-algebra.invertible-elements-commutative-rings + +open import complex-numbers.apartness-complex-numbers +open import complex-numbers.complex-numbers +open import complex-numbers.large-ring-of-complex-numbers +open import complex-numbers.local-ring-of-complex-numbers +open import complex-numbers.multiplicative-inverses-nonzero-complex-numbers +open import complex-numbers.raising-universe-levels-complex-numbers + +open import foundation.dependent-pair-types +open import foundation.identity-types +open import foundation.negation +open import foundation.universe-levels +``` + +
+ +## Idea + +The [complex numbers](complex-numbers.complex-numbers.md) form a +[Heyting field](commutative-algebra.heyting-fields.md). + +## Definition + +```agda +abstract + is-zero-is-noninvertible-commutative-ring-ℂ : + (l : Level) (z : ℂ l) → + ¬ (is-invertible-element-Commutative-Ring (commutative-ring-ℂ l) z) → + z = raise-ℂ l zero-ℂ + is-zero-is-noninvertible-commutative-ring-ℂ l z ¬inv-z = + is-tight-apartness-relation-ℂ l z (raise-ℂ l zero-ℂ) + ( λ z#0 → + ¬inv-z + ( is-invertible-is-nonzero-ℂ + ( z) + ( apart-right-sim-ℂ + ( z) + ( raise-ℂ l zero-ℂ) + ( zero-ℂ) + ( sim-raise-ℂ' l zero-ℂ) + ( z#0)))) + +is-heyting-field-local-commutative-ring-ℂ : + (l : Level) → + is-heyting-field-Local-Commutative-Ring (local-commutative-ring-ℂ l) +is-heyting-field-local-commutative-ring-ℂ l = + ( neq-raise-zero-one-ℂ l , + is-zero-is-noninvertible-commutative-ring-ℂ l) + +heyting-field-ℂ : (l : Level) → Heyting-Field (lsuc l) +heyting-field-ℂ l = + ( local-commutative-ring-ℂ l , + is-heyting-field-local-commutative-ring-ℂ l) +``` diff --git a/src/complex-numbers/local-ring-of-complex-numbers.lagda.md b/src/complex-numbers/local-ring-of-complex-numbers.lagda.md new file mode 100644 index 0000000000..6f96731b10 --- /dev/null +++ b/src/complex-numbers/local-ring-of-complex-numbers.lagda.md @@ -0,0 +1,50 @@ +# The local ring of complex numbers + +```agda +module complex-numbers.local-ring-of-complex-numbers where +``` + +
Imports + +```agda +open import commutative-algebra.local-commutative-rings + +open import complex-numbers.addition-complex-numbers +open import complex-numbers.addition-nonzero-complex-numbers +open import complex-numbers.large-ring-of-complex-numbers +open import complex-numbers.multiplicative-inverses-nonzero-complex-numbers +open import complex-numbers.nonzero-complex-numbers + +open import foundation.dependent-pair-types +open import foundation.functoriality-disjunction +open import foundation.universe-levels +``` + +
+ +## Idea + +The +[commutative ring of complex numbers](complex-numbers.large-ring-of-complex-numbers.md) +is [local](commutative-algebra.local-commutative-rings.md). + +## Definition + +```agda +is-local-commutative-ring-ℂ : + (l : Level) → is-local-Commutative-Ring (commutative-ring-ℂ l) +is-local-commutative-ring-ℂ l z w is-invertible-z+w = + map-disjunction + ( is-invertible-is-nonzero-ℂ z) + ( is-invertible-is-nonzero-ℂ w) + ( is-nonzero-either-is-nonzero-add-ℂ + ( z) + ( w) + ( is-nonzero-is-invertible-ℂ + ( z +ℂ w) + ( is-invertible-z+w))) + +local-commutative-ring-ℂ : (l : Level) → Local-Commutative-Ring (lsuc l) +local-commutative-ring-ℂ l = + ( commutative-ring-ℂ l , is-local-commutative-ring-ℂ l) +``` diff --git a/src/complex-numbers/magnitude-complex-numbers.lagda.md b/src/complex-numbers/magnitude-complex-numbers.lagda.md index f151528dc4..3c033afa8d 100644 --- a/src/complex-numbers/magnitude-complex-numbers.lagda.md +++ b/src/complex-numbers/magnitude-complex-numbers.lagda.md @@ -12,11 +12,14 @@ module complex-numbers.magnitude-complex-numbers where open import complex-numbers.complex-numbers open import complex-numbers.conjugation-complex-numbers open import complex-numbers.multiplication-complex-numbers +open import complex-numbers.similarity-complex-numbers open import foundation.action-on-identifications-functions +open import foundation.dependent-pair-types open import foundation.identity-types open import foundation.universe-levels +open import real-numbers.absolute-value-real-numbers open import real-numbers.addition-nonnegative-real-numbers open import real-numbers.addition-real-numbers open import real-numbers.dedekind-real-numbers @@ -25,6 +28,7 @@ open import real-numbers.multiplication-nonnegative-real-numbers open import real-numbers.multiplication-real-numbers open import real-numbers.negation-real-numbers open import real-numbers.nonnegative-real-numbers +open import real-numbers.positive-real-numbers open import real-numbers.raising-universe-levels-real-numbers open import real-numbers.rational-real-numbers open import real-numbers.similarity-real-numbers @@ -225,3 +229,67 @@ abstract = magnitude-ℂ z *ℝ magnitude-ℂ w by ap real-ℝ⁰⁺ (distributive-sqrt-mul-ℝ⁰⁺ _ _) ``` + +### The magnitude of a real number as a complex number is its absolute value + +```agda +abstract + magnitude-complex-ℝ : + {l : Level} (x : ℝ l) → magnitude-ℂ (complex-ℝ x) = abs-ℝ x + magnitude-complex-ℝ {l} x = + equational-reasoning + real-sqrt-ℝ⁰⁺ + ( nonnegative-square-ℝ x +ℝ⁰⁺ nonnegative-square-ℝ (raise-ℝ l zero-ℝ)) + = + real-sqrt-ℝ⁰⁺ + ( nonnegative-square-ℝ x +ℝ⁰⁺ nonnegative-square-ℝ zero-ℝ) + by + ap + ( real-sqrt-ℝ⁰⁺) + ( eq-ℝ⁰⁺ _ _ + ( eq-sim-ℝ + ( preserves-sim-left-add-ℝ _ _ _ + ( preserves-sim-square-ℝ + ( symmetric-sim-ℝ (sim-raise-ℝ l zero-ℝ)))))) + = real-sqrt-ℝ⁰⁺ (nonnegative-square-ℝ x +ℝ⁰⁺ zero-ℝ⁰⁺) + by ap real-sqrt-ℝ⁰⁺ (eq-ℝ⁰⁺ _ _ (ap-add-ℝ refl square-zero-ℝ)) + = real-sqrt-ℝ⁰⁺ (nonnegative-square-ℝ x) + by ap real-sqrt-ℝ⁰⁺ (eq-ℝ⁰⁺ _ _ (right-unit-law-add-ℝ _)) + = abs-ℝ x + by inv (eq-abs-sqrt-square-ℝ x) +``` + +### Similar complex numbers have similar magnitudes + +```agda +abstract + preserves-sim-squared-magnitude-ℂ : + {l1 l2 : Level} {z : ℂ l1} {w : ℂ l2} → + sim-ℂ z w → sim-ℝ (squared-magnitude-ℂ z) (squared-magnitude-ℂ w) + preserves-sim-squared-magnitude-ℂ (a~c , b~d) = + preserves-sim-add-ℝ + ( preserves-sim-square-ℝ a~c) + ( preserves-sim-square-ℝ b~d) + + preserves-sim-magnitude-ℂ : + {l1 l2 : Level} {z : ℂ l1} {w : ℂ l2} → + sim-ℂ z w → sim-ℝ (magnitude-ℂ z) (magnitude-ℂ w) + preserves-sim-magnitude-ℂ z~w = + preserves-sim-sqrt-ℝ⁰⁺ _ _ (preserves-sim-squared-magnitude-ℂ z~w) +``` + +### The magnitude of `one-ℂ` is `one-ℝ` + +```agda +abstract + magnitude-one-ℂ : magnitude-ℂ one-ℂ = one-ℝ + magnitude-one-ℂ = + equational-reasoning + magnitude-ℂ one-ℂ + = magnitude-ℂ (complex-ℝ one-ℝ) + by ap magnitude-ℂ (inv eq-complex-one-ℝ) + = abs-ℝ one-ℝ + by magnitude-complex-ℝ one-ℝ + = one-ℝ + by abs-real-ℝ⁺ one-ℝ⁺ +``` diff --git a/src/complex-numbers/multiplicative-inverses-nonzero-complex-numbers.lagda.md b/src/complex-numbers/multiplicative-inverses-nonzero-complex-numbers.lagda.md index 183fbec3b2..35fa41ca01 100644 --- a/src/complex-numbers/multiplicative-inverses-nonzero-complex-numbers.lagda.md +++ b/src/complex-numbers/multiplicative-inverses-nonzero-complex-numbers.lagda.md @@ -7,21 +7,35 @@ module complex-numbers.multiplicative-inverses-nonzero-complex-numbers where
Imports ```agda +open import commutative-algebra.invertible-elements-commutative-rings + open import complex-numbers.complex-numbers open import complex-numbers.conjugation-complex-numbers +open import complex-numbers.large-ring-of-complex-numbers open import complex-numbers.magnitude-complex-numbers open import complex-numbers.multiplication-complex-numbers open import complex-numbers.nonzero-complex-numbers +open import complex-numbers.raising-universe-levels-complex-numbers open import complex-numbers.similarity-complex-numbers open import foundation.dependent-pair-types +open import foundation.disjunction +open import foundation.empty-types +open import foundation.function-types open import foundation.identity-types +open import foundation.logical-equivalences open import foundation.transport-along-identifications open import foundation.universe-levels +open import real-numbers.multiplication-nonzero-real-numbers open import real-numbers.multiplication-real-numbers open import real-numbers.multiplicative-inverses-positive-real-numbers +open import real-numbers.nonnegative-real-numbers +open import real-numbers.nonzero-real-numbers +open import real-numbers.positive-and-negative-real-numbers +open import real-numbers.positive-real-numbers open import real-numbers.rational-real-numbers +open import real-numbers.similarity-real-numbers ```
@@ -86,3 +100,110 @@ abstract ( commutative-mul-ℂ _ _) ( right-inverse-law-mul-nonzero-ℂ z) ``` + +### If a complex number has a multiplicative inverse, it is nonzero + +```agda +abstract + is-nonzero-has-right-inverse-mul-ℂ : + {l1 l2 : Level} (z : ℂ l1) (w : ℂ l2) → sim-ℂ (z *ℂ w) one-ℂ → + is-nonzero-ℂ z + is-nonzero-has-right-inverse-mul-ℂ z w zw=1 = + is-nonzero-is-positive-magnitude-ℂ + ( z) + ( elim-disjunction + ( is-positive-prop-ℝ (magnitude-ℂ z)) + ( λ |z|<0 → + ex-falso + ( is-not-negative-and-nonnegative-ℝ + ( |z|<0 , is-nonnegative-real-ℝ⁰⁺ (nonnegative-magnitude-ℂ z)))) + ( id) + ( pr1 + ( is-nonzero-factors-is-nonzero-mul-ℝ + ( (magnitude-ℂ z)) + ( (magnitude-ℂ w)) + ( is-nonzero-sim-ℝ + ( symmetric-sim-ℝ + ( similarity-reasoning-ℝ + (magnitude-ℂ z) *ℝ (magnitude-ℂ w) + ~ℝ magnitude-ℂ (z *ℂ w) + by sim-eq-ℝ (inv (distributive-magnitude-mul-ℂ z w)) + ~ℝ magnitude-ℂ one-ℂ + by preserves-sim-magnitude-ℂ zw=1 + ~ℝ one-ℝ + by sim-eq-ℝ magnitude-one-ℂ)) + ( is-nonzero-is-positive-ℝ is-positive-one-ℝ))))) + + is-nonzero-has-left-inverse-mul-ℂ : + {l1 l2 : Level} (z : ℂ l1) (w : ℂ l2) → sim-ℂ (z *ℂ w) one-ℂ → + is-nonzero-ℂ w + is-nonzero-has-left-inverse-mul-ℂ z w zw=1 = + is-nonzero-has-right-inverse-mul-ℂ + ( w) + ( z) + ( tr (λ x → sim-ℂ x one-ℂ) (commutative-mul-ℂ z w) zw=1) +``` + +### The multiplicative inverse of a nonzero complex number is nonzero + +```agda +abstract + is-nonzero-complex-inv-nonzero-ℂ : + {l : Level} (z : nonzero-ℂ l) → is-nonzero-ℂ (complex-inv-nonzero-ℂ z) + is-nonzero-complex-inv-nonzero-ℂ z = + is-nonzero-has-left-inverse-mul-ℂ + ( _) + ( _) + ( right-inverse-law-mul-nonzero-ℂ z) + +inv-nonzero-ℂ : {l : Level} → nonzero-ℂ l → nonzero-ℂ l +inv-nonzero-ℂ z = (complex-inv-nonzero-ℂ z , is-nonzero-complex-inv-nonzero-ℂ z) +``` + +### A complex number is invertible if and only if it is nonzero + +```agda +module _ + {l : Level} + (z : ℂ l) + where + + abstract + is-nonzero-is-invertible-ℂ : + is-invertible-element-Commutative-Ring (commutative-ring-ℂ l) z → + is-nonzero-ℂ z + is-nonzero-is-invertible-ℂ (w , zw=1 , _) = + is-nonzero-has-right-inverse-mul-ℂ + ( z) + ( w) + ( transitive-sim-ℂ _ _ _ + ( symmetric-sim-ℂ (sim-raise-ℂ _ one-ℂ)) + ( sim-eq-ℂ zw=1)) + + is-invertible-is-nonzero-ℂ : + is-nonzero-ℂ z → + is-invertible-element-Commutative-Ring (commutative-ring-ℂ l) z + is-invertible-is-nonzero-ℂ z≠0 = + ( complex-inv-nonzero-ℂ (z , z≠0) , + eq-sim-ℂ + ( similarity-reasoning-ℂ + z *ℂ complex-inv-nonzero-ℂ (z , z≠0) + ~ℂ one-ℂ + by right-inverse-law-mul-nonzero-ℂ (z , z≠0) + ~ℂ raise-ℂ _ one-ℂ + by sim-raise-ℂ _ one-ℂ) , + eq-sim-ℂ + ( similarity-reasoning-ℂ + complex-inv-nonzero-ℂ (z , z≠0) *ℂ z + ~ℂ one-ℂ + by left-inverse-law-mul-nonzero-ℂ (z , z≠0) + ~ℂ raise-ℂ _ one-ℂ + by sim-raise-ℂ _ one-ℂ)) + + is-invertible-iff-is-nonzero-ℂ : + (is-invertible-element-Commutative-Ring (commutative-ring-ℂ l) z) ↔ + (is-nonzero-ℂ z) + is-invertible-iff-is-nonzero-ℂ = + ( is-nonzero-is-invertible-ℂ , + is-invertible-is-nonzero-ℂ) +``` diff --git a/src/complex-numbers/nonzero-complex-numbers.lagda.md b/src/complex-numbers/nonzero-complex-numbers.lagda.md index 9f978a56f1..144fd3127f 100644 --- a/src/complex-numbers/nonzero-complex-numbers.lagda.md +++ b/src/complex-numbers/nonzero-complex-numbers.lagda.md @@ -26,6 +26,7 @@ open import real-numbers.positive-and-negative-real-numbers open import real-numbers.positive-real-numbers open import real-numbers.rational-real-numbers open import real-numbers.similarity-real-numbers +open import real-numbers.square-roots-nonnegative-real-numbers open import real-numbers.squares-real-numbers open import real-numbers.strict-inequality-real-numbers ``` @@ -99,3 +100,24 @@ positive-squared-magnitude-nonzero-ℂ : positive-squared-magnitude-nonzero-ℂ (z , z≠0) = ( squared-magnitude-ℂ z , is-positive-squared-magnitude-is-nonzero-ℂ z z≠0) ``` + +### A complex number is nonzero if and only if its magnitude is positive + +```agda +abstract + is-nonzero-is-positive-magnitude-ℂ : + {l : Level} (z : ℂ l) → is-positive-ℝ (magnitude-ℂ z) → is-nonzero-ℂ z + is-nonzero-is-positive-magnitude-ℂ z 0<|z| = + is-nonzero-is-positive-squared-magnitude-ℂ + ( z) + ( is-positive-is-positive-sqrt-ℝ⁰⁺ + ( nonnegative-squared-magnitude-ℂ z) + ( 0<|z|)) + + is-positive-magnitude-is-nonzero-ℂ : + {l : Level} (z : ℂ l) → is-nonzero-ℂ z → is-positive-ℝ (magnitude-ℂ z) + is-positive-magnitude-is-nonzero-ℂ z z≠0 = + is-positive-sqrt-is-positive-ℝ⁰⁺ + ( nonnegative-squared-magnitude-ℂ z) + ( is-positive-squared-magnitude-is-nonzero-ℂ z z≠0) +``` diff --git a/src/complex-numbers/raising-universe-levels-complex-numbers.lagda.md b/src/complex-numbers/raising-universe-levels-complex-numbers.lagda.md index 7f1a217b26..663f517765 100644 --- a/src/complex-numbers/raising-universe-levels-complex-numbers.lagda.md +++ b/src/complex-numbers/raising-universe-levels-complex-numbers.lagda.md @@ -10,10 +10,13 @@ module complex-numbers.raising-universe-levels-complex-numbers where open import complex-numbers.complex-numbers open import complex-numbers.similarity-complex-numbers +open import foundation.action-on-identifications-functions open import foundation.dependent-pair-types +open import foundation.negated-equality open import foundation.universe-levels open import real-numbers.raising-universe-levels-real-numbers +open import real-numbers.rational-real-numbers ``` @@ -43,4 +46,16 @@ raise-ℂ l (a +iℂ b) = raise-ℝ l a +iℂ raise-ℝ l b abstract sim-raise-ℂ : {l1 : Level} (l2 : Level) (z : ℂ l1) → sim-ℂ z (raise-ℂ l2 z) sim-raise-ℂ l (a +iℂ b) = ( sim-raise-ℝ l a , sim-raise-ℝ l b) + +abstract + sim-raise-ℂ' : {l1 : Level} (l2 : Level) (z : ℂ l1) → sim-ℂ (raise-ℂ l2 z) z + sim-raise-ℂ' l2 z = symmetric-sim-ℂ (sim-raise-ℂ l2 z) +``` + +### `raise-ℂ l zero-ℂ ≠ raise-ℂ l one-ℂ` + +```agda +abstract + neq-raise-zero-one-ℂ : (l : Level) → raise-ℂ l zero-ℂ ≠ raise-ℂ l one-ℂ + neq-raise-zero-one-ℂ l 0=1ℂ = neq-raise-zero-one-ℝ l (ap re-ℂ 0=1ℂ) ``` diff --git a/src/elementary-number-theory.lagda.md b/src/elementary-number-theory.lagda.md index 5340946090..745734c2f2 100644 --- a/src/elementary-number-theory.lagda.md +++ b/src/elementary-number-theory.lagda.md @@ -158,6 +158,7 @@ open import elementary-number-theory.multiplicative-units-standard-cyclic-rings open import elementary-number-theory.multiset-coefficients public open import elementary-number-theory.natural-numbers public open import elementary-number-theory.negation-closed-intervals-rational-numbers public +open import elementary-number-theory.negative-closed-intervals-rational-numbers public open import elementary-number-theory.negative-integer-fractions public open import elementary-number-theory.negative-integers public open import elementary-number-theory.negative-rational-numbers public @@ -177,6 +178,7 @@ open import elementary-number-theory.poset-closed-intervals-rational-numbers pub open import elementary-number-theory.poset-of-natural-numbers-ordered-by-divisibility public open import elementary-number-theory.positive-and-negative-integers public open import elementary-number-theory.positive-and-negative-rational-numbers public +open import elementary-number-theory.positive-closed-intervals-rational-numbers public open import elementary-number-theory.positive-conatural-numbers public open import elementary-number-theory.positive-integer-fractions public open import elementary-number-theory.positive-integers public diff --git a/src/elementary-number-theory/multiplication-closed-intervals-rational-numbers.lagda.md b/src/elementary-number-theory/multiplication-closed-intervals-rational-numbers.lagda.md index 698a8adb82..e7d693281b 100644 --- a/src/elementary-number-theory/multiplication-closed-intervals-rational-numbers.lagda.md +++ b/src/elementary-number-theory/multiplication-closed-intervals-rational-numbers.lagda.md @@ -26,16 +26,19 @@ open import elementary-number-theory.minima-and-maxima-rational-numbers open import elementary-number-theory.minimum-rational-numbers open import elementary-number-theory.multiplication-negative-rational-numbers open import elementary-number-theory.multiplication-nonnegative-rational-numbers +open import elementary-number-theory.multiplication-positive-and-negative-rational-numbers open import elementary-number-theory.multiplication-positive-rational-numbers open import elementary-number-theory.multiplication-rational-numbers open import elementary-number-theory.multiplicative-group-of-positive-rational-numbers open import elementary-number-theory.multiplicative-group-of-rational-numbers open import elementary-number-theory.multiplicative-monoid-of-rational-numbers open import elementary-number-theory.negation-closed-intervals-rational-numbers +open import elementary-number-theory.negative-closed-intervals-rational-numbers open import elementary-number-theory.negative-rational-numbers open import elementary-number-theory.nonnegative-rational-numbers open import elementary-number-theory.poset-closed-intervals-rational-numbers open import elementary-number-theory.positive-and-negative-rational-numbers +open import elementary-number-theory.positive-closed-intervals-rational-numbers open import elementary-number-theory.positive-rational-numbers open import elementary-number-theory.proper-closed-intervals-rational-numbers open import elementary-number-theory.rational-numbers @@ -46,12 +49,14 @@ open import foundation.action-on-identifications-binary-functions open import foundation.action-on-identifications-functions open import foundation.binary-transport open import foundation.cartesian-product-types +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.function-extensionality open import foundation.function-types +open import foundation.functoriality-coproduct-types open import foundation.identity-types open import foundation.images-subtypes open import foundation.logical-equivalences @@ -1287,3 +1292,121 @@ abstract ( neg-ℚ⁰⁺ (nonnegative-square-ℚ q)) ( nonnegative-square-ℚ q)) ``` + +### If the product of `[a, b]` and `[c, d]` is positive, then `[a, b]` and `[c, d]` are both positive or both negative + +```agda +abstract + same-sign-lower-bounds-is-positive-mul-closed-interval-ℚ : + ([a,b] [c,d] : closed-interval-ℚ) → + is-positive-closed-interval-ℚ (mul-closed-interval-ℚ [a,b] [c,d]) → + ( ( is-negative-ℚ (lower-bound-closed-interval-ℚ [a,b]) × + is-negative-ℚ (lower-bound-closed-interval-ℚ [c,d])) + + ( is-positive-ℚ (lower-bound-closed-interval-ℚ [a,b]) × + is-positive-ℚ (lower-bound-closed-interval-ℚ [c,d]))) + same-sign-lower-bounds-is-positive-mul-closed-interval-ℚ + [a,b]@((a , b) , _) [c,d]@((c , d) , _) is-pos-lb = + same-sign-is-positive-mul-ℚ + ( is-positive-leq-ℚ⁺ + ( _ , is-pos-lb) + ( transitive-leq-ℚ _ _ _ (leq-left-min-ℚ _ _) (leq-left-min-ℚ _ _))) + + same-sign-lower-upper-bound-is-positive-mul-closed-interval-ℚ : + ([a,b] [c,d] : closed-interval-ℚ) → + is-positive-closed-interval-ℚ (mul-closed-interval-ℚ [a,b] [c,d]) → + ( ( is-negative-ℚ (lower-bound-closed-interval-ℚ [a,b]) × + is-negative-ℚ (upper-bound-closed-interval-ℚ [c,d])) + + ( is-positive-ℚ (lower-bound-closed-interval-ℚ [a,b]) × + is-positive-ℚ (upper-bound-closed-interval-ℚ [c,d]))) + same-sign-lower-upper-bound-is-positive-mul-closed-interval-ℚ + [a,b]@((a , b) , _) [c,d]@((c , d) , _) is-pos-lb = + same-sign-is-positive-mul-ℚ + ( is-positive-leq-ℚ⁺ + ( _ , is-pos-lb) + ( transitive-leq-ℚ _ _ _ + ( leq-right-min-ℚ _ _) + ( leq-left-min-ℚ _ _))) + + same-sign-upper-bounds-is-positive-mul-closed-interval-ℚ : + ([a,b] [c,d] : closed-interval-ℚ) → + is-positive-closed-interval-ℚ (mul-closed-interval-ℚ [a,b] [c,d]) → + ( ( is-negative-ℚ (upper-bound-closed-interval-ℚ [a,b]) × + is-negative-ℚ (upper-bound-closed-interval-ℚ [c,d])) + + ( is-positive-ℚ (upper-bound-closed-interval-ℚ [a,b]) × + is-positive-ℚ (upper-bound-closed-interval-ℚ [c,d]))) + same-sign-upper-bounds-is-positive-mul-closed-interval-ℚ + [a,b]@((a , b) , _) [c,d]@((c , d) , _) is-pos-lb = + same-sign-is-positive-mul-ℚ + ( is-positive-leq-ℚ⁺ + ( _ , is-pos-lb) + ( transitive-leq-ℚ _ _ _ + ( leq-right-min-ℚ _ _) + ( leq-right-min-ℚ _ _))) + + is-negative-upper-bound-right-factor-is-positive-mul-closed-interval-ℚ : + ([a,b] [c,d] : closed-interval-ℚ) → + is-positive-closed-interval-ℚ (mul-closed-interval-ℚ [a,b] [c,d]) → + is-negative-ℚ (lower-bound-closed-interval-ℚ [a,b]) → + is-negative-ℚ (upper-bound-closed-interval-ℚ [c,d]) + is-negative-upper-bound-right-factor-is-positive-mul-closed-interval-ℚ + [a,b]@((a , b) , _) [c,d]@((c , d) , _) is-pos-lb is-neg-a = + rec-coproduct + ( pr2) + ( λ (is-pos-a , _) → + ex-falso + ( is-not-negative-and-positive-ℚ (is-neg-a , is-pos-a))) + ( same-sign-lower-upper-bound-is-positive-mul-closed-interval-ℚ + ( [a,b]) + ( [c,d]) + ( is-pos-lb)) + + is-negative-upper-bound-left-factor-is-positive-mul-closed-interval-ℚ : + ([a,b] [c,d] : closed-interval-ℚ) → + is-positive-closed-interval-ℚ (mul-closed-interval-ℚ [a,b] [c,d]) → + is-negative-ℚ (lower-bound-closed-interval-ℚ [a,b]) → + is-negative-ℚ (upper-bound-closed-interval-ℚ [a,b]) + is-negative-upper-bound-left-factor-is-positive-mul-closed-interval-ℚ + [a,b]@((a , b) , _) [c,d]@((c , d) , _) is-pos-lb is-neg-a = + rec-coproduct + ( pr1) + ( λ (_ , is-pos-d) → + ex-falso + ( is-not-negative-and-positive-ℚ + ( is-negative-upper-bound-right-factor-is-positive-mul-closed-interval-ℚ + ( [a,b]) + ( [c,d]) + ( is-pos-lb) + ( is-neg-a) , + is-pos-d))) + ( same-sign-upper-bounds-is-positive-mul-closed-interval-ℚ + ( [a,b]) + ( [c,d]) + ( is-pos-lb)) + + same-sign-is-positive-mul-closed-interval-ℚ : + ([a,b] [c,d] : closed-interval-ℚ) → + is-positive-closed-interval-ℚ (mul-closed-interval-ℚ [a,b] [c,d]) → + ( ( is-negative-closed-interval-ℚ [a,b] × + is-negative-closed-interval-ℚ [c,d]) + + ( is-positive-closed-interval-ℚ [a,b] × + is-positive-closed-interval-ℚ [c,d])) + same-sign-is-positive-mul-closed-interval-ℚ + [a,b]@((a , b) , _) [c,d]@((c , d) , _) is-pos-lb = + map-coproduct + ( λ (is-neg-a , is-neg-c) → + ( is-negative-upper-bound-left-factor-is-positive-mul-closed-interval-ℚ + ( [a,b]) + ( [c,d]) + ( is-pos-lb) + ( is-neg-a) , + is-negative-upper-bound-right-factor-is-positive-mul-closed-interval-ℚ + ( [a,b]) + ( [c,d]) + ( is-pos-lb) + ( is-neg-a))) + ( id) + ( same-sign-lower-bounds-is-positive-mul-closed-interval-ℚ + ( [a,b]) + ( [c,d]) + ( is-pos-lb)) +``` diff --git a/src/elementary-number-theory/multiplication-positive-and-negative-rational-numbers.lagda.md b/src/elementary-number-theory/multiplication-positive-and-negative-rational-numbers.lagda.md index 4cbe0a9111..1c3ee2661d 100644 --- a/src/elementary-number-theory/multiplication-positive-and-negative-rational-numbers.lagda.md +++ b/src/elementary-number-theory/multiplication-positive-and-negative-rational-numbers.lagda.md @@ -21,6 +21,7 @@ open import foundation.cartesian-product-types open import foundation.coproduct-types open import foundation.dependent-pair-types open import foundation.empty-types +open import foundation.functoriality-coproduct-types open import foundation.identity-types open import foundation.transport-along-identifications ``` @@ -169,3 +170,32 @@ abstract ( y≠0) ( λ is-pos-y → inr (is-pos-x , is-pos-y))) ``` + +### If `xy` is negative, one of `x` and `y` is positive and the other negative + +```agda +abstract + different-signs-is-negative-mul-ℚ : + {x y : ℚ} → is-negative-ℚ (x *ℚ y) → + ( ( is-positive-ℚ x × is-negative-ℚ y) + + ( is-negative-ℚ x × is-positive-ℚ y)) + different-signs-is-negative-mul-ℚ {x} {y} is-neg-xy = + map-coproduct + ( λ (is-neg-neg-x , is-neg-y) → + ( tr + ( is-positive-ℚ) + ( neg-neg-ℚ x) + ( is-positive-neg-is-negative-ℚ is-neg-neg-x) , + is-neg-y)) + ( λ (is-pos-neg-x , is-pos-y) → + ( tr + ( is-negative-ℚ) + ( neg-neg-ℚ x) + ( is-negative-neg-is-positive-ℚ is-pos-neg-x) , + is-pos-y)) + ( same-sign-is-positive-mul-ℚ + ( inv-tr + ( is-positive-ℚ) + ( left-negative-law-mul-ℚ x y) + ( is-positive-neg-is-negative-ℚ is-neg-xy))) +``` diff --git a/src/elementary-number-theory/negative-closed-intervals-rational-numbers.lagda.md b/src/elementary-number-theory/negative-closed-intervals-rational-numbers.lagda.md new file mode 100644 index 0000000000..8edcc43209 --- /dev/null +++ b/src/elementary-number-theory/negative-closed-intervals-rational-numbers.lagda.md @@ -0,0 +1,45 @@ +# Negative closed intervals in the rational numbers + +```agda +module elementary-number-theory.negative-closed-intervals-rational-numbers where +``` + +
Imports + +```agda +open import elementary-number-theory.closed-intervals-rational-numbers +open import elementary-number-theory.negative-rational-numbers + +open import foundation.dependent-pair-types +open import foundation.propositions +open import foundation.universe-levels +``` + +
+ +## Idea + +A +[closed interval](elementary-number-theory.closed-intervals-rational-numbers.md) +of [rational numbers](elementary-number-theory.rational-numbers.md) is +{{#concept "negative" Disambiguation="closed intervals in ℚ" Agda=is-negative-closed-interval-ℚ}} +if every element in it is +[negative](elementary-number-theory.negative-rational-numbers.md), or +equivalently, its upper bound is negative. + +## Definition + +```agda +is-negative-prop-closed-interval-ℚ : closed-interval-ℚ → Prop lzero +is-negative-prop-closed-interval-ℚ ((a , b) , _) = is-negative-prop-ℚ b + +is-negative-closed-interval-ℚ : closed-interval-ℚ → UU lzero +is-negative-closed-interval-ℚ ((a , b) , _) = is-negative-ℚ b + +abstract + is-negative-lower-bound-is-negative-closed-interval-ℚ : + ([a,b] : closed-interval-ℚ) → is-negative-closed-interval-ℚ [a,b] → + is-negative-ℚ (lower-bound-closed-interval-ℚ [a,b]) + is-negative-lower-bound-is-negative-closed-interval-ℚ ((a , b) , a≤b) neg-b = + is-negative-leq-ℚ⁻ (b , neg-b) a≤b +``` diff --git a/src/elementary-number-theory/positive-closed-intervals-rational-numbers.lagda.md b/src/elementary-number-theory/positive-closed-intervals-rational-numbers.lagda.md new file mode 100644 index 0000000000..34f5a28c48 --- /dev/null +++ b/src/elementary-number-theory/positive-closed-intervals-rational-numbers.lagda.md @@ -0,0 +1,45 @@ +# Positive closed intervals in the rational numbers + +```agda +module elementary-number-theory.positive-closed-intervals-rational-numbers where +``` + +
Imports + +```agda +open import elementary-number-theory.closed-intervals-rational-numbers +open import elementary-number-theory.positive-rational-numbers + +open import foundation.dependent-pair-types +open import foundation.propositions +open import foundation.universe-levels +``` + +
+ +## Idea + +A +[closed interval](elementary-number-theory.closed-intervals-rational-numbers.md) +of [rational numbers](elementary-number-theory.rational-numbers.md) is +{{#concept "positive" Disambiguation="closed intervals in ℚ" Agda=is-positive-closed-interval-ℚ}} +if every element in it is +[positive](elementary-number-theory.positive-rational-numbers.md), or +equivalently, its lower bound is positive. + +## Definition + +```agda +is-positive-prop-closed-interval-ℚ : closed-interval-ℚ → Prop lzero +is-positive-prop-closed-interval-ℚ ((a , b) , _) = is-positive-prop-ℚ a + +is-positive-closed-interval-ℚ : closed-interval-ℚ → UU lzero +is-positive-closed-interval-ℚ ((a , b) , _) = is-positive-ℚ a + +abstract + is-positive-upper-bound-is-positive-closed-interval-ℚ : + ([a,b] : closed-interval-ℚ) → is-positive-closed-interval-ℚ [a,b] → + is-positive-ℚ (upper-bound-closed-interval-ℚ [a,b]) + is-positive-upper-bound-is-positive-closed-interval-ℚ ((a , b) , a≤b) pos-a = + is-positive-leq-ℚ⁺ (a , pos-a) a≤b +``` diff --git a/src/linear-algebra.lagda.md b/src/linear-algebra.lagda.md index bc84732dbb..9c1cd311ee 100644 --- a/src/linear-algebra.lagda.md +++ b/src/linear-algebra.lagda.md @@ -5,6 +5,7 @@ ```agda module linear-algebra where +open import linear-algebra.complex-vector-spaces public open import linear-algebra.constant-matrices public open import linear-algebra.constant-tuples public open import linear-algebra.dependent-products-left-modules-commutative-rings public diff --git a/src/linear-algebra/complex-vector-spaces.lagda.md b/src/linear-algebra/complex-vector-spaces.lagda.md new file mode 100644 index 0000000000..1cf1d509ad --- /dev/null +++ b/src/linear-algebra/complex-vector-spaces.lagda.md @@ -0,0 +1,168 @@ +# Complex vector spaces + +```agda +module linear-algebra.complex-vector-spaces where +``` + +
Imports + +```agda +open import complex-numbers.addition-complex-numbers +open import complex-numbers.complex-numbers +open import complex-numbers.field-of-complex-numbers +open import complex-numbers.multiplication-complex-numbers +open import complex-numbers.raising-universe-levels-complex-numbers + +open import foundation.identity-types +open import foundation.sets +open import foundation.universe-levels + +open import group-theory.abelian-groups + +open import linear-algebra.vector-spaces +``` + +
+ +## Idea + +A +{{#concept "complex vector space" WD="complex vector space" WDID=Q5156614 Agda=ℂ-Vector-Space}} +is a [vector space](linear-algebra.vector-spaces.md) over the +[Heyting field of complex numbers](complex-numbers.field-of-complex-numbers.md). + +## Definition + +```agda +ℂ-Vector-Space : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) +ℂ-Vector-Space l1 l2 = Vector-Space l2 (heyting-field-ℂ l1) +``` + +## Properties + +```agda +module _ + {l1 l2 : Level} (V : ℂ-Vector-Space l1 l2) + where + + ab-ℂ-Vector-Space : Ab l2 + ab-ℂ-Vector-Space = ab-Vector-Space (heyting-field-ℂ l1) V + + set-ℂ-Vector-Space : Set l2 + set-ℂ-Vector-Space = set-Ab ab-ℂ-Vector-Space + + type-ℂ-Vector-Space : UU l2 + type-ℂ-Vector-Space = type-Ab ab-ℂ-Vector-Space + + add-ℂ-Vector-Space : + type-ℂ-Vector-Space → type-ℂ-Vector-Space → type-ℂ-Vector-Space + add-ℂ-Vector-Space = add-Ab ab-ℂ-Vector-Space + + zero-ℂ-Vector-Space : type-ℂ-Vector-Space + zero-ℂ-Vector-Space = zero-Ab ab-ℂ-Vector-Space + + neg-ℂ-Vector-Space : type-ℂ-Vector-Space → type-ℂ-Vector-Space + neg-ℂ-Vector-Space = neg-Ab ab-ℂ-Vector-Space + + mul-ℂ-Vector-Space : ℂ l1 → type-ℂ-Vector-Space → type-ℂ-Vector-Space + mul-ℂ-Vector-Space = mul-Vector-Space (heyting-field-ℂ l1) V + + associative-add-ℂ-Vector-Space : + (v w x : type-ℂ-Vector-Space) → + add-ℂ-Vector-Space (add-ℂ-Vector-Space v w) x = + add-ℂ-Vector-Space v (add-ℂ-Vector-Space w x) + associative-add-ℂ-Vector-Space = associative-add-Ab ab-ℂ-Vector-Space + + left-unit-law-add-ℂ-Vector-Space : + (v : type-ℂ-Vector-Space) → add-ℂ-Vector-Space zero-ℂ-Vector-Space v = v + left-unit-law-add-ℂ-Vector-Space = left-unit-law-add-Ab ab-ℂ-Vector-Space + + right-unit-law-add-ℂ-Vector-Space : + (v : type-ℂ-Vector-Space) → add-ℂ-Vector-Space v zero-ℂ-Vector-Space = v + right-unit-law-add-ℂ-Vector-Space = right-unit-law-add-Ab ab-ℂ-Vector-Space + + left-inverse-law-add-ℂ-Vector-Space : + (v : type-ℂ-Vector-Space) → + add-ℂ-Vector-Space (neg-ℂ-Vector-Space v) v = zero-ℂ-Vector-Space + left-inverse-law-add-ℂ-Vector-Space = + left-inverse-law-add-Ab ab-ℂ-Vector-Space + + right-inverse-law-add-ℂ-Vector-Space : + (v : type-ℂ-Vector-Space) → + add-ℂ-Vector-Space v (neg-ℂ-Vector-Space v) = zero-ℂ-Vector-Space + right-inverse-law-add-ℂ-Vector-Space = + right-inverse-law-add-Ab ab-ℂ-Vector-Space + + commutative-add-ℂ-Vector-Space : + (v w : type-ℂ-Vector-Space) → + add-ℂ-Vector-Space v w = add-ℂ-Vector-Space w v + commutative-add-ℂ-Vector-Space = commutative-add-Ab ab-ℂ-Vector-Space + + left-unit-law-mul-ℂ-Vector-Space : + (v : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space (raise-ℂ l1 one-ℂ) v = v + left-unit-law-mul-ℂ-Vector-Space = + left-unit-law-mul-Vector-Space (heyting-field-ℂ l1) V + + left-distributive-mul-add-ℂ-Vector-Space : + (r : ℂ l1) (v w : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space r (add-ℂ-Vector-Space v w) = + add-ℂ-Vector-Space (mul-ℂ-Vector-Space r v) (mul-ℂ-Vector-Space r w) + left-distributive-mul-add-ℂ-Vector-Space = + left-distributive-mul-add-Vector-Space (heyting-field-ℂ l1) V + + right-distributive-mul-add-ℂ-Vector-Space : + (r s : ℂ l1) (v : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space (r +ℂ s) v = + add-ℂ-Vector-Space (mul-ℂ-Vector-Space r v) (mul-ℂ-Vector-Space s v) + right-distributive-mul-add-ℂ-Vector-Space = + right-distributive-mul-add-Vector-Space (heyting-field-ℂ l1) V + + associative-mul-ℂ-Vector-Space : + (r s : ℂ l1) (v : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space (r *ℂ s) v = + mul-ℂ-Vector-Space r (mul-ℂ-Vector-Space s v) + associative-mul-ℂ-Vector-Space = + associative-mul-Vector-Space (heyting-field-ℂ l1) V + + left-zero-law-mul-ℂ-Vector-Space : + (v : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space (raise-ℂ l1 zero-ℂ) v = zero-ℂ-Vector-Space + left-zero-law-mul-ℂ-Vector-Space = + left-zero-law-mul-Vector-Space (heyting-field-ℂ l1) V + + right-zero-law-mul-ℂ-Vector-Space : + (r : ℂ l1) → + mul-ℂ-Vector-Space r zero-ℂ-Vector-Space = zero-ℂ-Vector-Space + right-zero-law-mul-ℂ-Vector-Space = + right-zero-law-mul-Vector-Space (heyting-field-ℂ l1) V + + left-negative-law-mul-ℂ-Vector-Space : + (r : ℂ l1) (v : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space (neg-ℂ r) v = + neg-ℂ-Vector-Space (mul-ℂ-Vector-Space r v) + left-negative-law-mul-ℂ-Vector-Space = + left-negative-law-mul-Vector-Space (heyting-field-ℂ l1) V + + right-negative-law-mul-ℂ-Vector-Space : + (r : ℂ l1) (v : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space r (neg-ℂ-Vector-Space v) = + neg-ℂ-Vector-Space (mul-ℂ-Vector-Space r v) + right-negative-law-mul-ℂ-Vector-Space = + right-negative-law-mul-Vector-Space (heyting-field-ℂ l1) V + + mul-neg-one-ℂ-Vector-Space : + (v : type-ℂ-Vector-Space) → + mul-ℂ-Vector-Space (neg-ℂ (raise-ℂ l1 one-ℂ)) v = neg-ℂ-Vector-Space v + mul-neg-one-ℂ-Vector-Space = + mul-neg-one-Vector-Space (heyting-field-ℂ l1) V +``` + +### The complex numbers are a complex vector space + +```agda +complex-vector-space-ℂ : (l : Level) → ℂ-Vector-Space l (lsuc l) +complex-vector-space-ℂ l = + vector-space-heyting-field-Heyting-Field + ( heyting-field-ℂ l) +``` diff --git a/src/real-numbers/local-ring-of-real-numbers.lagda.md b/src/real-numbers/local-ring-of-real-numbers.lagda.md index e0445ee319..2175276a23 100644 --- a/src/real-numbers/local-ring-of-real-numbers.lagda.md +++ b/src/real-numbers/local-ring-of-real-numbers.lagda.md @@ -18,6 +18,7 @@ open import foundation.universe-levels open import real-numbers.addition-nonzero-real-numbers open import real-numbers.addition-real-numbers open import real-numbers.large-ring-of-real-numbers +open import real-numbers.multiplication-nonzero-real-numbers open import real-numbers.multiplicative-inverses-nonzero-real-numbers open import real-numbers.nonzero-real-numbers ``` diff --git a/src/real-numbers/multiplication-nonzero-real-numbers.lagda.md b/src/real-numbers/multiplication-nonzero-real-numbers.lagda.md index 5f6c869630..42ea33baba 100644 --- a/src/real-numbers/multiplication-nonzero-real-numbers.lagda.md +++ b/src/real-numbers/multiplication-nonzero-real-numbers.lagda.md @@ -9,18 +9,29 @@ module real-numbers.multiplication-nonzero-real-numbers where
Imports ```agda +open import commutative-algebra.invertible-elements-commutative-rings + +open import foundation.cartesian-product-types +open import foundation.conjunction open import foundation.dependent-pair-types open import foundation.disjunction open import foundation.function-types +open import foundation.functoriality-cartesian-product-types +open import foundation.transport-along-identifications open import foundation.universe-levels open import real-numbers.dedekind-real-numbers +open import real-numbers.large-ring-of-real-numbers open import real-numbers.multiplication-negative-real-numbers open import real-numbers.multiplication-positive-and-negative-real-numbers open import real-numbers.multiplication-positive-real-numbers open import real-numbers.multiplication-real-numbers open import real-numbers.multiplicative-inverses-nonzero-real-numbers open import real-numbers.nonzero-real-numbers +open import real-numbers.positive-real-numbers +open import real-numbers.raising-universe-levels-real-numbers +open import real-numbers.rational-real-numbers +open import real-numbers.similarity-real-numbers ```
@@ -66,3 +77,76 @@ mul-nonzero-ℝ : mul-nonzero-ℝ (x , x#0) (y , y#0) = ( x *ℝ y , is-nonzero-mul-ℝ x#0 y#0) ``` + +## Properties + +### If the product of two real numbers is nonzero, they are both nonzero + +```agda +module _ + {l1 l2 : Level} + (x : ℝ l1) + (y : ℝ l2) + where + + abstract + is-nonzero-factors-is-nonzero-mul-ℝ : + is-nonzero-ℝ (x *ℝ y) → is-nonzero-ℝ x × is-nonzero-ℝ y + is-nonzero-factors-is-nonzero-mul-ℝ = + let + motive = is-nonzero-prop-ℝ x ∧ is-nonzero-prop-ℝ y + in + elim-disjunction + ( motive) + ( λ xy<0 → + elim-disjunction + ( motive) + ( map-product inr-disjunction inl-disjunction) + ( map-product inl-disjunction inr-disjunction) + ( different-signs-is-negative-mul-ℝ x y xy<0)) + ( λ 0Imports ```agda +open import elementary-number-theory.inequality-rational-numbers +open import elementary-number-theory.minimum-rational-numbers +open import elementary-number-theory.multiplication-closed-intervals-rational-numbers +open import elementary-number-theory.multiplication-rational-numbers +open import elementary-number-theory.positive-rational-numbers +open import elementary-number-theory.strict-inequality-rational-numbers + +open import foundation.conjunction +open import foundation.coproduct-types open import foundation.dependent-pair-types +open import foundation.disjunction +open import foundation.existential-quantification +open import foundation.function-types +open import foundation.functoriality-cartesian-product-types +open import foundation.functoriality-disjunction +open import foundation.propositional-truncations open import foundation.transport-along-identifications open import foundation.universe-levels +open import order-theory.posets + open import real-numbers.dedekind-real-numbers open import real-numbers.multiplication-positive-real-numbers open import real-numbers.multiplication-real-numbers +open import real-numbers.negation-real-numbers open import real-numbers.negative-real-numbers +open import real-numbers.positive-and-negative-real-numbers open import real-numbers.positive-real-numbers open import real-numbers.rational-real-numbers open import real-numbers.strict-inequality-real-numbers @@ -70,3 +91,72 @@ mul-negative-positive-ℝ : mul-negative-positive-ℝ (x , is-neg-x) (y , is-pos-y) = ( x *ℝ y , is-negative-mul-negative-positive-ℝ is-neg-x is-pos-y) ``` + +### If the product of two real numbers is positive, both are negative or both are positive + +```agda +abstract opaque + unfolding mul-ℝ + + same-sign-is-positive-mul-ℝ : + {l1 l2 : Level} (x : ℝ l1) (y : ℝ l2) → is-positive-ℝ (x *ℝ y) → + type-disjunction-Prop + ( is-negative-prop-ℝ x ∧ is-negative-prop-ℝ y) + ( is-positive-prop-ℝ x ∧ is-positive-prop-ℝ y) + same-sign-is-positive-mul-ℝ x y 0