From 6a14c46bd5cb66d790a3ce61f590ecf7daf72bfa Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 21:14:48 +0200 Subject: [PATCH 01/67] subsequences --- src/elementary-number-theory.lagda.md | 1 + ...onotonic-endomaps-natural-numbers.lagda.md | 206 ++++++++++++++++++ src/foundation.lagda.md | 3 + ...asymptotically-constant-sequences.lagda.md | 134 ++++++++++++ .../asymptotically-equal-sequences.lagda.md | 91 ++++++++ src/foundation/subsequences.lagda.md | 108 +++++++++ 6 files changed, 543 insertions(+) create mode 100644 src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md create mode 100644 src/foundation/asymptotically-constant-sequences.lagda.md create mode 100644 src/foundation/asymptotically-equal-sequences.lagda.md create mode 100644 src/foundation/subsequences.lagda.md diff --git a/src/elementary-number-theory.lagda.md b/src/elementary-number-theory.lagda.md index 92bf495587..aaee3dd1ee 100644 --- a/src/elementary-number-theory.lagda.md +++ b/src/elementary-number-theory.lagda.md @@ -88,6 +88,7 @@ open import elementary-number-theory.modular-arithmetic public open import elementary-number-theory.modular-arithmetic-standard-finite-types public open import elementary-number-theory.monoid-of-natural-numbers-with-addition public open import elementary-number-theory.monoid-of-natural-numbers-with-maximum public +open import elementary-number-theory.monotonic-endomaps-natural-numbers public open import elementary-number-theory.multiplication-integer-fractions public open import elementary-number-theory.multiplication-integers public open import elementary-number-theory.multiplication-lists-of-natural-numbers public diff --git a/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md new file mode 100644 index 0000000000..708bdadd7a --- /dev/null +++ b/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md @@ -0,0 +1,206 @@ +# Monotonic endomaps of natural numbers + +```agda +module elementary-number-theory.monotonic-endomaps-natural-numbers where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-inequality-natural-numbers +open import elementary-number-theory.well-ordering-principle-natural-numbers + +open import foundation.dependent-pair-types +open import foundation.empty-types +open import foundation.function-types +open import foundation.functoriality-dependent-pair-types +open import foundation.negation +open import foundation.propositions +open import foundation.universe-levels +``` + +
+ +## Idea + +Monotic endomaps of natural numbers are functions `f : ℕ → ℕ` that preserves or +reverse (strict) inequality of natural numbers. + +## Definitions + +### Increasing endomaps of natural numbers + +```agda +module _ + (f : ℕ → ℕ) + where + + is-increasing-endomap-prop-ℕ : Prop lzero + is-increasing-endomap-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f i) (f j)))) + + is-increasing-endomap-ℕ : UU lzero + is-increasing-endomap-ℕ = + type-Prop is-increasing-endomap-prop-ℕ + + is-prop-is-increasing-endomap-ℕ : + is-prop is-increasing-endomap-ℕ + is-prop-is-increasing-endomap-ℕ = + is-prop-type-Prop is-increasing-endomap-prop-ℕ +``` + +### Strictly increasing endomaps of natural numbers + +```agda +module _ + (f : ℕ → ℕ) + where + + is-strictly-increasing-endomap-prop-ℕ : Prop lzero + is-strictly-increasing-endomap-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f i) (f j)))) + + is-strictly-increasing-endomap-ℕ : UU lzero + is-strictly-increasing-endomap-ℕ = + type-Prop is-strictly-increasing-endomap-prop-ℕ + + is-prop-is-strictly-increasing-endomap-ℕ : + is-prop is-strictly-increasing-endomap-ℕ + is-prop-is-strictly-increasing-endomap-ℕ = + is-prop-type-Prop is-strictly-increasing-endomap-prop-ℕ +``` + +### Decreasing endomaps of natural numbers + +```agda +module _ + (f : ℕ → ℕ) + where + + is-decreasing-endomap-prop-ℕ : Prop lzero + is-decreasing-endomap-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f j) (f i)))) + + is-decreasing-endomap-ℕ : UU lzero + is-decreasing-endomap-ℕ = type-Prop is-decreasing-endomap-prop-ℕ + + is-prop-is-decreasing-endomap-ℕ : is-prop is-decreasing-endomap-ℕ + is-prop-is-decreasing-endomap-ℕ = + is-prop-type-Prop is-decreasing-endomap-prop-ℕ +``` + +### Stritcly decreasing endomaps of natural numbers + +```agda +module _ + (f : ℕ → ℕ) + where + + is-strictly-decreasing-endomap-prop-ℕ : Prop lzero + is-strictly-decreasing-endomap-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) + + is-strictly-decreasing-endomap-ℕ : UU lzero + is-strictly-decreasing-endomap-ℕ = + type-Prop is-strictly-decreasing-endomap-prop-ℕ + + is-prop-is-strictly-decreasing-endomap-ℕ : + is-prop is-strictly-decreasing-endomap-ℕ + is-prop-is-strictly-decreasing-endomap-ℕ = + is-prop-type-Prop is-strictly-decreasing-endomap-prop-ℕ +``` + +## Properties + +### There exist no strictly decreasing endomaps of natural numbers + +```agda +no-strictly-decreasing-endomap-leq-ℕ : + (f : ℕ → ℕ) → + (N : ℕ) → + is-strictly-decreasing-endomap-ℕ f → + leq-ℕ (f zero-ℕ) N → + empty +no-strictly-decreasing-endomap-leq-ℕ f zero-ℕ H = + concatenate-le-leq-ℕ + { f 1} + { f 0} + { 0} + ( H 0 1 (succ-le-ℕ 0)) +no-strictly-decreasing-endomap-leq-ℕ f (succ-ℕ N) H K = + no-strictly-decreasing-endomap-leq-ℕ + ( f ∘ succ-ℕ) + ( N) + ( λ i j → H (succ-ℕ i) (succ-ℕ j)) + ( leq-le-succ-ℕ + ( f 1) + ( N) + ( concatenate-le-leq-ℕ + { f 1} + { f 0} + { succ-ℕ N} + ( H 0 1 (succ-le-ℕ 0)) + ( K))) + +no-strictly-decreasing-endomap-ℕ : + (f : ℕ → ℕ) → ¬ (is-strictly-decreasing-endomap-ℕ f) +no-strictly-decreasing-endomap-ℕ f H = + no-strictly-decreasing-endomap-leq-ℕ f (f 0) H (refl-leq-ℕ (f 0)) +``` + +### Strictly increasing endomaps of natural numbers grow infinitely + +```agda +module _ + (f : ℕ → ℕ) (H : is-strictly-increasing-endomap-ℕ f) + where + + limit-∞-is-strictly-increasing-endomap-ℕ : + (M : ℕ) → Σ ℕ (λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ M (f p)) + limit-∞-is-strictly-increasing-endomap-ℕ zero-ℕ = + ( zero-ℕ , λ p K → leq-zero-ℕ (f p)) + limit-∞-is-strictly-increasing-endomap-ℕ (succ-ℕ M) = + map-Σ + ( λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ (succ-ℕ M) (f p)) + ( succ-ℕ) + ( λ N K p I → + leq-succ-le-ℕ M (f p) + (concatenate-leq-le-ℕ + { M} + { f N} + { f p} + ( K N (refl-leq-ℕ N)) + ( H N p + ( concatenate-le-leq-ℕ + { N} + { succ-ℕ N} + { p} + ( succ-le-ℕ N) + ( I))))) + ( limit-∞-is-strictly-increasing-endomap-ℕ M) + + modulus-limit-∞-is-strictly-increasing-endomap-ℕ : ℕ → ℕ + modulus-limit-∞-is-strictly-increasing-endomap-ℕ M = + pr1 (limit-∞-is-strictly-increasing-endomap-ℕ M) + + is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ : + (M p : ℕ) → + leq-ℕ (modulus-limit-∞-is-strictly-increasing-endomap-ℕ M) p → + leq-ℕ M (f p) + is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ M = + pr2 (limit-∞-is-strictly-increasing-endomap-ℕ M) +``` diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index 563cc1c995..6679157c6f 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -26,6 +26,8 @@ open import foundation.action-on-identifications-functions public open import foundation.apartness-relations public open import foundation.arithmetic-law-coproduct-and-sigma-decompositions public open import foundation.arithmetic-law-product-and-pi-decompositions public +open import foundation.asymptotically-constant-sequences public +open import foundation.asymptotically-equal-sequences public open import foundation.automorphisms public open import foundation.axiom-of-choice public open import foundation.bands public @@ -369,6 +371,7 @@ open import foundation.strongly-extensional-maps public open import foundation.structure public open import foundation.structure-identity-principle public open import foundation.structured-type-duality public +open import foundation.subsequences public open import foundation.subsingleton-induction public open import foundation.subterminal-types public open import foundation.subtype-duality public diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md new file mode 100644 index 0000000000..d439e6ff36 --- /dev/null +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -0,0 +1,134 @@ +# Aymptotically constant Sequences + +```agda +module foundation.asymptotically-constant-sequences where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.monotonic-endomaps-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.asymptotically-equal-sequences +open import foundation.dependent-pair-types +open import foundation.functoriality-dependent-pair-types +open import foundation.identity-types +open import foundation.sequences +open import foundation.subsequences +open import foundation.universe-levels +``` + +
+ +## Idea + +A sequence `u` is **asymptotically constant** if `u p = u q` for sufficiently +large `p` and `q`. + +## Definition + +### Asymptotically constant sequences + +```agda +module _ + {l : Level} {A : UU l} + where + + is-modulus-∞-constant-sequence : (u : sequence A) (N : ℕ) → UU l + is-modulus-∞-constant-sequence u N = + (p q : ℕ) → leq-ℕ N p → leq-ℕ N q → (u p) = (u q) + + is-∞-constant-sequence : (u : sequence A) → UU l + is-∞-constant-sequence u = Σ ℕ (is-modulus-∞-constant-sequence u) +``` + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) + where + + modulus-∞-constant-sequence : ℕ + modulus-∞-constant-sequence = pr1 H + + is-modulus-modulus-∞-constant-sequence : + is-modulus-∞-constant-sequence u modulus-∞-constant-sequence + is-modulus-modulus-∞-constant-sequence = pr2 H +``` + +## Properties + +### The asymptotical value of an asymptotically constant sequence + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) + where + + ∞-value-∞-constant-sequence : A + ∞-value-∞-constant-sequence = u (modulus-∞-constant-sequence u H) +``` + +### An asymptotically constant sequence is asymptotically equal to the constant sequence of its asymptotical value + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) + where + + eq-∞-constant-sequence : + eq-∞-sequence (λ n → ∞-value-∞-constant-sequence u H) u + eq-∞-constant-sequence = + ( modulus-∞-constant-sequence u H) , + ( λ n → + is-modulus-modulus-∞-constant-sequence u H + ( modulus-∞-constant-sequence u H) + ( n) + (refl-leq-ℕ (modulus-∞-constant-sequence u H))) +``` + +### A subsequence of an asymptotically constant sequence is asymptotically constant + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (v : subsequence u) + where + + is-∞-constant-subsequence : + is-∞-constant-sequence u → is-∞-constant-sequence (sequence-subsequence u v) + is-∞-constant-subsequence = + map-Σ + ( is-modulus-∞-constant-sequence (sequence-subsequence u v)) + ( modulus-limit-∞-is-strictly-increasing-endomap-ℕ + ( extract-subsequence u v) + ( is-strictly-increasing-extract-subsequence u v)) + ( λ N K p q I J → + K + ( extract-subsequence u v p) + ( extract-subsequence u v q) + ( is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ + ( extract-subsequence u v) + ( is-strictly-increasing-extract-subsequence u v) + ( N) + ( p) + ( I)) + ( is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ + ( extract-subsequence u v) + ( is-strictly-increasing-extract-subsequence u v) + ( N) + ( q) + ( J))) +``` + +### A sequence is asymptotically constant if all its subsequences are asymptotically constant + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + (H : (v : subsequence u) → is-∞-constant-sequence (sequence-subsequence u v)) + where + + is-∞-constant-is-∞-constant-subsequence : is-∞-constant-sequence u + is-∞-constant-is-∞-constant-subsequence = H (refl-subsequence u) +``` diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md new file mode 100644 index 0000000000..a871d593e2 --- /dev/null +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -0,0 +1,91 @@ +# Asymptotically equal sequences + +```agda +module foundation.asymptotically-equal-sequences where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.maximum-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.dependent-pair-types +open import foundation.functoriality-dependent-pair-types +open import foundation.identity-types +open import foundation.sequences +open import foundation.universe-levels + +open import foundation-core.function-types +``` + +
+ +## Idea + +Two squences `u` and `v` are **asymptotically equal** if `u n = v n` for any +sufficiently large natural number `n`. + +## Definition + +### The relation of being asymptotically equal sequences + +```agda +module _ + {l : Level} {A : UU l} (u v : sequence A) + where + + is-modulus-eq-∞-sequence : ℕ → UU l + is-modulus-eq-∞-sequence N = (m : ℕ) → leq-ℕ N m → u m = v m + + eq-∞-sequence : UU l + eq-∞-sequence = Σ ℕ is-modulus-eq-∞-sequence +``` + +## Properties + +### Any sequence is asymptotically equal to itself + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + refl-eq-∞-sequence : eq-∞-sequence u u + pr1 refl-eq-∞-sequence = zero-ℕ + pr2 refl-eq-∞-sequence m H = refl +``` + +### Asymptotically equality is a symmetric relation + +```agda +module _ + {l : Level} {A : UU l} (u v : sequence A) + where + + symmetric-eq-∞-sequence : eq-∞-sequence u v → eq-∞-sequence v u + symmetric-eq-∞-sequence = + map-Σ + ( is-modulus-eq-∞-sequence v u) + ( id) + ( λ N H m K → inv (H m K)) +``` + +### Asymptotically equality equal is a transitive relation + +```agda +module _ + {l : Level} {A : UU l} (u v w : sequence A) + where + + transitive-eq-∞-sequence : + eq-∞-sequence v w → + eq-∞-sequence u v → + eq-∞-sequence u w + transitive-eq-∞-sequence (n , H) (m , K) = + ( max-ℕ m n) , + ( λ p I → + ( K p (leq-left-leq-max-ℕ p m n I)) ∙ + ( H p (leq-right-leq-max-ℕ p m n I))) +``` diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md new file mode 100644 index 0000000000..d9356bbdf4 --- /dev/null +++ b/src/foundation/subsequences.lagda.md @@ -0,0 +1,108 @@ +# Subsequences + +```agda +module foundation.subsequences where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.monotonic-endomaps-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-inequality-natural-numbers + +open import foundation.dependent-pair-types +open import foundation.function-extensionality +open import foundation.function-types +open import foundation.functoriality-dependent-pair-types +open import foundation.homotopies +open import foundation.identity-types +open import foundation.propositions +open import foundation.sequences +open import foundation.subtypes +open import foundation.universe-levels +``` + +
+ +## Idea + +A **subsequence** of of a [sequence](foundation.sequences.md) `u : ℕ → A` is a +sequence `u ∘ f` for some +[strictly increasing](elementary-number-theory.monotonic-endomaps-natural-numbers.md) +map `f : ℕ → ℕ`. + +## Definition + +### Subsequences + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + subsequence : UU lzero + subsequence = type-subtype is-strictly-increasing-endomap-prop-ℕ +``` + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (v : subsequence u) + where + + extract-subsequence : ℕ → ℕ + extract-subsequence = pr1 v + + is-strictly-increasing-extract-subsequence : + is-strictly-increasing-endomap-ℕ extract-subsequence + is-strictly-increasing-extract-subsequence = pr2 v + + sequence-subsequence : sequence A + sequence-subsequence n = u (extract-subsequence n) +``` + +## Properties + +### Any sequence is a subsequence of itself + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + refl-subsequence : subsequence u + refl-subsequence = (id , λ i j → id) + + eq-refl-subsequence : sequence-subsequence u refl-subsequence = u + eq-refl-subsequence = refl +``` + +### A subsequence of a subsequence is a subsequence of the original sequence + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (v : subsequence u) + (w : subsequence (sequence-subsequence u v)) + where + + sub-subsequence : subsequence u + pr1 sub-subsequence = + extract-subsequence u v ∘ extract-subsequence (sequence-subsequence u v) w + pr2 sub-subsequence i j H = + is-strictly-increasing-extract-subsequence u v + ( extract-subsequence (sequence-subsequence u v) w i) + ( extract-subsequence (sequence-subsequence u v) w j) + ( is-strictly-increasing-extract-subsequence + ( sequence-subsequence u v) + ( w) + ( i) + ( j) + ( H)) + + eq-sub-subsequence : + Id + (sequence-subsequence u sub-subsequence) + (sequence-subsequence (sequence-subsequence u v) w) + eq-sub-subsequence = refl +``` From 144cfd2c0171429e461c588c4bf8c817caa64fce Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 21:59:19 +0200 Subject: [PATCH 02/67] asymptotical equality preserves asymptotical constant sequences --- ...asymptotically-constant-sequences.lagda.md | 38 +++++++++++++++++++ .../asymptotically-equal-sequences.lagda.md | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index d439e6ff36..b6af675e31 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -13,6 +13,7 @@ open import elementary-number-theory.natural-numbers open import foundation.asymptotically-equal-sequences open import foundation.dependent-pair-types +open import foundation.function-types open import foundation.functoriality-dependent-pair-types open import foundation.identity-types open import foundation.sequences @@ -88,6 +89,23 @@ module _ (refl-leq-ℕ (modulus-∞-constant-sequence u H))) ``` +### A sequence is asymptotically constant if it is asymptotically equal to some constant sequence + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + is-∞-constant-eq-∞-constant-sequence : + (Σ A (λ x → eq-∞-sequence (λ n → x) u)) → is-∞-constant-sequence u + is-∞-constant-eq-∞-constant-sequence (x , H) = + map-Σ + ( is-modulus-∞-constant-sequence u) + ( id) + ( λ N K p q I J → (inv (K p I)) ∙ (K q J)) + ( H) +``` + ### A subsequence of an asymptotically constant sequence is asymptotically constant ```agda @@ -132,3 +150,23 @@ module _ is-∞-constant-is-∞-constant-subsequence : is-∞-constant-sequence u is-∞-constant-is-∞-constant-subsequence = H (refl-subsequence u) ``` + +### A sequence asymptotically equal to an asymptotically constant sequence is asymptotically constant + +```agda +module _ + {l : Level} {A : UU l} (u v : sequence A) (H : eq-∞-sequence u v) + where + + preserves-∞-constant-eq-∞-sequence : + is-∞-constant-sequence u → is-∞-constant-sequence v + preserves-∞-constant-eq-∞-sequence K = + is-∞-constant-eq-∞-constant-sequence v + ( ∞-value-∞-constant-sequence u K , + transitive-eq-∞-sequence + ( λ n → ∞-value-∞-constant-sequence u K) + ( u) + ( v) + ( H) + ( eq-∞-constant-sequence u K)) +``` diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index a871d593e2..979fa05b72 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -24,7 +24,7 @@ open import foundation-core.function-types ## Idea -Two squences `u` and `v` are **asymptotically equal** if `u n = v n` for any +Two sequences `u` and `v` are **asymptotically equal** if `u n = v n` for any sufficiently large natural number `n`. ## Definition From 49600889ec5b18280f391df090ca81cd9106a65e Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 22:07:21 +0200 Subject: [PATCH 03/67] fix indent --- .../asymptotically-constant-sequences.lagda.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index b6af675e31..35f47ceb0a 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -163,10 +163,10 @@ module _ preserves-∞-constant-eq-∞-sequence K = is-∞-constant-eq-∞-constant-sequence v ( ∞-value-∞-constant-sequence u K , - transitive-eq-∞-sequence - ( λ n → ∞-value-∞-constant-sequence u K) - ( u) - ( v) - ( H) - ( eq-∞-constant-sequence u K)) + transitive-eq-∞-sequence + ( λ n → ∞-value-∞-constant-sequence u K) + ( u) + ( v) + ( H) + ( eq-∞-constant-sequence u K)) ``` From 1daaa948a3f350ef89eed21b7937065c0801bd1f Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 22:09:39 +0200 Subject: [PATCH 04/67] fix typo --- src/foundation/asymptotically-equal-sequences.lagda.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index 979fa05b72..56a02c6635 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -57,7 +57,7 @@ module _ pr2 refl-eq-∞-sequence m H = refl ``` -### Asymptotically equality is a symmetric relation +### Asymptotical equality is a symmetric relation ```agda module _ @@ -72,7 +72,7 @@ module _ ( λ N H m K → inv (H m K)) ``` -### Asymptotically equality equal is a transitive relation +### Asymptotical equality is a transitive relation ```agda module _ From b4d8abb94f767d87acd89d2adda7f0efa3a7ae06 Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 22:11:15 +0200 Subject: [PATCH 05/67] fix typo --- src/foundation/asymptotically-constant-sequences.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 35f47ceb0a..67dda1d46e 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -86,7 +86,7 @@ module _ is-modulus-modulus-∞-constant-sequence u H ( modulus-∞-constant-sequence u H) ( n) - (refl-leq-ℕ (modulus-∞-constant-sequence u H))) + ( refl-leq-ℕ (modulus-∞-constant-sequence u H))) ``` ### A sequence is asymptotically constant if it is asymptotically equal to some constant sequence From fd166d1e9c7b99569637abc1143ace93dbc4c9e6 Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 22:17:45 +0200 Subject: [PATCH 06/67] fix typo --- src/foundation/subsequences.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index d9356bbdf4..473b06fe17 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -28,7 +28,7 @@ open import foundation.universe-levels ## Idea -A **subsequence** of of a [sequence](foundation.sequences.md) `u : ℕ → A` is a +A **subsequence** of a [sequence](foundation.sequences.md) `u : ℕ → A` is a sequence `u ∘ f` for some [strictly increasing](elementary-number-theory.monotonic-endomaps-natural-numbers.md) map `f : ℕ → ℕ`. From 6e7828f67450dd8262089db76bfd5e8a3652f37e Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 22:21:10 +0200 Subject: [PATCH 07/67] fix typo --- .../monotonic-endomaps-natural-numbers.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md index 708bdadd7a..c016a73c61 100644 --- a/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md @@ -25,7 +25,7 @@ open import foundation.universe-levels ## Idea -Monotic endomaps of natural numbers are functions `f : ℕ → ℕ` that preserves or +Monotic endomaps of natural numbers are functions `f : ℕ → ℕ` that preserve or reverse (strict) inequality of natural numbers. ## Definitions From c9456f07d818f1d84377f97be4165e13175138ec Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 16 May 2024 22:22:12 +0200 Subject: [PATCH 08/67] remove unused imports --- .../monotonic-endomaps-natural-numbers.lagda.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md index c016a73c61..30333f5104 100644 --- a/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md @@ -10,7 +10,6 @@ module elementary-number-theory.monotonic-endomaps-natural-numbers where open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers -open import elementary-number-theory.well-ordering-principle-natural-numbers open import foundation.dependent-pair-types open import foundation.empty-types From 9a5c4d74ed9697c0a5e057003c2b06536ee6dd9e Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 18 May 2024 15:39:54 +0200 Subject: [PATCH 09/67] functoriality of subsequences --- src/foundation/subsequences.lagda.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 473b06fe17..dce4b6a4ba 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -74,7 +74,7 @@ module _ refl-subsequence : subsequence u refl-subsequence = (id , λ i j → id) - eq-refl-subsequence : sequence-subsequence u refl-subsequence = u + eq-refl-subsequence : u = sequence-subsequence u refl-subsequence eq-refl-subsequence = refl ``` @@ -106,3 +106,29 @@ module _ (sequence-subsequence (sequence-subsequence u v) w) eq-sub-subsequence = refl ``` + +### Subsequences are functorial + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) (u : sequence A) + where + + map-subsequence : subsequence u → subsequence (map-sequence f u) + map-subsequence H = H +``` + +### The extracted sequence of the image of a subsequence is the extracted sequence of the image + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) (u : sequence A) + (v : subsequence u) + where + + compute-map-subsequence : + Id + (map-sequence f (sequence-subsequence u v)) + (sequence-subsequence (map-sequence f u) (map-subsequence f u v)) + compute-map-subsequence = refl +``` From e54cd0cd8dde5b79ac437722410d3a159642baa5 Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 18 May 2024 18:42:18 +0200 Subject: [PATCH 10/67] rename monotonic-sequences-natural-numbers --- src/elementary-number-theory.lagda.md | 2 +- ...onotonic-endomaps-natural-numbers.lagda.md | 205 ----------------- ...notonic-sequences-natural-numbers.lagda.md | 206 ++++++++++++++++++ ...asymptotically-constant-sequences.lagda.md | 8 +- src/foundation/subsequences.lagda.md | 8 +- 5 files changed, 215 insertions(+), 214 deletions(-) delete mode 100644 src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md create mode 100644 src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md diff --git a/src/elementary-number-theory.lagda.md b/src/elementary-number-theory.lagda.md index aaee3dd1ee..0d070da57e 100644 --- a/src/elementary-number-theory.lagda.md +++ b/src/elementary-number-theory.lagda.md @@ -88,7 +88,7 @@ open import elementary-number-theory.modular-arithmetic public open import elementary-number-theory.modular-arithmetic-standard-finite-types public open import elementary-number-theory.monoid-of-natural-numbers-with-addition public open import elementary-number-theory.monoid-of-natural-numbers-with-maximum public -open import elementary-number-theory.monotonic-endomaps-natural-numbers public +open import elementary-number-theory.monotonic-sequences-natural-numbers public open import elementary-number-theory.multiplication-integer-fractions public open import elementary-number-theory.multiplication-integers public open import elementary-number-theory.multiplication-lists-of-natural-numbers public diff --git a/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md deleted file mode 100644 index 30333f5104..0000000000 --- a/src/elementary-number-theory/monotonic-endomaps-natural-numbers.lagda.md +++ /dev/null @@ -1,205 +0,0 @@ -# Monotonic endomaps of natural numbers - -```agda -module elementary-number-theory.monotonic-endomaps-natural-numbers where -``` - -
Imports - -```agda -open import elementary-number-theory.inequality-natural-numbers -open import elementary-number-theory.natural-numbers -open import elementary-number-theory.strict-inequality-natural-numbers - -open import foundation.dependent-pair-types -open import foundation.empty-types -open import foundation.function-types -open import foundation.functoriality-dependent-pair-types -open import foundation.negation -open import foundation.propositions -open import foundation.universe-levels -``` - -
- -## Idea - -Monotic endomaps of natural numbers are functions `f : ℕ → ℕ` that preserve or -reverse (strict) inequality of natural numbers. - -## Definitions - -### Increasing endomaps of natural numbers - -```agda -module _ - (f : ℕ → ℕ) - where - - is-increasing-endomap-prop-ℕ : Prop lzero - is-increasing-endomap-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f i) (f j)))) - - is-increasing-endomap-ℕ : UU lzero - is-increasing-endomap-ℕ = - type-Prop is-increasing-endomap-prop-ℕ - - is-prop-is-increasing-endomap-ℕ : - is-prop is-increasing-endomap-ℕ - is-prop-is-increasing-endomap-ℕ = - is-prop-type-Prop is-increasing-endomap-prop-ℕ -``` - -### Strictly increasing endomaps of natural numbers - -```agda -module _ - (f : ℕ → ℕ) - where - - is-strictly-increasing-endomap-prop-ℕ : Prop lzero - is-strictly-increasing-endomap-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f i) (f j)))) - - is-strictly-increasing-endomap-ℕ : UU lzero - is-strictly-increasing-endomap-ℕ = - type-Prop is-strictly-increasing-endomap-prop-ℕ - - is-prop-is-strictly-increasing-endomap-ℕ : - is-prop is-strictly-increasing-endomap-ℕ - is-prop-is-strictly-increasing-endomap-ℕ = - is-prop-type-Prop is-strictly-increasing-endomap-prop-ℕ -``` - -### Decreasing endomaps of natural numbers - -```agda -module _ - (f : ℕ → ℕ) - where - - is-decreasing-endomap-prop-ℕ : Prop lzero - is-decreasing-endomap-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f j) (f i)))) - - is-decreasing-endomap-ℕ : UU lzero - is-decreasing-endomap-ℕ = type-Prop is-decreasing-endomap-prop-ℕ - - is-prop-is-decreasing-endomap-ℕ : is-prop is-decreasing-endomap-ℕ - is-prop-is-decreasing-endomap-ℕ = - is-prop-type-Prop is-decreasing-endomap-prop-ℕ -``` - -### Stritcly decreasing endomaps of natural numbers - -```agda -module _ - (f : ℕ → ℕ) - where - - is-strictly-decreasing-endomap-prop-ℕ : Prop lzero - is-strictly-decreasing-endomap-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) - - is-strictly-decreasing-endomap-ℕ : UU lzero - is-strictly-decreasing-endomap-ℕ = - type-Prop is-strictly-decreasing-endomap-prop-ℕ - - is-prop-is-strictly-decreasing-endomap-ℕ : - is-prop is-strictly-decreasing-endomap-ℕ - is-prop-is-strictly-decreasing-endomap-ℕ = - is-prop-type-Prop is-strictly-decreasing-endomap-prop-ℕ -``` - -## Properties - -### There exist no strictly decreasing endomaps of natural numbers - -```agda -no-strictly-decreasing-endomap-leq-ℕ : - (f : ℕ → ℕ) → - (N : ℕ) → - is-strictly-decreasing-endomap-ℕ f → - leq-ℕ (f zero-ℕ) N → - empty -no-strictly-decreasing-endomap-leq-ℕ f zero-ℕ H = - concatenate-le-leq-ℕ - { f 1} - { f 0} - { 0} - ( H 0 1 (succ-le-ℕ 0)) -no-strictly-decreasing-endomap-leq-ℕ f (succ-ℕ N) H K = - no-strictly-decreasing-endomap-leq-ℕ - ( f ∘ succ-ℕ) - ( N) - ( λ i j → H (succ-ℕ i) (succ-ℕ j)) - ( leq-le-succ-ℕ - ( f 1) - ( N) - ( concatenate-le-leq-ℕ - { f 1} - { f 0} - { succ-ℕ N} - ( H 0 1 (succ-le-ℕ 0)) - ( K))) - -no-strictly-decreasing-endomap-ℕ : - (f : ℕ → ℕ) → ¬ (is-strictly-decreasing-endomap-ℕ f) -no-strictly-decreasing-endomap-ℕ f H = - no-strictly-decreasing-endomap-leq-ℕ f (f 0) H (refl-leq-ℕ (f 0)) -``` - -### Strictly increasing endomaps of natural numbers grow infinitely - -```agda -module _ - (f : ℕ → ℕ) (H : is-strictly-increasing-endomap-ℕ f) - where - - limit-∞-is-strictly-increasing-endomap-ℕ : - (M : ℕ) → Σ ℕ (λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ M (f p)) - limit-∞-is-strictly-increasing-endomap-ℕ zero-ℕ = - ( zero-ℕ , λ p K → leq-zero-ℕ (f p)) - limit-∞-is-strictly-increasing-endomap-ℕ (succ-ℕ M) = - map-Σ - ( λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ (succ-ℕ M) (f p)) - ( succ-ℕ) - ( λ N K p I → - leq-succ-le-ℕ M (f p) - (concatenate-leq-le-ℕ - { M} - { f N} - { f p} - ( K N (refl-leq-ℕ N)) - ( H N p - ( concatenate-le-leq-ℕ - { N} - { succ-ℕ N} - { p} - ( succ-le-ℕ N) - ( I))))) - ( limit-∞-is-strictly-increasing-endomap-ℕ M) - - modulus-limit-∞-is-strictly-increasing-endomap-ℕ : ℕ → ℕ - modulus-limit-∞-is-strictly-increasing-endomap-ℕ M = - pr1 (limit-∞-is-strictly-increasing-endomap-ℕ M) - - is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ : - (M p : ℕ) → - leq-ℕ (modulus-limit-∞-is-strictly-increasing-endomap-ℕ M) p → - leq-ℕ M (f p) - is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ M = - pr2 (limit-∞-is-strictly-increasing-endomap-ℕ M) -``` diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md new file mode 100644 index 0000000000..875a5b7044 --- /dev/null +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -0,0 +1,206 @@ +# Monotonic sequences of natural numbers + +```agda +module elementary-number-theory.monotonic-sequences-natural-numbers where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-inequality-natural-numbers + +open import foundation.dependent-pair-types +open import foundation.empty-types +open import foundation.function-types +open import foundation.functoriality-dependent-pair-types +open import foundation.negation +open import foundation.propositions +open import foundation.sequences +open import foundation.universe-levels +``` + +
+ +## Idea + +Monotic sequences of natural numbers are functions `f : ℕ → ℕ` that preserve or +reverse (strict) inequality of natural numbers. + +## Definitions + +### Increasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-increasing-prop-sequence-ℕ : Prop lzero + is-increasing-prop-sequence-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f i) (f j)))) + + is-increasing-sequence-ℕ : UU lzero + is-increasing-sequence-ℕ = + type-Prop is-increasing-prop-sequence-ℕ + + is-prop-is-increasing-sequence-ℕ : + is-prop is-increasing-sequence-ℕ + is-prop-is-increasing-sequence-ℕ = + is-prop-type-Prop is-increasing-prop-sequence-ℕ +``` + +### Strictly increasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-strictly-increasing-sequence-prop-ℕ : Prop lzero + is-strictly-increasing-sequence-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f i) (f j)))) + + is-strictly-increasing-sequence-ℕ : UU lzero + is-strictly-increasing-sequence-ℕ = + type-Prop is-strictly-increasing-sequence-prop-ℕ + + is-prop-is-strictly-increasing-sequence-ℕ : + is-prop is-strictly-increasing-sequence-ℕ + is-prop-is-strictly-increasing-sequence-ℕ = + is-prop-type-Prop is-strictly-increasing-sequence-prop-ℕ +``` + +### Decreasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-decreasing-sequence-prop-ℕ : Prop lzero + is-decreasing-sequence-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f j) (f i)))) + + is-decreasing-sequence-ℕ : UU lzero + is-decreasing-sequence-ℕ = type-Prop is-decreasing-sequence-prop-ℕ + + is-prop-is-decreasing-sequence-ℕ : is-prop is-decreasing-sequence-ℕ + is-prop-is-decreasing-sequence-ℕ = + is-prop-type-Prop is-decreasing-sequence-prop-ℕ +``` + +### Strictly decreasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-strictly-decreasing-sequence-prop-ℕ : Prop lzero + is-strictly-decreasing-sequence-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) + + is-strictly-decreasing-sequence-ℕ : UU lzero + is-strictly-decreasing-sequence-ℕ = + type-Prop is-strictly-decreasing-sequence-prop-ℕ + + is-prop-is-strictly-decreasing-sequence-ℕ : + is-prop is-strictly-decreasing-sequence-ℕ + is-prop-is-strictly-decreasing-sequence-ℕ = + is-prop-type-Prop is-strictly-decreasing-sequence-prop-ℕ +``` + +## Properties + +### There exist no strictly decreasing sequences of natural numbers + +```agda +no-strictly-decreasing-sequence-leq-ℕ : + (f : sequence ℕ) → + (N : ℕ) → + is-strictly-decreasing-sequence-ℕ f → + leq-ℕ (f zero-ℕ) N → + empty +no-strictly-decreasing-sequence-leq-ℕ f zero-ℕ H = + concatenate-le-leq-ℕ + { f 1} + { f 0} + { 0} + ( H 0 1 (succ-le-ℕ 0)) +no-strictly-decreasing-sequence-leq-ℕ f (succ-ℕ N) H K = + no-strictly-decreasing-sequence-leq-ℕ + ( f ∘ succ-ℕ) + ( N) + ( λ i j → H (succ-ℕ i) (succ-ℕ j)) + ( leq-le-succ-ℕ + ( f 1) + ( N) + ( concatenate-le-leq-ℕ + { f 1} + { f 0} + { succ-ℕ N} + ( H 0 1 (succ-le-ℕ 0)) + ( K))) + +no-strictly-decreasing-sequence-ℕ : + (f : sequence ℕ) → ¬ (is-strictly-decreasing-sequence-ℕ f) +no-strictly-decreasing-sequence-ℕ f H = + no-strictly-decreasing-sequence-leq-ℕ f (f 0) H (refl-leq-ℕ (f 0)) +``` + +### Strictly increasing sequences of natural numbers grow infinitely + +```agda +module _ + (f : sequence ℕ) (H : is-strictly-increasing-sequence-ℕ f) + where + + limit-∞-is-strictly-increasing-sequence-ℕ : + (M : ℕ) → Σ ℕ (λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ M (f p)) + limit-∞-is-strictly-increasing-sequence-ℕ zero-ℕ = + ( zero-ℕ , λ p K → leq-zero-ℕ (f p)) + limit-∞-is-strictly-increasing-sequence-ℕ (succ-ℕ M) = + map-Σ + ( λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ (succ-ℕ M) (f p)) + ( succ-ℕ) + ( λ N K p I → + leq-succ-le-ℕ M (f p) + (concatenate-leq-le-ℕ + { M} + { f N} + { f p} + ( K N (refl-leq-ℕ N)) + ( H N p + ( concatenate-le-leq-ℕ + { N} + { succ-ℕ N} + { p} + ( succ-le-ℕ N) + ( I))))) + ( limit-∞-is-strictly-increasing-sequence-ℕ M) + + modulus-limit-∞-is-strictly-increasing-sequence-ℕ : ℕ → ℕ + modulus-limit-∞-is-strictly-increasing-sequence-ℕ M = + pr1 (limit-∞-is-strictly-increasing-sequence-ℕ M) + + is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ : + (M p : ℕ) → + leq-ℕ (modulus-limit-∞-is-strictly-increasing-sequence-ℕ M) p → + leq-ℕ M (f p) + is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ M = + pr2 (limit-∞-is-strictly-increasing-sequence-ℕ M) +``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 67dda1d46e..f52fb9b3f3 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -8,7 +8,7 @@ module foundation.asymptotically-constant-sequences where ```agda open import elementary-number-theory.inequality-natural-numbers -open import elementary-number-theory.monotonic-endomaps-natural-numbers +open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers open import foundation.asymptotically-equal-sequences @@ -118,20 +118,20 @@ module _ is-∞-constant-subsequence = map-Σ ( is-modulus-∞-constant-sequence (sequence-subsequence u v)) - ( modulus-limit-∞-is-strictly-increasing-endomap-ℕ + ( modulus-limit-∞-is-strictly-increasing-sequence-ℕ ( extract-subsequence u v) ( is-strictly-increasing-extract-subsequence u v)) ( λ N K p q I J → K ( extract-subsequence u v p) ( extract-subsequence u v q) - ( is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ + ( is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ ( extract-subsequence u v) ( is-strictly-increasing-extract-subsequence u v) ( N) ( p) ( I)) - ( is-modulus-modulus-limit-∞-is-strictly-increasing-endomap-ℕ + ( is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ ( extract-subsequence u v) ( is-strictly-increasing-extract-subsequence u v) ( N) diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index dce4b6a4ba..afad0872cc 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -8,7 +8,7 @@ module foundation.subsequences where ```agda open import elementary-number-theory.inequality-natural-numbers -open import elementary-number-theory.monotonic-endomaps-natural-numbers +open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers @@ -30,7 +30,7 @@ open import foundation.universe-levels A **subsequence** of a [sequence](foundation.sequences.md) `u : ℕ → A` is a sequence `u ∘ f` for some -[strictly increasing](elementary-number-theory.monotonic-endomaps-natural-numbers.md) +[strictly increasing](elementary-number-theory.monotonic-sequences-natural-numbers.md) map `f : ℕ → ℕ`. ## Definition @@ -43,7 +43,7 @@ module _ where subsequence : UU lzero - subsequence = type-subtype is-strictly-increasing-endomap-prop-ℕ + subsequence = type-subtype is-strictly-increasing-sequence-prop-ℕ ``` ```agda @@ -55,7 +55,7 @@ module _ extract-subsequence = pr1 v is-strictly-increasing-extract-subsequence : - is-strictly-increasing-endomap-ℕ extract-subsequence + is-strictly-increasing-sequence-ℕ extract-subsequence is-strictly-increasing-extract-subsequence = pr2 v sequence-subsequence : sequence A From fe1669f02dc2c939b692d0c496b7380b7b5a5374 Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 18 May 2024 20:39:11 +0200 Subject: [PATCH 11/67] constant sequences --- src/foundation.lagda.md | 1 + ...asymptotically-constant-sequences.lagda.md | 32 ++++-- src/foundation/constant-sequences.lagda.md | 97 +++++++++++++++++++ 3 files changed, 120 insertions(+), 10 deletions(-) create mode 100644 src/foundation/constant-sequences.lagda.md diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index 6679157c6f..6458939b7d 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -83,6 +83,7 @@ open import foundation.connected-components-universes public open import foundation.connected-maps public open import foundation.connected-types public open import foundation.constant-maps public +open import foundation.constant-sequences public open import foundation.constant-span-diagrams public open import foundation.constant-type-families public open import foundation.contractible-maps public diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index f52fb9b3f3..f1159661e8 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -12,6 +12,7 @@ open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers open import foundation.asymptotically-equal-sequences +open import foundation.constant-sequences open import foundation.dependent-pair-types open import foundation.function-types open import foundation.functoriality-dependent-pair-types @@ -60,6 +61,17 @@ module _ ## Properties +### Constant sequences are asymptotically constant + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (H : is-constant-sequence u) + where + + is-∞-constant-is-constant-sequence : is-∞-constant-sequence u + is-∞-constant-is-constant-sequence = (zero-ℕ , λ p q I J → H p q) +``` + ### The asymptotical value of an asymptotically constant sequence ```agda @@ -78,15 +90,15 @@ module _ {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) where - eq-∞-constant-sequence : - eq-∞-sequence (λ n → ∞-value-∞-constant-sequence u H) u - eq-∞-constant-sequence = + eq-∞-value-∞-constant-sequence : + eq-∞-sequence (const-sequence (∞-value-∞-constant-sequence u H)) u + eq-∞-value-∞-constant-sequence = ( modulus-∞-constant-sequence u H) , ( λ n → is-modulus-modulus-∞-constant-sequence u H - ( modulus-∞-constant-sequence u H) - ( n) - ( refl-leq-ℕ (modulus-∞-constant-sequence u H))) + ( modulus-∞-constant-sequence u H) + ( n) + ( refl-leq-ℕ (modulus-∞-constant-sequence u H))) ``` ### A sequence is asymptotically constant if it is asymptotically equal to some constant sequence @@ -97,7 +109,7 @@ module _ where is-∞-constant-eq-∞-constant-sequence : - (Σ A (λ x → eq-∞-sequence (λ n → x) u)) → is-∞-constant-sequence u + (Σ A (λ x → eq-∞-sequence (const-sequence x) u)) → is-∞-constant-sequence u is-∞-constant-eq-∞-constant-sequence (x , H) = map-Σ ( is-modulus-∞-constant-sequence u) @@ -162,11 +174,11 @@ module _ is-∞-constant-sequence u → is-∞-constant-sequence v preserves-∞-constant-eq-∞-sequence K = is-∞-constant-eq-∞-constant-sequence v - ( ∞-value-∞-constant-sequence u K , - transitive-eq-∞-sequence + ( ( ∞-value-∞-constant-sequence u K) , + ( transitive-eq-∞-sequence ( λ n → ∞-value-∞-constant-sequence u K) ( u) ( v) ( H) - ( eq-∞-constant-sequence u K)) + ( eq-∞-value-∞-constant-sequence u K))) ``` diff --git a/src/foundation/constant-sequences.lagda.md b/src/foundation/constant-sequences.lagda.md new file mode 100644 index 0000000000..dabcc2de87 --- /dev/null +++ b/src/foundation/constant-sequences.lagda.md @@ -0,0 +1,97 @@ +# Constant Sequences + +```agda +module foundation.constant-sequences where +``` + +
Imports + +```agda +open import elementary-number-theory.natural-numbers + +open import foundation.dependent-pair-types +open import foundation.homotopies +open import foundation.identity-types +open import foundation.sequences +open import foundation.universe-levels +``` + +
+ +## Idea + +A sequence `u` is **constant** if `u p = u q` for all `p` and `q`. + +## Definition + +### Constant sequences + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + is-constant-sequence : UU l + is-constant-sequence = (p q : ℕ) → u p = u q +``` + +### The type of constant sequences in a type + +```agda +module _ + {l : Level} (A : UU l) + where + + constant-sequence : UU l + constant-sequence = Σ (sequence A) is-constant-sequence +``` + +## Properties + +### The value of a constant sequence + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (H : is-constant-sequence u) + where + + value-constant-sequence : A + value-constant-sequence = u zero-ℕ + + eq-value-constant-sequence : (n : ℕ) → value-constant-sequence = u n + eq-value-constant-sequence = H zero-ℕ +``` + +### The constant sequences in a type + +```agda +module _ + {l : Level} {A : UU l} (x : A) + where + + const-sequence : sequence A + const-sequence n = x +``` + +### Constant sequences are constant + +```agda +module _ + {l : Level} {A : UU l} (x : A) + where + + is-constant-const-sequence : is-constant-sequence (const-sequence x) + is-constant-const-sequence p q = refl +``` + +### A sequence is constant if all its terms are equal to some element + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + is-constant-htpy-constant-sequence : + Σ A (λ x → (const-sequence x) ~ u) → is-constant-sequence u + is-constant-htpy-constant-sequence (x , H) p q = inv (H p) ∙ H q +``` From c41da7f8bcee836db77e730fd7f5fa25d6dbf8f6 Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 20 May 2024 21:11:36 +0200 Subject: [PATCH 12/67] refactor using asymptotical dependent sequences --- ...notonic-sequences-natural-numbers.lagda.md | 4 +- src/foundation.lagda.md | 1 + .../asymptotical-dependent-sequences.lagda.md | 109 +++++++++++++++ ...asymptotically-constant-sequences.lagda.md | 131 ++++++++---------- .../asymptotically-equal-sequences.lagda.md | 21 ++- src/foundation/subsequences.lagda.md | 23 +++ 6 files changed, 209 insertions(+), 80 deletions(-) create mode 100644 src/foundation/asymptotical-dependent-sequences.lagda.md diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 875a5b7044..b14b9f32a6 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -197,10 +197,10 @@ module _ modulus-limit-∞-is-strictly-increasing-sequence-ℕ M = pr1 (limit-∞-is-strictly-increasing-sequence-ℕ M) - is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ : + is-modulus-limit-∞-is-strictly-increasing-sequence-ℕ : (M p : ℕ) → leq-ℕ (modulus-limit-∞-is-strictly-increasing-sequence-ℕ M) p → leq-ℕ M (f p) - is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ M = + is-modulus-limit-∞-is-strictly-increasing-sequence-ℕ M = pr2 (limit-∞-is-strictly-increasing-sequence-ℕ M) ``` diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index 6458939b7d..bb138f0ccf 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -26,6 +26,7 @@ open import foundation.action-on-identifications-functions public open import foundation.apartness-relations public open import foundation.arithmetic-law-coproduct-and-sigma-decompositions public open import foundation.arithmetic-law-product-and-pi-decompositions public +open import foundation.asymptotical-dependent-sequences public open import foundation.asymptotically-constant-sequences public open import foundation.asymptotically-equal-sequences public open import foundation.automorphisms public diff --git a/src/foundation/asymptotical-dependent-sequences.lagda.md b/src/foundation/asymptotical-dependent-sequences.lagda.md new file mode 100644 index 0000000000..1560001dd1 --- /dev/null +++ b/src/foundation/asymptotical-dependent-sequences.lagda.md @@ -0,0 +1,109 @@ +# Asymptotical dependent sequences + +```agda +module foundation.asymptotical-dependent-sequences where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.monotonic-sequences-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.dependent-pair-types +open import foundation.dependent-sequences +open import foundation.functoriality-dependent-pair-types +open import foundation.subsequences +open import foundation.universe-levels +``` + +
+ +## Idea + +A dependent sequence `A : ℕ → UU l` is **asymptotical** if `A n` is pointed for +sufficiently large natural numbers `n`. + +## Definition + +### Asymptotical dependent sequences + +```agda +module _ + {l : Level} (A : ℕ → UU l) + where + + is-modulus-dependent-sequence : ℕ → UU l + is-modulus-dependent-sequence N = (n : ℕ) → leq-ℕ N n → A n + + asymptotically : UU l + asymptotically = Σ ℕ is-modulus-dependent-sequence +``` + +```agda +module _ + {l : Level} {A : ℕ → UU l} (H : asymptotically A) + where + + modulus-∞-asymptotically : ℕ + modulus-∞-asymptotically = pr1 H + + is-modulus-∞-asymptotically : + is-modulus-dependent-sequence A modulus-∞-asymptotically + is-modulus-∞-asymptotically = pr2 H + + value-∞-asymptotically : A modulus-∞-asymptotically + value-∞-asymptotically = + is-modulus-∞-asymptotically + ( modulus-∞-asymptotically) + ( refl-leq-ℕ modulus-∞-asymptotically) +``` + +## Properties + +### Any natural number greater than an asymptotical modulus is an asymptotical modulus + +```agda +module _ + {l : Level} (A : ℕ → UU l) (i j : ℕ) (I : leq-ℕ i j) + where + + is-increasing-is-modulus-dependent-sequence : + (is-modulus-dependent-sequence A i) → (is-modulus-dependent-sequence A j) + is-increasing-is-modulus-dependent-sequence H k K = + H k (transitive-leq-ℕ i j k K I) +``` + +### A dependent sequence thats asymptotically has an asymptotical modulus is asymptotical + +```agda +module _ + {l : Level} (A : ℕ → UU l) + where + + asymptotically-is-modulus-dependent-sequence : + asymptotically (is-modulus-dependent-sequence A) → + asymptotically A + asymptotically-is-modulus-dependent-sequence (N , H) = + (N , (λ n K → H n K n (refl-leq-ℕ n))) +``` + +### Any subsequence of an asymptotical dependent sequence is asymptotical + +```agda +module _ + {l : Level} (A : ℕ → UU l) (B : subsequence A) + where + + asymptotically-sequence-subsequence : + asymptotically A → asymptotically (sequence-subsequence A B) + asymptotically-sequence-subsequence = + map-Σ + ( is-modulus-dependent-sequence (sequence-subsequence A B)) + ( modulus-subsequence A B) + ( λ N K p I → + K + ( extract-subsequence A B p) + ( is-modulus-subsequence A B N p I)) +``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index f1159661e8..647520a69d 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -11,6 +11,7 @@ open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers +open import foundation.asymptotical-dependent-sequences open import foundation.asymptotically-equal-sequences open import foundation.constant-sequences open import foundation.dependent-pair-types @@ -35,28 +36,34 @@ large `p` and `q`. ```agda module _ - {l : Level} {A : UU l} + {l : Level} {A : UU l} (u : sequence A) where - is-modulus-∞-constant-sequence : (u : sequence A) (N : ℕ) → UU l - is-modulus-∞-constant-sequence u N = - (p q : ℕ) → leq-ℕ N p → leq-ℕ N q → (u p) = (u q) - - is-∞-constant-sequence : (u : sequence A) → UU l - is-∞-constant-sequence u = Σ ℕ (is-modulus-∞-constant-sequence u) + is-∞-constant-sequence : UU l + is-∞-constant-sequence = + asymptotically (λ p → asymptotically (λ q → u p = u q)) ``` +### The asymptotical value of an asymptotically constant sequence + ```agda module _ - {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) + {l : Level} {A : UU l} {u : sequence A} (H : is-∞-constant-sequence u) where - modulus-∞-constant-sequence : ℕ - modulus-∞-constant-sequence = pr1 H - - is-modulus-modulus-∞-constant-sequence : - is-modulus-∞-constant-sequence u modulus-∞-constant-sequence - is-modulus-modulus-∞-constant-sequence = pr2 H + ∞-value-∞-constant-sequence : A + ∞-value-∞-constant-sequence = u (modulus-∞-asymptotically H) + + modulus-∞-value-∞-constant-sequence : ℕ + modulus-∞-value-∞-constant-sequence = + modulus-∞-asymptotically (value-∞-asymptotically H) + + is-modulus-∞-value-∞-constant-sequence : + (n : ℕ) → + leq-ℕ modulus-∞-value-∞-constant-sequence n → + ∞-value-∞-constant-sequence = u n + is-modulus-∞-value-∞-constant-sequence = + is-modulus-∞-asymptotically (value-∞-asymptotically H) ``` ## Properties @@ -65,60 +72,48 @@ module _ ```agda module _ - {l : Level} {A : UU l} (u : sequence A) (H : is-constant-sequence u) + {l : Level} {A : UU l} {u : sequence A} (H : is-constant-sequence u) where is-∞-constant-is-constant-sequence : is-∞-constant-sequence u - is-∞-constant-is-constant-sequence = (zero-ℕ , λ p q I J → H p q) -``` - -### The asymptotical value of an asymptotically constant sequence - -```agda -module _ - {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) - where - - ∞-value-∞-constant-sequence : A - ∞-value-∞-constant-sequence = u (modulus-∞-constant-sequence u H) + pr1 is-∞-constant-is-constant-sequence = zero-ℕ + pr2 is-∞-constant-is-constant-sequence p I = zero-ℕ , λ q J → H p q ``` ### An asymptotically constant sequence is asymptotically equal to the constant sequence of its asymptotical value ```agda module _ - {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) + {l : Level} {A : UU l} {u : sequence A} (H : is-∞-constant-sequence u) where eq-∞-value-∞-constant-sequence : - eq-∞-sequence (const-sequence (∞-value-∞-constant-sequence u H)) u + eq-∞-sequence (const-sequence (∞-value-∞-constant-sequence H)) u eq-∞-value-∞-constant-sequence = - ( modulus-∞-constant-sequence u H) , - ( λ n → - is-modulus-modulus-∞-constant-sequence u H - ( modulus-∞-constant-sequence u H) - ( n) - ( refl-leq-ℕ (modulus-∞-constant-sequence u H))) + ( modulus-∞-value-∞-constant-sequence H) , + ( is-modulus-∞-value-∞-constant-sequence H) ``` ### A sequence is asymptotically constant if it is asymptotically equal to some constant sequence ```agda module _ - {l : Level} {A : UU l} (u : sequence A) + {l : Level} {A : UU l} (u : sequence A) (x : A) where is-∞-constant-eq-∞-constant-sequence : - (Σ A (λ x → eq-∞-sequence (const-sequence x) u)) → is-∞-constant-sequence u - is-∞-constant-eq-∞-constant-sequence (x , H) = - map-Σ - ( is-modulus-∞-constant-sequence u) - ( id) - ( λ N K p q I J → (inv (K p I)) ∙ (K q J)) - ( H) + (eq-∞-sequence (const-sequence x) u) → is-∞-constant-sequence u + is-∞-constant-eq-∞-constant-sequence H = + ( modulus-eq-∞-sequence H) , + ( λ p I → + ( ( modulus-eq-∞-sequence H) , + ( λ q J → + ( inv + ( is-modulus-eq-∞-sequence H p I)) ∙ + ( is-modulus-eq-∞-sequence H q J)))) ``` -### A subsequence of an asymptotically constant sequence is asymptotically constant +### Any subsequence of an asymptotically constant sequence is asymptotically constant ```agda module _ @@ -127,28 +122,18 @@ module _ is-∞-constant-subsequence : is-∞-constant-sequence u → is-∞-constant-sequence (sequence-subsequence u v) - is-∞-constant-subsequence = - map-Σ - ( is-modulus-∞-constant-sequence (sequence-subsequence u v)) - ( modulus-limit-∞-is-strictly-increasing-sequence-ℕ - ( extract-subsequence u v) - ( is-strictly-increasing-extract-subsequence u v)) - ( λ N K p q I J → - K - ( extract-subsequence u v p) - ( extract-subsequence u v q) - ( is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ - ( extract-subsequence u v) - ( is-strictly-increasing-extract-subsequence u v) - ( N) - ( p) - ( I)) - ( is-modulus-modulus-limit-∞-is-strictly-increasing-sequence-ℕ - ( extract-subsequence u v) - ( is-strictly-increasing-extract-subsequence u v) - ( N) - ( q) - ( J))) + is-∞-constant-subsequence H = + is-∞-constant-eq-∞-constant-sequence + ( sequence-subsequence u v) + ( ∞-value-∞-constant-sequence H) + ( ( modulus-subsequence u v (modulus-∞-value-∞-constant-sequence H)) , + ( λ n I → + is-modulus-∞-value-∞-constant-sequence H + ( extract-subsequence u v n) + ( is-modulus-subsequence u v + ( modulus-∞-value-∞-constant-sequence H) + ( n) + ( I)))) ``` ### A sequence is asymptotically constant if all its subsequences are asymptotically constant @@ -174,11 +159,11 @@ module _ is-∞-constant-sequence u → is-∞-constant-sequence v preserves-∞-constant-eq-∞-sequence K = is-∞-constant-eq-∞-constant-sequence v - ( ( ∞-value-∞-constant-sequence u K) , - ( transitive-eq-∞-sequence - ( λ n → ∞-value-∞-constant-sequence u K) - ( u) - ( v) - ( H) - ( eq-∞-value-∞-constant-sequence u K))) + ( ∞-value-∞-constant-sequence K) + ( transitive-eq-∞-sequence + ( const-sequence (∞-value-∞-constant-sequence K)) + ( u) + ( v) + ( H) + ( eq-∞-value-∞-constant-sequence K)) ``` diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index 56a02c6635..2d5ffd9902 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -11,6 +11,7 @@ open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.maximum-natural-numbers open import elementary-number-theory.natural-numbers +open import foundation.asymptotical-dependent-sequences open import foundation.dependent-pair-types open import foundation.functoriality-dependent-pair-types open import foundation.identity-types @@ -36,11 +37,21 @@ module _ {l : Level} {A : UU l} (u v : sequence A) where - is-modulus-eq-∞-sequence : ℕ → UU l - is-modulus-eq-∞-sequence N = (m : ℕ) → leq-ℕ N m → u m = v m - eq-∞-sequence : UU l - eq-∞-sequence = Σ ℕ is-modulus-eq-∞-sequence + eq-∞-sequence = asymptotically (λ n → u n = v n) +``` + +```agda +module _ + {l : Level} {A : UU l} {u v : sequence A} (H : eq-∞-sequence u v) + where + + modulus-eq-∞-sequence : ℕ + modulus-eq-∞-sequence = pr1 H + + is-modulus-eq-∞-sequence : + (n : ℕ) → leq-ℕ modulus-eq-∞-sequence n → u n = v n + is-modulus-eq-∞-sequence = pr2 H ``` ## Properties @@ -67,7 +78,7 @@ module _ symmetric-eq-∞-sequence : eq-∞-sequence u v → eq-∞-sequence v u symmetric-eq-∞-sequence = map-Σ - ( is-modulus-eq-∞-sequence v u) + ( is-modulus-dependent-sequence (λ n → v n = u n)) ( id) ( λ N H m K → inv (H m K)) ``` diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index afad0872cc..376776e905 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -132,3 +132,26 @@ module _ (sequence-subsequence (map-sequence f u) (map-subsequence f u v)) compute-map-subsequence = refl ``` + +### Modulus of a subsquence + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (v : subsequence u) + where + + modulus-subsequence : ℕ → ℕ + modulus-subsequence = + modulus-limit-∞-is-strictly-increasing-sequence-ℕ + ( extract-subsequence u v) + ( is-strictly-increasing-extract-subsequence u v) + + is-modulus-subsequence : + (N p : ℕ) → + leq-ℕ (modulus-subsequence N) p → + leq-ℕ N (extract-subsequence u v p) + is-modulus-subsequence = + is-modulus-limit-∞-is-strictly-increasing-sequence-ℕ + ( extract-subsequence u v) + ( is-strictly-increasing-extract-subsequence u v) +``` From 5993bc419a10408683f9a27faf7be617902beda6 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 21 May 2024 02:33:47 +0200 Subject: [PATCH 13/67] fix typo --- src/foundation/asymptotically-constant-sequences.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 647520a69d..b24131c82c 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -1,4 +1,4 @@ -# Aymptotically constant Sequences +# Asymptotically constant sequences ```agda module foundation.asymptotically-constant-sequences where From 38ceb04193f5e83843d1d1f612fc8b0b5f3a4212 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 21 May 2024 02:46:41 +0200 Subject: [PATCH 14/67] asymptotically-map-dependent-sequence --- .../asymptotical-dependent-sequences.lagda.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/foundation/asymptotical-dependent-sequences.lagda.md b/src/foundation/asymptotical-dependent-sequences.lagda.md index 1560001dd1..2a3ee747f0 100644 --- a/src/foundation/asymptotical-dependent-sequences.lagda.md +++ b/src/foundation/asymptotical-dependent-sequences.lagda.md @@ -8,6 +8,7 @@ module foundation.asymptotical-dependent-sequences where ```agda open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.maximum-natural-numbers open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers @@ -62,6 +63,17 @@ module _ ## Properties +### Pointed dependent sequences are asymptotical + +```agda +module _ + {l : Level} {A : ℕ → UU l} + where + + asymptotically-Π : ((n : ℕ) → A n) → asymptotically A + asymptotically-Π u = (zero-ℕ , λ p I → u p) +``` + ### Any natural number greater than an asymptotical modulus is an asymptotical modulus ```agda @@ -107,3 +119,29 @@ module _ ( extract-subsequence A B p) ( is-modulus-subsequence A B N p I)) ``` + +### A dependent sequence that asymptotically map from an asymptotical dependent sequence is asymptotical + +```agda +module _ + {l1 l2 : Level} {A : ℕ → UU l1} {B : ℕ → UU l2} + where + + asymptotically-map-dependent-sequence : + asymptotically (λ n → A n → B n) → + asymptotically A → + asymptotically B + asymptotically-map-dependent-sequence H K = + ( max-ℕ (modulus-∞-asymptotically H) (modulus-∞-asymptotically K)) , + ( λ q I → + is-modulus-∞-asymptotically H q + ( leq-left-leq-max-ℕ q + ( modulus-∞-asymptotically H) + ( modulus-∞-asymptotically K) + ( I)) + ( is-modulus-∞-asymptotically K q + ( leq-right-leq-max-ℕ q + ( modulus-∞-asymptotically H) + ( modulus-∞-asymptotically K) + ( I)))) +``` From a3ef71d3d5dcd506012809227662cf4b564e7466 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 21 May 2024 03:08:05 +0200 Subject: [PATCH 15/67] cleanup --- .../asymptotical-dependent-sequences.lagda.md | 39 +++++++++---------- src/foundation/dependent-sequences.lagda.md | 4 +- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/foundation/asymptotical-dependent-sequences.lagda.md b/src/foundation/asymptotical-dependent-sequences.lagda.md index 2a3ee747f0..b96c4353bb 100644 --- a/src/foundation/asymptotical-dependent-sequences.lagda.md +++ b/src/foundation/asymptotical-dependent-sequences.lagda.md @@ -87,7 +87,7 @@ module _ H k (transitive-leq-ℕ i j k K I) ``` -### A dependent sequence thats asymptotically has an asymptotical modulus is asymptotical +### A dependent sequence that asymptotically has an asymptotical modulus is asymptotical ```agda module _ @@ -120,28 +120,25 @@ module _ ( is-modulus-subsequence A B N p I)) ``` -### A dependent sequence that asymptotically map from an asymptotical dependent sequence is asymptotical +### Asymptotical functorial action on asymptotical dependent sequences ```agda -module _ - {l1 l2 : Level} {A : ℕ → UU l1} {B : ℕ → UU l2} - where - - asymptotically-map-dependent-sequence : - asymptotically (λ n → A n → B n) → - asymptotically A → - asymptotically B - asymptotically-map-dependent-sequence H K = - ( max-ℕ (modulus-∞-asymptotically H) (modulus-∞-asymptotically K)) , - ( λ q I → - is-modulus-∞-asymptotically H q - ( leq-left-leq-max-ℕ q +map-asymptotically : + {l1 l2 : Level} {A : ℕ → UU l1} {B : ℕ → UU l2} → + asymptotically (λ n → A n → B n) → + asymptotically A → + asymptotically B +map-asymptotically H K = + ( max-ℕ (modulus-∞-asymptotically H) (modulus-∞-asymptotically K)) , + ( λ q I → + is-modulus-∞-asymptotically H q + ( leq-left-leq-max-ℕ q + ( modulus-∞-asymptotically H) + ( modulus-∞-asymptotically K) + ( I)) + ( is-modulus-∞-asymptotically K q + ( leq-right-leq-max-ℕ q ( modulus-∞-asymptotically H) ( modulus-∞-asymptotically K) - ( I)) - ( is-modulus-∞-asymptotically K q - ( leq-right-leq-max-ℕ q - ( modulus-∞-asymptotically H) - ( modulus-∞-asymptotically K) - ( I)))) + ( I)))) ``` diff --git a/src/foundation/dependent-sequences.lagda.md b/src/foundation/dependent-sequences.lagda.md index 7590315c29..bc1128a8f2 100644 --- a/src/foundation/dependent-sequences.lagda.md +++ b/src/foundation/dependent-sequences.lagda.md @@ -35,6 +35,8 @@ dependent-sequence B = (n : ℕ) → B n ```agda map-dependent-sequence : {l1 l2 : Level} {A : ℕ → UU l1} {B : ℕ → UU l2} → - ((n : ℕ) → A n → B n) → dependent-sequence A → dependent-sequence B + dependent-sequence (λ n → A n → B n) → + dependent-sequence A → + dependent-sequence B map-dependent-sequence f a = map-Π f a ``` From 0b7a9b0667bd1bc5601cd621c8c3abb6d9d17a99 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 21 May 2024 20:08:14 +0200 Subject: [PATCH 16/67] characterisation of asymptotically constant sequences --- ...asymptotically-constant-sequences.lagda.md | 165 ++++++++++++++++-- src/foundation/subsequences.lagda.md | 15 ++ 2 files changed, 168 insertions(+), 12 deletions(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index b24131c82c..13b2c39c60 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -7,7 +7,9 @@ module foundation.asymptotically-constant-sequences where
Imports ```agda +open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.maximum-natural-numbers open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers @@ -77,7 +79,51 @@ module _ is-∞-constant-is-constant-sequence : is-∞-constant-sequence u pr1 is-∞-constant-is-constant-sequence = zero-ℕ - pr2 is-∞-constant-is-constant-sequence p I = zero-ℕ , λ q J → H p q + pr2 is-∞-constant-is-constant-sequence p I = (zero-ℕ , λ q J → H p q) +``` + +### The asymptotical value of an asymptotically constant sequence is unique + +```agda +module _ + {l : Level} {A : UU l} {u : sequence A} + (H K : is-∞-constant-sequence u) + where + + all-equal-∞-value-∞-constant-sequence : + ∞-value-∞-constant-sequence H = ∞-value-∞-constant-sequence K + all-equal-∞-value-∞-constant-sequence = + ( is-modulus-∞-value-∞-constant-sequence + ( H) + ( max-ℕ + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K)) + ( leq-left-leq-max-ℕ + ( max-ℕ + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K)) + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K) + ( refl-leq-ℕ + ( max-ℕ + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K))))) ∙ + ( inv + ( is-modulus-∞-value-∞-constant-sequence + ( K) + ( max-ℕ + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K)) + ( leq-right-leq-max-ℕ + ( max-ℕ + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K)) + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K) + ( refl-leq-ℕ + ( max-ℕ + ( modulus-∞-value-∞-constant-sequence H) + ( modulus-∞-value-∞-constant-sequence K)))))) ``` ### An asymptotically constant sequence is asymptotically equal to the constant sequence of its asymptotical value @@ -98,7 +144,7 @@ module _ ```agda module _ - {l : Level} {A : UU l} (u : sequence A) (x : A) + {l : Level} {A : UU l} (x : A) (u : sequence A) where is-∞-constant-eq-∞-constant-sequence : @@ -120,20 +166,28 @@ module _ {l : Level} {A : UU l} (u : sequence A) (v : subsequence u) where + eq-∞-value-∞-constant-subsequence : + (H : is-∞-constant-sequence u) → + eq-∞-sequence + ( const-sequence (∞-value-∞-constant-sequence H)) + ( sequence-subsequence u v) + eq-∞-value-∞-constant-subsequence H = + ( ( modulus-subsequence u v (modulus-∞-value-∞-constant-sequence H)) , + ( λ n I → + is-modulus-∞-value-∞-constant-sequence H + ( extract-subsequence u v n) + ( is-modulus-subsequence u v + ( modulus-∞-value-∞-constant-sequence H) + ( n) + ( I)))) + is-∞-constant-subsequence : is-∞-constant-sequence u → is-∞-constant-sequence (sequence-subsequence u v) is-∞-constant-subsequence H = is-∞-constant-eq-∞-constant-sequence - ( sequence-subsequence u v) ( ∞-value-∞-constant-sequence H) - ( ( modulus-subsequence u v (modulus-∞-value-∞-constant-sequence H)) , - ( λ n I → - is-modulus-∞-value-∞-constant-sequence H - ( extract-subsequence u v n) - ( is-modulus-subsequence u v - ( modulus-∞-value-∞-constant-sequence H) - ( n) - ( I)))) + ( sequence-subsequence u v) + ( eq-∞-value-∞-constant-subsequence H) ``` ### A sequence is asymptotically constant if all its subsequences are asymptotically constant @@ -158,8 +212,9 @@ module _ preserves-∞-constant-eq-∞-sequence : is-∞-constant-sequence u → is-∞-constant-sequence v preserves-∞-constant-eq-∞-sequence K = - is-∞-constant-eq-∞-constant-sequence v + is-∞-constant-eq-∞-constant-sequence ( ∞-value-∞-constant-sequence K) + ( v) ( transitive-eq-∞-sequence ( const-sequence (∞-value-∞-constant-sequence K)) ( u) @@ -167,3 +222,89 @@ module _ ( H) ( eq-∞-value-∞-constant-sequence K)) ``` + +### Asymptotically stationnary sequences + +#### The type of being asymptotically stationnary + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + is-∞-stationnary-sequence : UU l + is-∞-stationnary-sequence = asymptotically (λ n → u n = u (succ-ℕ n)) + + is-∞-constant-modulus-is-∞-stationnary-sequence : + (H : is-∞-stationnary-sequence) → + (n : ℕ) → + leq-ℕ (modulus-∞-asymptotically H) n → + u (modulus-∞-asymptotically H) = u n + is-∞-constant-modulus-is-∞-stationnary-sequence H = + based-ind-ℕ + ( modulus-∞-asymptotically H) + ( λ n → u (modulus-∞-asymptotically H) = u n) + ( refl) + ( λ n I K → K ∙ is-modulus-∞-asymptotically H n I) +``` + +#### A sequence is asymptotically constant if and only if it is asymptotically stationnary + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + is-∞-constant-is-∞-stationnary : + is-∞-stationnary-sequence u → is-∞-constant-sequence u + is-∞-constant-is-∞-stationnary H = + is-∞-constant-eq-∞-constant-sequence + ( u (modulus-∞-asymptotically H)) + ( u) + ( ( modulus-∞-asymptotically H) , + ( is-∞-constant-modulus-is-∞-stationnary-sequence u H)) + + is-∞-stationnary-is-∞-constant-sequence : + is-∞-constant-sequence u → is-∞-stationnary-sequence u + is-∞-stationnary-is-∞-constant-sequence H = + ( ( modulus-∞-value-∞-constant-sequence H) , + ( λ n I → + ( inv (is-modulus-∞-value-∞-constant-sequence H n I)) ∙ + ( is-modulus-∞-value-∞-constant-sequence + ( H) + ( succ-ℕ n) + ( preserves-leq-succ-ℕ + ( modulus-∞-value-∞-constant-sequence H) + ( n) + ( I))))) +``` + +### A sequence is asymptotically constant if and only if it is asymptotically equal to all its subsequences + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + eq-∞-subsequence-is-∞-constant-sequence : + is-∞-constant-sequence u → + ((v : subsequence u) → eq-∞-sequence u (sequence-subsequence u v)) + eq-∞-subsequence-is-∞-constant-sequence H v = + transitive-eq-∞-sequence + ( u) + ( const-sequence (∞-value-∞-constant-sequence H)) + ( sequence-subsequence u v) + ( eq-∞-value-∞-constant-subsequence u v H) + ( symmetric-eq-∞-sequence + ( const-sequence (∞-value-∞-constant-sequence H)) + ( u) + ( eq-∞-value-∞-constant-sequence H)) + + is-∞-constant-eq-∞-sequence-subsequence : + ((v : subsequence u) → eq-∞-sequence u (sequence-subsequence u v)) → + is-∞-constant-sequence u + is-∞-constant-eq-∞-sequence-subsequence H = + is-∞-constant-is-∞-stationnary + ( u) + ( H (skip-zero-sequence u)) +``` diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 376776e905..334e62a2e3 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -64,6 +64,21 @@ module _ ## Properties +### The subsequence that skips the first term + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + skip-zero-sequence : subsequence u + skip-zero-sequence = (succ-ℕ , λ i j K → K) + + eq-skip-zero-sequence : + (n : ℕ) → sequence-subsequence u skip-zero-sequence n = u (succ-ℕ n) + eq-skip-zero-sequence n = refl +``` + ### Any sequence is a subsequence of itself ```agda From 8af986a622975e59269e598eb3ccf673959714e3 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 21 May 2024 20:13:42 +0200 Subject: [PATCH 17/67] cleanup --- src/foundation/subsequences.lagda.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 334e62a2e3..256878d804 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -64,33 +64,33 @@ module _ ## Properties -### The subsequence that skips the first term +### Any sequence is a subsequence of itself ```agda module _ {l : Level} {A : UU l} (u : sequence A) where - skip-zero-sequence : subsequence u - skip-zero-sequence = (succ-ℕ , λ i j K → K) + refl-subsequence : subsequence u + refl-subsequence = (id , λ i j → id) - eq-skip-zero-sequence : - (n : ℕ) → sequence-subsequence u skip-zero-sequence n = u (succ-ℕ n) - eq-skip-zero-sequence n = refl + eq-refl-subsequence : u = sequence-subsequence u refl-subsequence + eq-refl-subsequence = refl ``` -### Any sequence is a subsequence of itself +### The subsequence that skips the first term ```agda module _ {l : Level} {A : UU l} (u : sequence A) where - refl-subsequence : subsequence u - refl-subsequence = (id , λ i j → id) + skip-zero-sequence : subsequence u + skip-zero-sequence = (succ-ℕ , λ i j K → K) - eq-refl-subsequence : u = sequence-subsequence u refl-subsequence - eq-refl-subsequence = refl + eq-skip-zero-sequence : + u ∘ succ-ℕ = sequence-subsequence u skip-zero-sequence + eq-skip-zero-sequence = refl ``` ### A subsequence of a subsequence is a subsequence of the original sequence From c74742ab28905fb22c8d921845a4800d2a134934 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 21 May 2024 21:26:52 +0200 Subject: [PATCH 18/67] refactor --- ...notonic-sequences-natural-numbers.lagda.md | 17 ++++++------ .../asymptotical-dependent-sequences.lagda.md | 21 --------------- src/foundation/subsequences.lagda.md | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index b14b9f32a6..23a31609e2 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -11,6 +11,7 @@ open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers +open import foundation.asymptotical-dependent-sequences open import foundation.dependent-pair-types open import foundation.empty-types open import foundation.function-types @@ -170,25 +171,25 @@ module _ where limit-∞-is-strictly-increasing-sequence-ℕ : - (M : ℕ) → Σ ℕ (λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ M (f p)) + (M : ℕ) → asymptotically (λ n → leq-ℕ M (f n)) limit-∞-is-strictly-increasing-sequence-ℕ zero-ℕ = - ( zero-ℕ , λ p K → leq-zero-ℕ (f p)) + ( zero-ℕ , λ n K → leq-zero-ℕ (f n)) limit-∞-is-strictly-increasing-sequence-ℕ (succ-ℕ M) = map-Σ - ( λ N → (p : ℕ) → leq-ℕ N p → leq-ℕ (succ-ℕ M) (f p)) + ( is-modulus-dependent-sequence (λ n → leq-ℕ (succ-ℕ M) (f n))) ( succ-ℕ) - ( λ N K p I → - leq-succ-le-ℕ M (f p) + ( λ N K n I → + leq-succ-le-ℕ M (f n) (concatenate-leq-le-ℕ { M} { f N} - { f p} + { f n} ( K N (refl-leq-ℕ N)) - ( H N p + ( H N n ( concatenate-le-leq-ℕ { N} { succ-ℕ N} - { p} + { n} ( succ-le-ℕ N) ( I))))) ( limit-∞-is-strictly-increasing-sequence-ℕ M) diff --git a/src/foundation/asymptotical-dependent-sequences.lagda.md b/src/foundation/asymptotical-dependent-sequences.lagda.md index b96c4353bb..f60d009b44 100644 --- a/src/foundation/asymptotical-dependent-sequences.lagda.md +++ b/src/foundation/asymptotical-dependent-sequences.lagda.md @@ -9,13 +9,11 @@ module foundation.asymptotical-dependent-sequences where ```agda open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.maximum-natural-numbers -open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers open import foundation.dependent-pair-types open import foundation.dependent-sequences open import foundation.functoriality-dependent-pair-types -open import foundation.subsequences open import foundation.universe-levels ``` @@ -101,25 +99,6 @@ module _ (N , (λ n K → H n K n (refl-leq-ℕ n))) ``` -### Any subsequence of an asymptotical dependent sequence is asymptotical - -```agda -module _ - {l : Level} (A : ℕ → UU l) (B : subsequence A) - where - - asymptotically-sequence-subsequence : - asymptotically A → asymptotically (sequence-subsequence A B) - asymptotically-sequence-subsequence = - map-Σ - ( is-modulus-dependent-sequence (sequence-subsequence A B)) - ( modulus-subsequence A B) - ( λ N K p I → - K - ( extract-subsequence A B p) - ( is-modulus-subsequence A B N p I)) -``` - ### Asymptotical functorial action on asymptotical dependent sequences ```agda diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 256878d804..b236dd106c 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -12,6 +12,7 @@ open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers +open import foundation.asymptotical-dependent-sequences open import foundation.dependent-pair-types open import foundation.function-extensionality open import foundation.function-types @@ -170,3 +171,29 @@ module _ ( extract-subsequence u v) ( is-strictly-increasing-extract-subsequence u v) ``` + +### A dependent sequence is asymptotical if and only if all its subsequences are asymptotical + +```agda +module _ + {l : Level} (A : ℕ → UU l) + where + + asymptotically-sequence-subsequence : + asymptotically A → + ((B : subsequence A) → asymptotically (sequence-subsequence A B)) + asymptotically-sequence-subsequence H B = + map-Σ + ( is-modulus-dependent-sequence (sequence-subsequence A B)) + ( modulus-subsequence A B) + ( λ N K p I → + K + ( extract-subsequence A B p) + ( is-modulus-subsequence A B N p I)) + ( H) + + asymptotically-subsequence : + ((B : subsequence A) → asymptotically (sequence-subsequence A B)) → + asymptotically A + asymptotically-subsequence H = H (refl-subsequence A) +``` From 94b24f59b4a7ccee319e3b86f79c814833076f10 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 21 May 2024 22:21:27 +0200 Subject: [PATCH 19/67] leq-(left|right)-max-N --- .../maximum-natural-numbers.lagda.md | 19 ++++++++++++++-- ...asymptotically-constant-sequences.lagda.md | 22 ++++--------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/elementary-number-theory/maximum-natural-numbers.lagda.md b/src/elementary-number-theory/maximum-natural-numbers.lagda.md index 8e670f94dd..81be225b3f 100644 --- a/src/elementary-number-theory/maximum-natural-numbers.lagda.md +++ b/src/elementary-number-theory/maximum-natural-numbers.lagda.md @@ -75,6 +75,14 @@ leq-left-leq-max-ℕ k (succ-ℕ m) zero-ℕ H = H leq-left-leq-max-ℕ (succ-ℕ k) (succ-ℕ m) (succ-ℕ n) H = leq-left-leq-max-ℕ k m n H +leq-left-max-ℕ : (m n : ℕ) → m ≤-ℕ (max-ℕ m n) +leq-left-max-ℕ m n = + leq-left-leq-max-ℕ + ( max-ℕ m n) + ( m) + ( n) + ( refl-leq-ℕ (max-ℕ m n)) + leq-right-leq-max-ℕ : (k m n : ℕ) → (max-ℕ m n) ≤-ℕ k → n ≤-ℕ k leq-right-leq-max-ℕ k zero-ℕ zero-ℕ H = star @@ -83,6 +91,14 @@ leq-right-leq-max-ℕ k (succ-ℕ m) zero-ℕ H = star leq-right-leq-max-ℕ (succ-ℕ k) (succ-ℕ m) (succ-ℕ n) H = leq-right-leq-max-ℕ k m n H +leq-right-max-ℕ : (m n : ℕ) → n ≤-ℕ (max-ℕ m n) +leq-right-max-ℕ m n = + leq-right-leq-max-ℕ + ( max-ℕ m n) + ( m) + ( n) + ( refl-leq-ℕ (max-ℕ m n)) + is-least-upper-bound-max-ℕ : (m n : ℕ) → is-least-binary-upper-bound-Poset ℕ-Poset m n (max-ℕ m n) is-least-upper-bound-max-ℕ m n = @@ -91,8 +107,7 @@ is-least-upper-bound-max-ℕ m n = { m} { n} { max-ℕ m n} - ( leq-left-leq-max-ℕ (max-ℕ m n) m n (refl-leq-ℕ (max-ℕ m n)) , - leq-right-leq-max-ℕ (max-ℕ m n) m n (refl-leq-ℕ (max-ℕ m n))) + ( leq-left-max-ℕ m n , leq-right-max-ℕ m n) ( λ x (H , K) → leq-max-ℕ x m n H K) ``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 13b2c39c60..904867feab 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -98,32 +98,18 @@ module _ ( max-ℕ ( modulus-∞-value-∞-constant-sequence H) ( modulus-∞-value-∞-constant-sequence K)) - ( leq-left-leq-max-ℕ - ( max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K)) + ( leq-left-max-ℕ ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K) - ( refl-leq-ℕ - ( max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K))))) ∙ + ( modulus-∞-value-∞-constant-sequence K))) ∙ ( inv ( is-modulus-∞-value-∞-constant-sequence ( K) ( max-ℕ ( modulus-∞-value-∞-constant-sequence H) ( modulus-∞-value-∞-constant-sequence K)) - ( leq-right-leq-max-ℕ - ( max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K)) + ( leq-right-max-ℕ ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K) - ( refl-leq-ℕ - ( max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K)))))) + ( modulus-∞-value-∞-constant-sequence K)))) ``` ### An asymptotically constant sequence is asymptotically equal to the constant sequence of its asymptotical value From 8737a712e03d280a490700e3ea1c4002f5e0817d Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 23 May 2024 20:29:13 +0200 Subject: [PATCH 20/67] lemma monotonic sequences natural numbers --- ...notonic-sequences-natural-numbers.lagda.md | 286 ++++++++++++++++++ src/foundation/constant-sequences.lagda.md | 39 ++- 2 files changed, 322 insertions(+), 3 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 23a31609e2..54527e198e 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -7,18 +7,24 @@ module elementary-number-theory.monotonic-sequences-natural-numbers where
Imports ```agda +open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers open import foundation.asymptotical-dependent-sequences +open import foundation.constant-sequences +open import foundation.coproduct-types open import foundation.dependent-pair-types open import foundation.empty-types open import foundation.function-types +open import foundation.functoriality-coproduct-types open import foundation.functoriality-dependent-pair-types +open import foundation.identity-types open import foundation.negation open import foundation.propositions open import foundation.sequences +open import foundation.transport-along-identifications open import foundation.universe-levels ``` @@ -125,8 +131,288 @@ module _ is-prop-type-Prop is-strictly-decreasing-sequence-prop-ℕ ``` +### Monotonic values of sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) (n : ℕ) + where + + is-increasing-value-prop-sequence-ℕ : Prop lzero + is-increasing-value-prop-sequence-ℕ = leq-ℕ-Prop (f n) (f (succ-ℕ n)) + + is-increasing-value-sequence-ℕ : UU lzero + is-increasing-value-sequence-ℕ = + type-Prop is-increasing-value-prop-sequence-ℕ + + is-prop-is-increasing-value-sequence-ℕ : + is-prop is-increasing-value-sequence-ℕ + is-prop-is-increasing-value-sequence-ℕ = + is-prop-type-Prop is-increasing-value-prop-sequence-ℕ + + is-decreasing-value-prop-sequence-ℕ : Prop lzero + is-decreasing-value-prop-sequence-ℕ = leq-ℕ-Prop (f (succ-ℕ n)) (f n) + + is-decreasing-value-sequence-ℕ : UU lzero + is-decreasing-value-sequence-ℕ = + type-Prop is-decreasing-value-prop-sequence-ℕ + + is-prop-is-decreasing-value-sequence-ℕ : + is-prop is-decreasing-value-sequence-ℕ + is-prop-is-decreasing-value-sequence-ℕ = + is-prop-type-Prop is-decreasing-value-prop-sequence-ℕ +``` + +### Strict monotonic values of sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) (n : ℕ) + where + + is-strict-increasing-value-prop-sequence-ℕ : Prop lzero + is-strict-increasing-value-prop-sequence-ℕ = le-ℕ-Prop (f n) (f (succ-ℕ n)) + + is-strict-increasing-value-sequence-ℕ : UU lzero + is-strict-increasing-value-sequence-ℕ = + type-Prop is-strict-increasing-value-prop-sequence-ℕ + + is-prop-is-strict-increasing-value-sequence-ℕ : + is-prop is-strict-increasing-value-sequence-ℕ + is-prop-is-strict-increasing-value-sequence-ℕ = + is-prop-type-Prop is-strict-increasing-value-prop-sequence-ℕ + + is-strict-decreasing-value-prop-sequence-ℕ : Prop lzero + is-strict-decreasing-value-prop-sequence-ℕ = le-ℕ-Prop (f (succ-ℕ n)) (f n) + + is-strict-decreasing-value-sequence-ℕ : UU lzero + is-strict-decreasing-value-sequence-ℕ = + type-Prop is-strict-decreasing-value-prop-sequence-ℕ + + is-prop-is-strict-decreasing-value-sequence-ℕ : + is-prop is-strict-decreasing-value-sequence-ℕ + is-prop-is-strict-decreasing-value-sequence-ℕ = + is-prop-type-Prop is-strict-decreasing-value-prop-sequence-ℕ +``` + ## Properties +### A sequence is monotonic if and only if all its values are monotonic of the same monotonicity + +```agda +module _ + (f : sequence ℕ) + where + + is-increasing-value-is-increasing-sequence-ℕ : + is-increasing-sequence-ℕ f → + ((n : ℕ) → is-increasing-value-sequence-ℕ f n) + is-increasing-value-is-increasing-sequence-ℕ H n = + H n (succ-ℕ n) (succ-leq-ℕ n) + + is-increasing-is-increasing-value-sequence-ℕ : + ((n : ℕ) → is-increasing-value-sequence-ℕ f n) → + is-increasing-sequence-ℕ f + is-increasing-is-increasing-value-sequence-ℕ H p = + based-ind-ℕ + ( p) + ( λ k → leq-ℕ (f p) (f k)) + ( refl-leq-ℕ (f p)) + ( λ n J → transitive-leq-ℕ (f p) (f n) (f (succ-ℕ n)) (H n)) + + is-decreasing-value-is-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ f → + ((n : ℕ) → is-decreasing-value-sequence-ℕ f n) + is-decreasing-value-is-decreasing-sequence-ℕ H n = + H n (succ-ℕ n) (succ-leq-ℕ n) + + is-decreasing-is-decreasing-value-sequence-ℕ : + ((n : ℕ) → is-decreasing-value-sequence-ℕ f n) → + is-decreasing-sequence-ℕ f + is-decreasing-is-decreasing-value-sequence-ℕ H p = + based-ind-ℕ + ( p) + ( λ k → leq-ℕ (f k) (f p)) + ( refl-leq-ℕ (f p)) + ( λ n J K → transitive-leq-ℕ (f (succ-ℕ n)) (f n) (f p) K (H n)) +``` + +### A sequence is strictly monotonic if and only if all its values are strictly monotonic with the same monotonicity + +```agda +module _ + (f : sequence ℕ) + where + + is-strict-increasing-value-is-strictly-increasing-sequence-ℕ : + is-strictly-increasing-sequence-ℕ f → + ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) + is-strict-increasing-value-is-strictly-increasing-sequence-ℕ H n = + H n (succ-ℕ n) (succ-le-ℕ n) + + is-strictly-increasing-is-strict-increasing-value-sequence-ℕ : + ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) → + is-strictly-increasing-sequence-ℕ f + is-strictly-increasing-is-strict-increasing-value-sequence-ℕ H p q I = + based-ind-ℕ + ( succ-ℕ p) + ( λ k → le-ℕ (f p) (f k)) + ( H p) + ( λ n J K → transitive-le-ℕ (f p) (f n) (f (succ-ℕ n)) K ((H n))) + ( q) + ( leq-succ-le-ℕ p q I) + + is-strict-decreasing-value-is-strictly-decreasing-sequence-ℕ : + is-strictly-decreasing-sequence-ℕ f → + ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) + is-strict-decreasing-value-is-strictly-decreasing-sequence-ℕ H n = + H n (succ-ℕ n) (succ-le-ℕ n) + + is-strictly-decreasing-is-strict-decreasing-value-sequence-ℕ : + ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) → + is-strictly-decreasing-sequence-ℕ f + is-strictly-decreasing-is-strict-decreasing-value-sequence-ℕ H p q I = + based-ind-ℕ + ( succ-ℕ p) + ( λ k → le-ℕ (f k) (f p)) + ( H p) + ( λ n J → transitive-le-ℕ (f (succ-ℕ n)) (f n) (f p) (H n)) + ( q) + ( leq-succ-le-ℕ p q I) +``` + +## Strictly monotonic sequences of natural numbers are monotonic + +```agda +module _ + (f : sequence ℕ) + where + + is-increasing-value-is-strict-increasing-value-sequence-ℕ : + (n : ℕ) → + is-strict-increasing-value-sequence-ℕ f n → + is-increasing-value-sequence-ℕ f n + is-increasing-value-is-strict-increasing-value-sequence-ℕ n = + leq-le-ℕ (f n) (f (succ-ℕ n)) + + is-increasing-is-strictly-increasing-sequence-ℕ : + is-strictly-increasing-sequence-ℕ f → is-increasing-sequence-ℕ f + is-increasing-is-strictly-increasing-sequence-ℕ H = + is-increasing-is-increasing-value-sequence-ℕ f + ( λ n → is-increasing-value-is-strict-increasing-value-sequence-ℕ n + ( is-strict-increasing-value-is-strictly-increasing-sequence-ℕ f H n)) +``` + +### A monotonic value is either stationnary or strictly monotonic + +```agda +module _ + (f : sequence ℕ) (n : ℕ) + where + + decide-is-stationnary-is-increasing-value-sequence-ℕ : + is-increasing-value-sequence-ℕ f n → + (is-stationnary-value-sequence f n) + + (is-strict-increasing-value-sequence-ℕ f n) + decide-is-stationnary-is-increasing-value-sequence-ℕ = + eq-or-le-leq-ℕ (f n) (f (succ-ℕ n)) + + decide-is-stationnary-is-decreasing-value-sequence-ℕ : + is-decreasing-value-sequence-ℕ f n → + (is-stationnary-value-sequence f n) + + (is-strict-decreasing-value-sequence-ℕ f n) + decide-is-stationnary-is-decreasing-value-sequence-ℕ H = + map-coproduct inv id (eq-or-le-leq-ℕ (f (succ-ℕ n)) (f n) H) +``` + +### A decreasing sequence that takes the value zero is asymptotically equal to zero + +```agda +module _ + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + where + + is-∞-zero-is-zero-value-decreasing-sequence-ℕ : + (n : ℕ) (K : f n = zero-ℕ) → (k : ℕ) → leq-ℕ n k → zero-ℕ = f k + is-∞-zero-is-zero-value-decreasing-sequence-ℕ n K k I = + is-zero-leq-zero-ℕ' (f k) (tr (leq-ℕ (f k)) K (H n k I)) +``` + +### A decreasing sequence of natural numbers that has no strictly decreasing value is constant + +```agda +module _ + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + where + + is-constant-no-strict-decreasing-value-decreasing-sequence-ℕ : + ((n : ℕ) → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → + is-constant-sequence f + is-constant-no-strict-decreasing-value-decreasing-sequence-ℕ K = + is-constant-is-stationnary-value-sequence f + ( λ n → + rec-coproduct + ( id) + ( ex-falso ∘ (K n)) + ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n + ( is-decreasing-value-is-decreasing-sequence-ℕ f H n))) +``` + +### A decreasing sequence of natural numbers that asymptotically has no strictly decreasing value is asymptotically constant + +```agda +module _ + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) (N : ℕ) + where + + is-∞-constant-∞-no-strict-decreasing-value-decreasing-sequence-ℕ : + ((n : ℕ) → (leq-ℕ N n) → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → + ((n : ℕ) → leq-ℕ N n → f N = f n) + is-∞-constant-∞-no-strict-decreasing-value-decreasing-sequence-ℕ K = + based-ind-ℕ + ( N) + ( λ n → f N = f n) + ( refl) + ( λ n I J → + rec-coproduct + ( J ∙_) + ( ex-falso ∘ (K n I)) + ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n + (is-decreasing-value-is-decreasing-sequence-ℕ f H n))) +``` + +### A decreasing sequence of natural numbers with bounded strictly decreasing values is asymptotically constant + +```agda +module _ + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) (N : ℕ) + where + + is-∞-constant-is-bounded-strict-decreasing-value-decreasing-sequence-ℕ : + ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n → le-ℕ n N) → + ((n : ℕ) → leq-ℕ N n → f N = f n) + is-∞-constant-is-bounded-strict-decreasing-value-decreasing-sequence-ℕ K = + is-∞-constant-∞-no-strict-decreasing-value-decreasing-sequence-ℕ f H N + ( λ n I J → contradiction-le-ℕ n N (K n J) I) +``` + +### Any subsequence of a decreasing sequence of natural numbers is decreasing + +```agda +module _ + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + (φ : sequence ℕ) (K : is-strictly-increasing-sequence-ℕ φ) + where + + is-decreasing-subsequence-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ (f ∘ φ) + is-decreasing-subsequence-decreasing-sequence-ℕ p q I = + H + ( φ p) + ( φ q) + ( is-increasing-is-strictly-increasing-sequence-ℕ φ K p q I) +``` + ### There exist no strictly decreasing sequences of natural numbers ```agda diff --git a/src/foundation/constant-sequences.lagda.md b/src/foundation/constant-sequences.lagda.md index dabcc2de87..b3de7eb154 100644 --- a/src/foundation/constant-sequences.lagda.md +++ b/src/foundation/constant-sequences.lagda.md @@ -46,6 +46,17 @@ module _ constant-sequence = Σ (sequence A) is-constant-sequence ``` +### Stationnary values of a sequence + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + is-stationnary-value-sequence : ℕ → UU l + is-stationnary-value-sequence n = (u n) = (u (succ-ℕ n)) +``` + ## Properties ### The value of a constant sequence @@ -88,10 +99,32 @@ module _ ```agda module _ - {l : Level} {A : UU l} (u : sequence A) + {l : Level} {A : UU l} (x : A) (u : sequence A) where is-constant-htpy-constant-sequence : - Σ A (λ x → (const-sequence x) ~ u) → is-constant-sequence u - is-constant-htpy-constant-sequence (x , H) p q = inv (H p) ∙ H q + (const-sequence x) ~ u → is-constant-sequence u + is-constant-htpy-constant-sequence H p q = inv (H p) ∙ H q +``` + +### A sequence is constant if and only if all its values are stationnary + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) + where + + is-stationnary-value-is-constant-sequence : + is-constant-sequence u → + ((n : ℕ) → is-stationnary-value-sequence u n) + is-stationnary-value-is-constant-sequence H n = H n (succ-ℕ n) + + is-constant-is-stationnary-value-sequence : + ((n : ℕ) → is-stationnary-value-sequence u n) → + is-constant-sequence u + is-constant-is-stationnary-value-sequence H = + is-constant-htpy-constant-sequence + ( u zero-ℕ) + ( u) + ( ind-ℕ (refl) (λ n K → K ∙ H n)) ``` From e504583911d5237d56d9ae0a0dbb40002eb688e7 Mon Sep 17 00:00:00 2001 From: malarbol Date: Sun, 26 May 2024 18:53:52 +0200 Subject: [PATCH 21/67] refactor asymptotical properties monotonic sequences natural numbers --- src/elementary-number-theory.lagda.md | 1 + ...notonic-sequences-natural-numbers.lagda.md | 552 ++++++++++-------- ...notonic-sequences-natural-numbers.lagda.md | 356 +++++++++++ ...asymptotically-constant-sequences.lagda.md | 25 +- src/foundation/subsequences.lagda.md | 74 ++- 5 files changed, 747 insertions(+), 261 deletions(-) create mode 100644 src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md diff --git a/src/elementary-number-theory.lagda.md b/src/elementary-number-theory.lagda.md index 0d070da57e..6590210b19 100644 --- a/src/elementary-number-theory.lagda.md +++ b/src/elementary-number-theory.lagda.md @@ -145,6 +145,7 @@ open import elementary-number-theory.strict-inequality-integer-fractions public open import elementary-number-theory.strict-inequality-integers public open import elementary-number-theory.strict-inequality-natural-numbers public open import elementary-number-theory.strict-inequality-rational-numbers public +open import elementary-number-theory.strict-monotonic-sequences-natural-numbers public open import elementary-number-theory.strictly-ordered-pairs-of-natural-numbers public open import elementary-number-theory.strong-induction-natural-numbers public open import elementary-number-theory.sums-of-natural-numbers public diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 54527e198e..d64b79b5f0 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -11,8 +11,11 @@ open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers +open import elementary-number-theory.strict-monotonic-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotically-constant-sequences +open import foundation.cartesian-product-types open import foundation.constant-sequences open import foundation.coproduct-types open import foundation.dependent-pair-types @@ -24,6 +27,7 @@ open import foundation.identity-types open import foundation.negation open import foundation.propositions open import foundation.sequences +open import foundation.subsequences open import foundation.transport-along-identifications open import foundation.universe-levels ``` @@ -33,7 +37,7 @@ open import foundation.universe-levels ## Idea Monotic sequences of natural numbers are functions `f : ℕ → ℕ` that preserve or -reverse (strict) inequality of natural numbers. +reverse inequality of natural numbers. ## Definitions @@ -61,30 +65,6 @@ module _ is-prop-type-Prop is-increasing-prop-sequence-ℕ ``` -### Strictly increasing sequences of natural numbers - -```agda -module _ - (f : sequence ℕ) - where - - is-strictly-increasing-sequence-prop-ℕ : Prop lzero - is-strictly-increasing-sequence-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f i) (f j)))) - - is-strictly-increasing-sequence-ℕ : UU lzero - is-strictly-increasing-sequence-ℕ = - type-Prop is-strictly-increasing-sequence-prop-ℕ - - is-prop-is-strictly-increasing-sequence-ℕ : - is-prop is-strictly-increasing-sequence-ℕ - is-prop-is-strictly-increasing-sequence-ℕ = - is-prop-type-Prop is-strictly-increasing-sequence-prop-ℕ -``` - ### Decreasing sequences of natural numbers ```agda @@ -107,30 +87,6 @@ module _ is-prop-type-Prop is-decreasing-sequence-prop-ℕ ``` -### Strictly decreasing sequences of natural numbers - -```agda -module _ - (f : sequence ℕ) - where - - is-strictly-decreasing-sequence-prop-ℕ : Prop lzero - is-strictly-decreasing-sequence-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) - - is-strictly-decreasing-sequence-ℕ : UU lzero - is-strictly-decreasing-sequence-ℕ = - type-Prop is-strictly-decreasing-sequence-prop-ℕ - - is-prop-is-strictly-decreasing-sequence-ℕ : - is-prop is-strictly-decreasing-sequence-ℕ - is-prop-is-strictly-decreasing-sequence-ℕ = - is-prop-type-Prop is-strictly-decreasing-sequence-prop-ℕ -``` - ### Monotonic values of sequences of natural numbers ```agda @@ -163,38 +119,6 @@ module _ is-prop-type-Prop is-decreasing-value-prop-sequence-ℕ ``` -### Strict monotonic values of sequences of natural numbers - -```agda -module _ - (f : sequence ℕ) (n : ℕ) - where - - is-strict-increasing-value-prop-sequence-ℕ : Prop lzero - is-strict-increasing-value-prop-sequence-ℕ = le-ℕ-Prop (f n) (f (succ-ℕ n)) - - is-strict-increasing-value-sequence-ℕ : UU lzero - is-strict-increasing-value-sequence-ℕ = - type-Prop is-strict-increasing-value-prop-sequence-ℕ - - is-prop-is-strict-increasing-value-sequence-ℕ : - is-prop is-strict-increasing-value-sequence-ℕ - is-prop-is-strict-increasing-value-sequence-ℕ = - is-prop-type-Prop is-strict-increasing-value-prop-sequence-ℕ - - is-strict-decreasing-value-prop-sequence-ℕ : Prop lzero - is-strict-decreasing-value-prop-sequence-ℕ = le-ℕ-Prop (f (succ-ℕ n)) (f n) - - is-strict-decreasing-value-sequence-ℕ : UU lzero - is-strict-decreasing-value-sequence-ℕ = - type-Prop is-strict-decreasing-value-prop-sequence-ℕ - - is-prop-is-strict-decreasing-value-sequence-ℕ : - is-prop is-strict-decreasing-value-sequence-ℕ - is-prop-is-strict-decreasing-value-sequence-ℕ = - is-prop-type-Prop is-strict-decreasing-value-prop-sequence-ℕ -``` - ## Properties ### A sequence is monotonic if and only if all its values are monotonic of the same monotonicity @@ -237,51 +161,7 @@ module _ ( λ n J K → transitive-leq-ℕ (f (succ-ℕ n)) (f n) (f p) K (H n)) ``` -### A sequence is strictly monotonic if and only if all its values are strictly monotonic with the same monotonicity - -```agda -module _ - (f : sequence ℕ) - where - - is-strict-increasing-value-is-strictly-increasing-sequence-ℕ : - is-strictly-increasing-sequence-ℕ f → - ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) - is-strict-increasing-value-is-strictly-increasing-sequence-ℕ H n = - H n (succ-ℕ n) (succ-le-ℕ n) - - is-strictly-increasing-is-strict-increasing-value-sequence-ℕ : - ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) → - is-strictly-increasing-sequence-ℕ f - is-strictly-increasing-is-strict-increasing-value-sequence-ℕ H p q I = - based-ind-ℕ - ( succ-ℕ p) - ( λ k → le-ℕ (f p) (f k)) - ( H p) - ( λ n J K → transitive-le-ℕ (f p) (f n) (f (succ-ℕ n)) K ((H n))) - ( q) - ( leq-succ-le-ℕ p q I) - - is-strict-decreasing-value-is-strictly-decreasing-sequence-ℕ : - is-strictly-decreasing-sequence-ℕ f → - ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) - is-strict-decreasing-value-is-strictly-decreasing-sequence-ℕ H n = - H n (succ-ℕ n) (succ-le-ℕ n) - - is-strictly-decreasing-is-strict-decreasing-value-sequence-ℕ : - ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) → - is-strictly-decreasing-sequence-ℕ f - is-strictly-decreasing-is-strict-decreasing-value-sequence-ℕ H p q I = - based-ind-ℕ - ( succ-ℕ p) - ( λ k → le-ℕ (f k) (f p)) - ( H p) - ( λ n J → transitive-le-ℕ (f (succ-ℕ n)) (f n) (f p) (H n)) - ( q) - ( leq-succ-le-ℕ p q I) -``` - -## Strictly monotonic sequences of natural numbers are monotonic +## Strictly increasing sequences of natural numbers are monotonic ```agda module _ @@ -295,12 +175,50 @@ module _ is-increasing-value-is-strict-increasing-value-sequence-ℕ n = leq-le-ℕ (f n) (f (succ-ℕ n)) - is-increasing-is-strictly-increasing-sequence-ℕ : - is-strictly-increasing-sequence-ℕ f → is-increasing-sequence-ℕ f - is-increasing-is-strictly-increasing-sequence-ℕ H = + is-increasing-is-strict-increasing-sequence-ℕ : + is-strict-increasing-sequence-ℕ f → is-increasing-sequence-ℕ f + is-increasing-is-strict-increasing-sequence-ℕ H = is-increasing-is-increasing-value-sequence-ℕ f ( λ n → is-increasing-value-is-strict-increasing-value-sequence-ℕ n - ( is-strict-increasing-value-is-strictly-increasing-sequence-ℕ f H n)) + ( is-strict-increasing-value-is-strict-increasing-sequence-ℕ f H n)) +``` + +### Any subsequence of a monotonic sequence of natural numbers is monotonic + +```agda +module _ + (u : sequence ℕ) + where + + is-increasing-subsequence-increasing-sequence-ℕ : + (H : is-increasing-sequence-ℕ u) → + (v : subsequence u) → + is-increasing-sequence-ℕ (sequence-subsequence u v) + is-increasing-subsequence-increasing-sequence-ℕ H v p q I = + H + ( extract-subsequence u v p) + ( extract-subsequence u v q) + ( is-increasing-is-strict-increasing-sequence-ℕ + ( extract-subsequence u v) + ( is-strict-increasing-extract-subsequence u v) + ( p) + ( q) + ( I)) + + is-decreasing-subsequence-decreasing-sequence-ℕ : + (H : is-decreasing-sequence-ℕ u) → + (v : subsequence u) → + is-decreasing-sequence-ℕ (sequence-subsequence u v) + is-decreasing-subsequence-decreasing-sequence-ℕ H v p q I = + H + ( extract-subsequence u v p) + ( extract-subsequence u v q) + ( is-increasing-is-strict-increasing-sequence-ℕ + ( extract-subsequence u v) + ( is-strict-increasing-extract-subsequence u v) + ( p) + ( q) + ( I)) ``` ### A monotonic value is either stationnary or strictly monotonic @@ -333,9 +251,15 @@ module _ where is-∞-zero-is-zero-value-decreasing-sequence-ℕ : - (n : ℕ) (K : f n = zero-ℕ) → (k : ℕ) → leq-ℕ n k → zero-ℕ = f k - is-∞-zero-is-zero-value-decreasing-sequence-ℕ n K k I = - is-zero-leq-zero-ℕ' (f k) (tr (leq-ℕ (f k)) K (H n k I)) + Σ ℕ (λ n → zero-ℕ = f n) → asymptotically (λ n → zero-ℕ = f n) + is-∞-zero-is-zero-value-decreasing-sequence-ℕ = + rec-Σ + ( λ n K → + ( n , + λ k I → + is-zero-leq-zero-ℕ' + ( f k) + ( inv-tr (leq-ℕ (f k)) K (H n k I)))) ``` ### A decreasing sequence of natural numbers that has no strictly decreasing value is constant @@ -362,132 +286,296 @@ module _ ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) (N : ℕ) + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) where - is-∞-constant-∞-no-strict-decreasing-value-decreasing-sequence-ℕ : - ((n : ℕ) → (leq-ℕ N n) → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → - ((n : ℕ) → leq-ℕ N n → f N = f n) - is-∞-constant-∞-no-strict-decreasing-value-decreasing-sequence-ℕ K = - based-ind-ℕ - ( N) - ( λ n → f N = f n) - ( refl) - ( λ n I J → - rec-coproduct - ( J ∙_) - ( ex-falso ∘ (K n I)) - ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n - (is-decreasing-value-is-decreasing-sequence-ℕ f H n))) + is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ : + asymptotically (λ n → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → + is-∞-constant-sequence f + is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ = + rec-Σ + ( λ N K → + is-∞-constant-eq-∞-constant-sequence + ( f N) + ( f) + ( ( N) , + ( based-ind-ℕ + ( N) + ( λ n → f N = f n) + ( refl) + ( λ n I J → + rec-coproduct + ( J ∙_) + ( ex-falso ∘ (K n I)) + ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n + (is-decreasing-value-is-decreasing-sequence-ℕ f H n)))))) ``` ### A decreasing sequence of natural numbers with bounded strictly decreasing values is asymptotically constant ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) (N : ℕ) + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + where + + is-upper-bound-strict-value-decreasing-sequence-ℕ : ℕ → UU lzero + is-upper-bound-strict-value-decreasing-sequence-ℕ N = + (n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n → le-ℕ n N + + is-∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ : + Σ ℕ is-upper-bound-strict-value-decreasing-sequence-ℕ → + is-∞-constant-sequence f + is-∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ = + ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ f H) ∘ + ( rec-Σ (λ N I → (N , (λ n J L → contradiction-le-ℕ n N (I n L) J)))) +``` + +### Asymptotical strictly decreasing values + +```agda +module _ + (f : sequence ℕ) (N n : ℕ) where - is-∞-constant-is-bounded-strict-decreasing-value-decreasing-sequence-ℕ : - ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n → le-ℕ n N) → - ((n : ℕ) → leq-ℕ N n → f N = f n) - is-∞-constant-is-bounded-strict-decreasing-value-decreasing-sequence-ℕ K = - is-∞-constant-∞-no-strict-decreasing-value-decreasing-sequence-ℕ f H N - ( λ n I J → contradiction-le-ℕ n N (K n J) I) + is-∞-strict-decreasing-value-prop-sequence-ℕ : Prop lzero + is-∞-strict-decreasing-value-prop-sequence-ℕ = + product-Prop + (leq-ℕ-Prop N n) + (is-strict-decreasing-value-prop-sequence-ℕ f n) + + is-∞-strict-decreasing-value-sequence-ℕ : UU lzero + is-∞-strict-decreasing-value-sequence-ℕ = + type-Prop is-∞-strict-decreasing-value-prop-sequence-ℕ + + is-prop-is-∞-strict-decreasing-value-sequence-ℕ : + is-prop is-∞-strict-decreasing-value-sequence-ℕ + is-prop-is-∞-strict-decreasing-value-sequence-ℕ = + is-prop-type-Prop is-∞-strict-decreasing-value-prop-sequence-ℕ ``` -### Any subsequence of a decreasing sequence of natural numbers is decreasing +### A decreasing sequence of natural numbers with no asymptotical strictly decreasing values is asymptotically constant ```agda module _ (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) - (φ : sequence ℕ) (K : is-strictly-increasing-sequence-ℕ φ) where - is-decreasing-subsequence-decreasing-sequence-ℕ : - is-decreasing-sequence-ℕ (f ∘ φ) - is-decreasing-subsequence-decreasing-sequence-ℕ p q I = - H - ( φ p) - ( φ q) - ( is-increasing-is-strictly-increasing-sequence-ℕ φ K p q I) + is-∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ : + Σ ℕ (λ N → ¬ Σ ℕ (is-∞-strict-decreasing-value-sequence-ℕ f N)) → + is-∞-constant-sequence f + is-∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ = + ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ f H) ∘ + ( rec-Σ (λ N K → (N , λ n I J → K (n , (I , J))))) ``` -### There exist no strictly decreasing sequences of natural numbers +### A monotonic sequence of natural numbers with a constant subsequence is asymptotically constant ```agda -no-strictly-decreasing-sequence-leq-ℕ : - (f : sequence ℕ) → - (N : ℕ) → - is-strictly-decreasing-sequence-ℕ f → - leq-ℕ (f zero-ℕ) N → - empty -no-strictly-decreasing-sequence-leq-ℕ f zero-ℕ H = - concatenate-le-leq-ℕ - { f 1} - { f 0} - { 0} - ( H 0 1 (succ-le-ℕ 0)) -no-strictly-decreasing-sequence-leq-ℕ f (succ-ℕ N) H K = - no-strictly-decreasing-sequence-leq-ℕ - ( f ∘ succ-ℕ) - ( N) - ( λ i j → H (succ-ℕ i) (succ-ℕ j)) - ( leq-le-succ-ℕ - ( f 1) - ( N) - ( concatenate-le-leq-ℕ - { f 1} - { f 0} - { succ-ℕ N} - ( H 0 1 (succ-le-ℕ 0)) - ( K))) - -no-strictly-decreasing-sequence-ℕ : - (f : sequence ℕ) → ¬ (is-strictly-decreasing-sequence-ℕ f) -no-strictly-decreasing-sequence-ℕ f H = - no-strictly-decreasing-sequence-leq-ℕ f (f 0) H (refl-leq-ℕ (f 0)) +module _ + (u : sequence ℕ) + where + + is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ : + is-increasing-sequence-ℕ u → + Σ (subsequence u) (is-constant-sequence ∘ (sequence-subsequence u)) → + is-∞-constant-sequence u + is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H = + rec-Σ + ( λ v K → + is-∞-constant-eq-∞-constant-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-ℕ + ( u (extract-subsequence u v zero-ℕ)) + ( u n) + ( H (extract-subsequence u v zero-ℕ) n I) + ( tr + ( leq-ℕ (u n)) + ( K (modulus-subsequence u v n) zero-ℕ) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n)))))) + + is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ u → + Σ (subsequence u) (is-constant-sequence ∘ (sequence-subsequence u)) → + is-∞-constant-sequence u + is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H = + rec-Σ + ( λ v K → + is-∞-constant-eq-∞-constant-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-ℕ + ( u (extract-subsequence u v zero-ℕ)) + ( u n) + ( tr + ( λ k → leq-ℕ k (u n)) + ( K (modulus-subsequence u v n) zero-ℕ) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n))) + ( H (extract-subsequence u v zero-ℕ) n I)))) ``` -### Strictly increasing sequences of natural numbers grow infinitely +### A monotonic sequence of natural numbers with an asymptotically constant subsequence is asymptotically constant ```agda module _ - (f : sequence ℕ) (H : is-strictly-increasing-sequence-ℕ f) + (u : sequence ℕ) where - limit-∞-is-strictly-increasing-sequence-ℕ : - (M : ℕ) → asymptotically (λ n → leq-ℕ M (f n)) - limit-∞-is-strictly-increasing-sequence-ℕ zero-ℕ = - ( zero-ℕ , λ n K → leq-zero-ℕ (f n)) - limit-∞-is-strictly-increasing-sequence-ℕ (succ-ℕ M) = - map-Σ - ( is-modulus-dependent-sequence (λ n → leq-ℕ (succ-ℕ M) (f n))) - ( succ-ℕ) - ( λ N K n I → - leq-succ-le-ℕ M (f n) - (concatenate-leq-le-ℕ - { M} - { f N} - { f n} - ( K N (refl-leq-ℕ N)) - ( H N n - ( concatenate-le-leq-ℕ - { N} - { succ-ℕ N} - { n} - ( succ-le-ℕ N) - ( I))))) - ( limit-∞-is-strictly-increasing-sequence-ℕ M) - - modulus-limit-∞-is-strictly-increasing-sequence-ℕ : ℕ → ℕ - modulus-limit-∞-is-strictly-increasing-sequence-ℕ M = - pr1 (limit-∞-is-strictly-increasing-sequence-ℕ M) - - is-modulus-limit-∞-is-strictly-increasing-sequence-ℕ : - (M p : ℕ) → - leq-ℕ (modulus-limit-∞-is-strictly-increasing-sequence-ℕ M) p → - leq-ℕ M (f p) - is-modulus-limit-∞-is-strictly-increasing-sequence-ℕ M = - pr2 (limit-∞-is-strictly-increasing-sequence-ℕ M) + is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ : + is-increasing-sequence-ℕ u → + Σ (subsequence u) (is-∞-constant-sequence ∘ (sequence-subsequence u)) → + is-∞-constant-sequence u + is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ H = + ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ u H) ∘ + ( rec-Σ (λ v K → + rec-Σ + ( λ w I → ( sub-subsequence u v w , I)) + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v) + ( K)))) + + is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ u → + Σ (subsequence u) (is-∞-constant-sequence ∘ (sequence-subsequence u)) → + is-∞-constant-sequence u + is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ H = + ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ u H) ∘ + ( rec-Σ + ( λ v → + ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v)))) +``` + +### A decreasing sequence of natural numbers cannot have arbitrarily large strict decreasing values + +```agda +module _ + (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + (K : (N : ℕ) → Σ ℕ (is-∞-strict-decreasing-value-sequence-ℕ f N)) + where + + extract-∞-strict-decreasing-value-sequence-ℕ : ℕ → ℕ + extract-∞-strict-decreasing-value-sequence-ℕ zero-ℕ = pr1 (K zero-ℕ) + extract-∞-strict-decreasing-value-sequence-ℕ (succ-ℕ n) = + pr1 (K (succ-ℕ (extract-∞-strict-decreasing-value-sequence-ℕ n))) + + is-strict-value-∞-strict-decreasing-value-sequence-ℕ : + (n : ℕ) → + is-strict-decreasing-value-sequence-ℕ f + (extract-∞-strict-decreasing-value-sequence-ℕ n) + is-strict-value-∞-strict-decreasing-value-sequence-ℕ zero-ℕ = + pr2 (pr2 (K zero-ℕ)) + is-strict-value-∞-strict-decreasing-value-sequence-ℕ (succ-ℕ n) = + pr2 (pr2 (K (succ-ℕ (extract-∞-strict-decreasing-value-sequence-ℕ n)))) + + leq-succ-extract-∞-strict-decreasing-value-sequence-ℕ : + (n : ℕ) → + leq-ℕ + (succ-ℕ (extract-∞-strict-decreasing-value-sequence-ℕ n)) + (extract-∞-strict-decreasing-value-sequence-ℕ (succ-ℕ n)) + leq-succ-extract-∞-strict-decreasing-value-sequence-ℕ n = + pr1 + ( pr2 + ( K + ( succ-ℕ + ( extract-∞-strict-decreasing-value-sequence-ℕ n)))) + + no-∞-strict-decreasing-value-decreasing-sequence-ℕ : empty + no-∞-strict-decreasing-value-decreasing-sequence-ℕ = + no-strict-decreasing-value-sequence-ℕ + ( f ∘ extract-∞-strict-decreasing-value-sequence-ℕ) + ( λ n → + concatenate-leq-le-ℕ + { f (extract-∞-strict-decreasing-value-sequence-ℕ (succ-ℕ n))} + { f (succ-ℕ (extract-∞-strict-decreasing-value-sequence-ℕ n))} + { f (extract-∞-strict-decreasing-value-sequence-ℕ n)} + ( H + ( succ-ℕ (extract-∞-strict-decreasing-value-sequence-ℕ n)) + ( extract-∞-strict-decreasing-value-sequence-ℕ (succ-ℕ n)) + ( leq-succ-extract-∞-strict-decreasing-value-sequence-ℕ n)) + ( is-strict-value-∞-strict-decreasing-value-sequence-ℕ n)) +``` + +### The subsequences of a decreasing sequence of natural numbers don't all have a strict decreasing value + +#### Strict decreasing values of subsequences + +```agda +module _ + (u : sequence ℕ) (v : subsequence u) + where + + is-strict-decreasing-value-subsequence-ℕ : ℕ → UU lzero + is-strict-decreasing-value-subsequence-ℕ = + is-strict-decreasing-value-sequence-ℕ (sequence-subsequence u v) +``` + +#### Not all subsequences of a decreasing sequence of natural nimbers have a strict decreasing value + +```agda +module _ + (u : sequence ℕ) (H : is-decreasing-sequence-ℕ u) + (K : (v : subsequence u) → Σ ℕ (is-strict-decreasing-value-subsequence-ℕ u v)) + where + + extract-strict-decreasing-value-subsequence-ℕ : ℕ → ℕ + extract-strict-decreasing-value-subsequence-ℕ zero-ℕ = + pr1 (K (refl-subsequence u)) + extract-strict-decreasing-value-subsequence-ℕ (succ-ℕ n) = + skip-ℕ + ( extract-strict-decreasing-value-subsequence-ℕ n) + ( pr1 + ( K + ( skip-subsequence + ( extract-strict-decreasing-value-subsequence-ℕ n) + ( u)))) + + is-strict-value-extract-strict-decreasing-value-subsequence-ℕ : + (n : ℕ) → + is-strict-decreasing-value-sequence-ℕ u + (extract-strict-decreasing-value-subsequence-ℕ n) + is-strict-value-extract-strict-decreasing-value-subsequence-ℕ zero-ℕ = + pr2 (K (refl-subsequence u)) + is-strict-value-extract-strict-decreasing-value-subsequence-ℕ (succ-ℕ n) = + pr2 + ( K + ( skip-subsequence + ( extract-strict-decreasing-value-subsequence-ℕ n) + ( u))) + + no-strict-decreasing-value-subsequence-ℕ : empty + no-strict-decreasing-value-subsequence-ℕ = + no-strict-decreasing-value-sequence-ℕ + ( u ∘ extract-strict-decreasing-value-subsequence-ℕ) + ( λ n → + concatenate-leq-le-ℕ + { u (extract-strict-decreasing-value-subsequence-ℕ (succ-ℕ n))} + { u (succ-ℕ (extract-strict-decreasing-value-subsequence-ℕ n))} + { u (extract-strict-decreasing-value-subsequence-ℕ n)} + ( H + ( succ-ℕ (extract-strict-decreasing-value-subsequence-ℕ n)) + ( skip-ℕ + ( extract-strict-decreasing-value-subsequence-ℕ n) + ( pr1 + ( K + ( strict-increasing-skip-ℕ + ( extract-strict-decreasing-value-subsequence-ℕ n))))) + ( leq-add-ℕ + ( extract-strict-decreasing-value-subsequence-ℕ n) + ( pr1 + ( K + ( strict-increasing-skip-ℕ + ( extract-strict-decreasing-value-subsequence-ℕ n)))))) + ( is-strict-value-extract-strict-decreasing-value-subsequence-ℕ n)) ``` diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md new file mode 100644 index 0000000000..651af10b2f --- /dev/null +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -0,0 +1,356 @@ +# Strictly monotonic sequences of natural numbers + +```agda +module elementary-number-theory.strict-monotonic-sequences-natural-numbers where +``` + +
Imports + +```agda +open import elementary-number-theory.addition-natural-numbers +open import elementary-number-theory.based-induction-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-inequality-natural-numbers + +open import foundation.action-on-identifications-functions +open import foundation.asymptotical-dependent-sequences +open import foundation.cartesian-product-types +open import foundation.constant-sequences +open import foundation.coproduct-types +open import foundation.dependent-pair-types +open import foundation.empty-types +open import foundation.function-types +open import foundation.functoriality-coproduct-types +open import foundation.functoriality-dependent-pair-types +open import foundation.identity-types +open import foundation.negation +open import foundation.propositions +open import foundation.sequences +open import foundation.subtypes +open import foundation.transport-along-identifications +open import foundation.universe-levels +``` + +
+ +## Idea + +Strictly monotic sequences of natural numbers are functions `f : ℕ → ℕ` that +preserve or reverse strict inequality of natural numbers. + +Strictly decreasing sequences of natural numbers don't exist. + +Strictly increasing sequences of natural numbers are stable under composition +and can get arbitrarily large. + +## Definitions + +### Strictly increasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-strict-increasing-sequence-prop-ℕ : Prop lzero + is-strict-increasing-sequence-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f i) (f j)))) + + is-strict-increasing-sequence-ℕ : UU lzero + is-strict-increasing-sequence-ℕ = + type-Prop is-strict-increasing-sequence-prop-ℕ + + is-prop-is-strict-increasing-sequence-ℕ : + is-prop is-strict-increasing-sequence-ℕ + is-prop-is-strict-increasing-sequence-ℕ = + is-prop-type-Prop is-strict-increasing-sequence-prop-ℕ +``` + +### The type of strictly increasing sequences of natural numbers + +```agda +strict-increasing-sequence-ℕ : UU lzero +strict-increasing-sequence-ℕ = type-subtype is-strict-increasing-sequence-prop-ℕ + +module _ + (f : strict-increasing-sequence-ℕ) + where + + sequence-strict-increasing-sequence-ℕ : sequence ℕ + sequence-strict-increasing-sequence-ℕ = pr1 f + + is-strict-increasing-sequence-strict-increasing-sequence-ℕ : + is-strict-increasing-sequence-ℕ + sequence-strict-increasing-sequence-ℕ + is-strict-increasing-sequence-strict-increasing-sequence-ℕ = pr2 f +``` + +### Strictly decreasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-strict-decreasing-sequence-prop-ℕ : Prop lzero + is-strict-decreasing-sequence-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) + + is-strict-decreasing-sequence-ℕ : UU lzero + is-strict-decreasing-sequence-ℕ = + type-Prop is-strict-decreasing-sequence-prop-ℕ + + is-prop-is-strict-decreasing-sequence-ℕ : + is-prop is-strict-decreasing-sequence-ℕ + is-prop-is-strict-decreasing-sequence-ℕ = + is-prop-type-Prop is-strict-decreasing-sequence-prop-ℕ +``` + +### Strict monotonic values of sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) (n : ℕ) + where + + is-strict-increasing-value-prop-sequence-ℕ : Prop lzero + is-strict-increasing-value-prop-sequence-ℕ = le-ℕ-Prop (f n) (f (succ-ℕ n)) + + is-strict-increasing-value-sequence-ℕ : UU lzero + is-strict-increasing-value-sequence-ℕ = + type-Prop is-strict-increasing-value-prop-sequence-ℕ + + is-prop-is-strict-increasing-value-sequence-ℕ : + is-prop is-strict-increasing-value-sequence-ℕ + is-prop-is-strict-increasing-value-sequence-ℕ = + is-prop-type-Prop is-strict-increasing-value-prop-sequence-ℕ + + is-strict-decreasing-value-prop-sequence-ℕ : Prop lzero + is-strict-decreasing-value-prop-sequence-ℕ = le-ℕ-Prop (f (succ-ℕ n)) (f n) + + is-strict-decreasing-value-sequence-ℕ : UU lzero + is-strict-decreasing-value-sequence-ℕ = + type-Prop is-strict-decreasing-value-prop-sequence-ℕ + + is-prop-is-strict-decreasing-value-sequence-ℕ : + is-prop is-strict-decreasing-value-sequence-ℕ + is-prop-is-strict-decreasing-value-sequence-ℕ = + is-prop-type-Prop is-strict-decreasing-value-prop-sequence-ℕ +``` + +## Properties + +### A sequence is strictly monotonic if and only if all its values are strictly monotonic with the same monotonicity + +```agda +module _ + (f : sequence ℕ) + where + + is-strict-increasing-value-is-strict-increasing-sequence-ℕ : + is-strict-increasing-sequence-ℕ f → + ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) + is-strict-increasing-value-is-strict-increasing-sequence-ℕ H n = + H n (succ-ℕ n) (succ-le-ℕ n) + + is-strict-increasing-is-strict-increasing-value-sequence-ℕ : + ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) → + is-strict-increasing-sequence-ℕ f + is-strict-increasing-is-strict-increasing-value-sequence-ℕ H p q I = + based-ind-ℕ + ( succ-ℕ p) + ( λ k → le-ℕ (f p) (f k)) + ( H p) + ( λ n J K → transitive-le-ℕ (f p) (f n) (f (succ-ℕ n)) K ((H n))) + ( q) + ( leq-succ-le-ℕ p q I) + + is-strict-decreasing-value-is-strict-decreasing-sequence-ℕ : + is-strict-decreasing-sequence-ℕ f → + ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) + is-strict-decreasing-value-is-strict-decreasing-sequence-ℕ H n = + H n (succ-ℕ n) (succ-le-ℕ n) + + is-strict-decreasing-is-strict-decreasing-value-sequence-ℕ : + ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) → + is-strict-decreasing-sequence-ℕ f + is-strict-decreasing-is-strict-decreasing-value-sequence-ℕ H p q I = + based-ind-ℕ + ( succ-ℕ p) + ( λ k → le-ℕ (f k) (f p)) + ( H p) + ( λ n J → transitive-le-ℕ (f (succ-ℕ n)) (f n) (f p) (H n)) + ( q) + ( leq-succ-le-ℕ p q I) +``` + +### There exist no strictly decreasing sequences of natural numbers + +```agda +no-strict-decreasing-sequence-leq-ℕ : + (f : sequence ℕ) → + (N : ℕ) → + is-strict-decreasing-sequence-ℕ f → + leq-ℕ (f zero-ℕ) N → + empty +no-strict-decreasing-sequence-leq-ℕ f zero-ℕ H = + concatenate-le-leq-ℕ + { f 1} + { f 0} + { 0} + ( H 0 1 (succ-le-ℕ 0)) +no-strict-decreasing-sequence-leq-ℕ f (succ-ℕ N) H K = + no-strict-decreasing-sequence-leq-ℕ + ( f ∘ succ-ℕ) + ( N) + ( λ i j → H (succ-ℕ i) (succ-ℕ j)) + ( leq-le-succ-ℕ + ( f 1) + ( N) + ( concatenate-le-leq-ℕ + { f 1} + { f 0} + { succ-ℕ N} + ( H 0 1 (succ-le-ℕ 0)) + ( K))) + +module _ + (f : sequence ℕ) + where + + no-strict-decreasing-sequence-ℕ : ¬ (is-strict-decreasing-sequence-ℕ f) + no-strict-decreasing-sequence-ℕ H = + no-strict-decreasing-sequence-leq-ℕ f (f 0) H (refl-leq-ℕ (f 0)) + + no-strict-decreasing-value-sequence-ℕ : + ¬ ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) + no-strict-decreasing-value-sequence-ℕ = + ( no-strict-decreasing-sequence-ℕ) ∘ + ( is-strict-decreasing-is-strict-decreasing-value-sequence-ℕ f) +``` + +### The identity sequence is strictly increasing + +```agda +is-strict-increasing-id-ℕ : is-strict-increasing-sequence-ℕ id +is-strict-increasing-id-ℕ i j = id + +strict-increasing-id-ℕ : strict-increasing-sequence-ℕ +strict-increasing-id-ℕ = id , is-strict-increasing-id-ℕ +``` + +### The successor function is strictly increasing + +```agda +is-strict-increasing-succ-ℕ : is-strict-increasing-sequence-ℕ succ-ℕ +is-strict-increasing-succ-ℕ i j H = H + +strict-increasing-succ-ℕ : strict-increasing-sequence-ℕ +strict-increasing-succ-ℕ = (succ-ℕ , is-strict-increasing-succ-ℕ) +``` + +### The strictly increasing sequence of natural numbers that skips the `n + 1` first terms + +```agda +skip-ℕ : ℕ → ℕ → ℕ +skip-ℕ n m = succ-ℕ (n +ℕ m) + +is-strict-increasing-skip-ℕ : + (n : ℕ) → is-strict-increasing-sequence-ℕ (skip-ℕ n) +is-strict-increasing-skip-ℕ n p q I = + concatenate-le-leq-ℕ + { add-ℕ n p} + { succ-ℕ (add-ℕ n p)} + { add-ℕ n q} + ( succ-le-ℕ (add-ℕ n p)) + ( preserves-leq-right-add-ℕ n (succ-ℕ p) q (leq-succ-le-ℕ p q I)) + +strict-increasing-skip-ℕ : (n : ℕ) → strict-increasing-sequence-ℕ +strict-increasing-skip-ℕ n = (skip-ℕ n , is-strict-increasing-skip-ℕ n) + +associative-skip-ℕ : (i j k : ℕ) → + skip-ℕ (skip-ℕ i j) k = skip-ℕ i (skip-ℕ j k) +associative-skip-ℕ i j k = + ap + ( succ-ℕ) + ( ( left-successor-law-add-ℕ (i +ℕ j) k) ∙ + ( ap succ-ℕ (associative-add-ℕ i j k))) +``` + +### The composition of strictly increasing sequences of natural numbers is strictly increasing + +```agda +module _ + (g f : sequence ℕ) + (G : is-strict-increasing-sequence-ℕ g) + (F : is-strict-increasing-sequence-ℕ f) + where + + is-strict-increasing-comp-is-strict-increasing-sequence-ℕ : + is-strict-increasing-sequence-ℕ (g ∘ f) + is-strict-increasing-comp-is-strict-increasing-sequence-ℕ p q = + G (f p) (f q) ∘ (F p q) + +comp-strict-increasing-sequence-ℕ : + strict-increasing-sequence-ℕ → + strict-increasing-sequence-ℕ → + strict-increasing-sequence-ℕ +comp-strict-increasing-sequence-ℕ g f = + ( ( sequence-strict-increasing-sequence-ℕ g) ∘ + ( sequence-strict-increasing-sequence-ℕ f)) , + ( is-strict-increasing-comp-is-strict-increasing-sequence-ℕ + ( sequence-strict-increasing-sequence-ℕ g) + ( sequence-strict-increasing-sequence-ℕ f) + ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ g) + ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ f)) +``` + +### Strictly increasing sequences of natural numbers grow infinitely + +```agda +module _ + (f : sequence ℕ) (H : is-strict-increasing-sequence-ℕ f) + where + + limit-∞-is-strict-increasing-sequence-ℕ : + (M : ℕ) → asymptotically (λ n → leq-ℕ M (f n)) + limit-∞-is-strict-increasing-sequence-ℕ zero-ℕ = + ( zero-ℕ , λ n K → leq-zero-ℕ (f n)) + limit-∞-is-strict-increasing-sequence-ℕ (succ-ℕ M) = + map-Σ + ( is-modulus-dependent-sequence (λ n → leq-ℕ (succ-ℕ M) (f n))) + ( succ-ℕ) + ( λ N K n I → + leq-succ-le-ℕ M (f n) + (concatenate-leq-le-ℕ + { M} + { f N} + { f n} + ( K N (refl-leq-ℕ N)) + ( H N n + ( concatenate-le-leq-ℕ + { N} + { succ-ℕ N} + { n} + ( succ-le-ℕ N) + ( I))))) + ( limit-∞-is-strict-increasing-sequence-ℕ M) + + modulus-limit-∞-is-strict-increasing-sequence-ℕ : ℕ → ℕ + modulus-limit-∞-is-strict-increasing-sequence-ℕ M = + pr1 (limit-∞-is-strict-increasing-sequence-ℕ M) + + is-modulus-limit-∞-is-strict-increasing-sequence-ℕ : + (M p : ℕ) → + leq-ℕ (modulus-limit-∞-is-strict-increasing-sequence-ℕ M) p → + leq-ℕ M (f p) + is-modulus-limit-∞-is-strict-increasing-sequence-ℕ M = + pr2 (limit-∞-is-strict-increasing-sequence-ℕ M) +``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 904867feab..ba0b1e42fd 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -10,8 +10,8 @@ module foundation.asymptotically-constant-sequences where open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.maximum-natural-numbers -open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-monotonic-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences open import foundation.asymptotically-equal-sequences @@ -294,3 +294,26 @@ module _ ( u) ( H (skip-zero-sequence u)) ``` + +### An asymptotically constant sequence has a constant subsequence + +```agda +module _ + {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) + where + + constant-subsequence-is-∞-constant-sequence : + Σ (subsequence u) (is-constant-sequence ∘ sequence-subsequence u) + constant-subsequence-is-∞-constant-sequence = + ( skip-subsequence (modulus-∞-value-∞-constant-sequence H) u) , + ( λ p q → + ( inv + ( is-modulus-∞-value-∞-constant-sequence + ( H) + ( skip-ℕ (modulus-∞-value-∞-constant-sequence H) p) + ( leq-add-ℕ (modulus-∞-value-∞-constant-sequence H) (succ-ℕ p)))) ∙ + ( is-modulus-∞-value-∞-constant-sequence + ( H) + ( skip-ℕ (modulus-∞-value-∞-constant-sequence H) q) + ( leq-add-ℕ (modulus-∞-value-∞-constant-sequence H) (succ-ℕ q)))) +``` diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index b236dd106c..6e0a29f1be 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -7,10 +7,11 @@ module foundation.subsequences where
Imports ```agda +open import elementary-number-theory.addition-natural-numbers open import elementary-number-theory.inequality-natural-numbers -open import elementary-number-theory.monotonic-sequences-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers +open import elementary-number-theory.strict-monotonic-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences open import foundation.dependent-pair-types @@ -44,7 +45,7 @@ module _ where subsequence : UU lzero - subsequence = type-subtype is-strictly-increasing-sequence-prop-ℕ + subsequence = strict-increasing-sequence-ℕ ``` ```agda @@ -53,11 +54,13 @@ module _ where extract-subsequence : ℕ → ℕ - extract-subsequence = pr1 v + extract-subsequence = + sequence-strict-increasing-sequence-ℕ v - is-strictly-increasing-extract-subsequence : - is-strictly-increasing-sequence-ℕ extract-subsequence - is-strictly-increasing-extract-subsequence = pr2 v + is-strict-increasing-extract-subsequence : + is-strict-increasing-sequence-ℕ extract-subsequence + is-strict-increasing-extract-subsequence = + is-strict-increasing-sequence-strict-increasing-sequence-ℕ v sequence-subsequence : sequence A sequence-subsequence n = u (extract-subsequence n) @@ -73,10 +76,10 @@ module _ where refl-subsequence : subsequence u - refl-subsequence = (id , λ i j → id) + refl-subsequence = strict-increasing-id-ℕ - eq-refl-subsequence : u = sequence-subsequence u refl-subsequence - eq-refl-subsequence = refl + compute-refl-subsequence : u = sequence-subsequence u refl-subsequence + compute-refl-subsequence = refl ``` ### The subsequence that skips the first term @@ -87,11 +90,26 @@ module _ where skip-zero-sequence : subsequence u - skip-zero-sequence = (succ-ℕ , λ i j K → K) + skip-zero-sequence = strict-increasing-succ-ℕ - eq-skip-zero-sequence : + compute-skip-zero-sequence : u ∘ succ-ℕ = sequence-subsequence u skip-zero-sequence - eq-skip-zero-sequence = refl + compute-skip-zero-sequence = refl +``` + +### The subsequence that skips the `n + 1` first terms + +```agda +module _ + {l : Level} {A : UU l} (n : ℕ) (u : sequence A) + where + + skip-subsequence : subsequence u + skip-subsequence = strict-increasing-skip-ℕ n + + compute-skip-subsequence : + u ∘ (succ-ℕ ∘ add-ℕ n) = sequence-subsequence u skip-subsequence + compute-skip-subsequence = refl ``` ### A subsequence of a subsequence is a subsequence of the original sequence @@ -103,18 +121,7 @@ module _ where sub-subsequence : subsequence u - pr1 sub-subsequence = - extract-subsequence u v ∘ extract-subsequence (sequence-subsequence u v) w - pr2 sub-subsequence i j H = - is-strictly-increasing-extract-subsequence u v - ( extract-subsequence (sequence-subsequence u v) w i) - ( extract-subsequence (sequence-subsequence u v) w j) - ( is-strictly-increasing-extract-subsequence - ( sequence-subsequence u v) - ( w) - ( i) - ( j) - ( H)) + sub-subsequence = comp-strict-increasing-sequence-ℕ v w eq-sub-subsequence : Id @@ -158,18 +165,29 @@ module _ modulus-subsequence : ℕ → ℕ modulus-subsequence = - modulus-limit-∞-is-strictly-increasing-sequence-ℕ + modulus-limit-∞-is-strict-increasing-sequence-ℕ ( extract-subsequence u v) - ( is-strictly-increasing-extract-subsequence u v) + ( is-strict-increasing-extract-subsequence u v) is-modulus-subsequence : (N p : ℕ) → leq-ℕ (modulus-subsequence N) p → leq-ℕ N (extract-subsequence u v p) is-modulus-subsequence = - is-modulus-limit-∞-is-strictly-increasing-sequence-ℕ + is-modulus-limit-∞-is-strict-increasing-sequence-ℕ ( extract-subsequence u v) - ( is-strictly-increasing-extract-subsequence u v) + ( is-strict-increasing-extract-subsequence u v) + + extract-modulus-subsequence : ℕ → ℕ + extract-modulus-subsequence = extract-subsequence u v ∘ modulus-subsequence + + leq-extract-modulus-subsequence : + (n : ℕ) → leq-ℕ n (extract-modulus-subsequence n) + leq-extract-modulus-subsequence n = + is-modulus-subsequence + ( n) + ( modulus-subsequence n) + ( refl-leq-ℕ (modulus-subsequence n)) ``` ### A dependent sequence is asymptotical if and only if all its subsequences are asymptotical From 47388b26f0a72406a3a9eca601eb0467f2a5906d Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 27 May 2024 17:49:37 +0200 Subject: [PATCH 22/67] cleanup --- ...notonic-sequences-natural-numbers.lagda.md | 234 ++++++++---------- ...notonic-sequences-natural-numbers.lagda.md | 2 +- ...asymptotically-constant-sequences.lagda.md | 42 ++-- src/foundation/subsequences.lagda.md | 40 +-- 4 files changed, 157 insertions(+), 161 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index d64b79b5f0..fc1a6ab442 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -191,9 +191,7 @@ module _ where is-increasing-subsequence-increasing-sequence-ℕ : - (H : is-increasing-sequence-ℕ u) → - (v : subsequence u) → - is-increasing-sequence-ℕ (sequence-subsequence u v) + (H : is-increasing-sequence-ℕ u) → Π-subsequence is-increasing-sequence-ℕ u is-increasing-subsequence-increasing-sequence-ℕ H v p q I = H ( extract-subsequence u v p) @@ -206,9 +204,7 @@ module _ ( I)) is-decreasing-subsequence-decreasing-sequence-ℕ : - (H : is-decreasing-sequence-ℕ u) → - (v : subsequence u) → - is-decreasing-sequence-ℕ (sequence-subsequence u v) + (H : is-decreasing-sequence-ℕ u) → Π-subsequence is-decreasing-sequence-ℕ u is-decreasing-subsequence-decreasing-sequence-ℕ H v p q I = H ( extract-subsequence u v p) @@ -221,6 +217,95 @@ module _ ( I)) ``` +### A monotonic sequence of natural numbers with a constant subsequence is asymptotically constant + +```agda +module _ + (u : sequence ℕ) + where + + is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ : + is-increasing-sequence-ℕ u → + Σ-subsequence is-constant-sequence u → + is-∞-constant-sequence u + is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H = + rec-Σ + ( λ v K → + is-∞-constant-eq-∞-constant-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-ℕ + ( u (extract-subsequence u v zero-ℕ)) + ( u n) + ( H (extract-subsequence u v zero-ℕ) n I) + ( tr + ( leq-ℕ (u n)) + ( K (modulus-subsequence u v n) zero-ℕ) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n)))))) + + is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ u → + Σ-subsequence is-constant-sequence u → + is-∞-constant-sequence u + is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H = + rec-Σ + ( λ v K → + is-∞-constant-eq-∞-constant-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-ℕ + ( u (extract-subsequence u v zero-ℕ)) + ( u n) + ( tr + ( λ k → leq-ℕ k (u n)) + ( K (modulus-subsequence u v n) zero-ℕ) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n))) + ( H (extract-subsequence u v zero-ℕ) n I)))) +``` + +### A monotonic sequence of natural numbers with an asymptotically constant subsequence is asymptotically constant + +```agda +module _ + (u : sequence ℕ) + where + + is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ : + is-increasing-sequence-ℕ u → + Σ-subsequence is-∞-constant-sequence u → + is-∞-constant-sequence u + is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ H = + ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ u H) ∘ + ( rec-Σ (λ v K → + rec-Σ + ( λ w I → ( sub-subsequence u v w , I)) + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v) + ( K)))) + + is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ u → + Σ-subsequence is-∞-constant-sequence u → + is-∞-constant-sequence u + is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ H = + ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ u H) ∘ + ( rec-Σ + ( λ v → + ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v)))) +``` + ### A monotonic value is either stationnary or strictly monotonic ```agda @@ -247,7 +332,7 @@ module _ ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where is-∞-zero-is-zero-value-decreasing-sequence-ℕ : @@ -266,7 +351,7 @@ module _ ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where is-constant-no-strict-decreasing-value-decreasing-sequence-ℕ : @@ -286,7 +371,7 @@ module _ ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ : @@ -315,18 +400,22 @@ module _ ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + (f : sequence ℕ) (N : ℕ) where - is-upper-bound-strict-value-decreasing-sequence-ℕ : ℕ → UU lzero - is-upper-bound-strict-value-decreasing-sequence-ℕ N = + is-upper-bound-strict-decreasing-value-sequence-ℕ : UU lzero + is-upper-bound-strict-decreasing-value-sequence-ℕ = (n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n → le-ℕ n N +module _ + {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) + where + is-∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ : - Σ ℕ is-upper-bound-strict-value-decreasing-sequence-ℕ → + Σ ℕ (is-upper-bound-strict-decreasing-value-sequence-ℕ f) → is-∞-constant-sequence f is-∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ = - ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ f H) ∘ + ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ H) ∘ ( rec-Σ (λ N I → (N , (λ n J L → contradiction-le-ℕ n N (I n L) J)))) ``` @@ -357,111 +446,22 @@ module _ ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where is-∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ : Σ ℕ (λ N → ¬ Σ ℕ (is-∞-strict-decreasing-value-sequence-ℕ f N)) → is-∞-constant-sequence f is-∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ = - ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ f H) ∘ + ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ H) ∘ ( rec-Σ (λ N K → (N , λ n I J → K (n , (I , J))))) ``` -### A monotonic sequence of natural numbers with a constant subsequence is asymptotically constant - -```agda -module _ - (u : sequence ℕ) - where - - is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ : - is-increasing-sequence-ℕ u → - Σ (subsequence u) (is-constant-sequence ∘ (sequence-subsequence u)) → - is-∞-constant-sequence u - is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H = - rec-Σ - ( λ v K → - is-∞-constant-eq-∞-constant-sequence - ( u (extract-subsequence u v zero-ℕ)) - ( u) - ( ( extract-subsequence u v zero-ℕ) , - ( λ n I → - antisymmetric-leq-ℕ - ( u (extract-subsequence u v zero-ℕ)) - ( u n) - ( H (extract-subsequence u v zero-ℕ) n I) - ( tr - ( leq-ℕ (u n)) - ( K (modulus-subsequence u v n) zero-ℕ) - ( H - ( n) - ( extract-modulus-subsequence u v n) - ( leq-extract-modulus-subsequence u v n)))))) - - is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ : - is-decreasing-sequence-ℕ u → - Σ (subsequence u) (is-constant-sequence ∘ (sequence-subsequence u)) → - is-∞-constant-sequence u - is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H = - rec-Σ - ( λ v K → - is-∞-constant-eq-∞-constant-sequence - ( u (extract-subsequence u v zero-ℕ)) - ( u) - ( ( extract-subsequence u v zero-ℕ) , - ( λ n I → - antisymmetric-leq-ℕ - ( u (extract-subsequence u v zero-ℕ)) - ( u n) - ( tr - ( λ k → leq-ℕ k (u n)) - ( K (modulus-subsequence u v n) zero-ℕ) - ( H - ( n) - ( extract-modulus-subsequence u v n) - ( leq-extract-modulus-subsequence u v n))) - ( H (extract-subsequence u v zero-ℕ) n I)))) -``` - -### A monotonic sequence of natural numbers with an asymptotically constant subsequence is asymptotically constant - -```agda -module _ - (u : sequence ℕ) - where - - is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ : - is-increasing-sequence-ℕ u → - Σ (subsequence u) (is-∞-constant-sequence ∘ (sequence-subsequence u)) → - is-∞-constant-sequence u - is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ H = - ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ u H) ∘ - ( rec-Σ (λ v K → - rec-Σ - ( λ w I → ( sub-subsequence u v w , I)) - ( constant-subsequence-is-∞-constant-sequence - ( sequence-subsequence u v) - ( K)))) - - is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ : - is-decreasing-sequence-ℕ u → - Σ (subsequence u) (is-∞-constant-sequence ∘ (sequence-subsequence u)) → - is-∞-constant-sequence u - is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ H = - ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ u H) ∘ - ( rec-Σ - ( λ v → - ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ - ( constant-subsequence-is-∞-constant-sequence - ( sequence-subsequence u v)))) -``` - ### A decreasing sequence of natural numbers cannot have arbitrarily large strict decreasing values ```agda module _ - (f : sequence ℕ) (H : is-decreasing-sequence-ℕ f) + {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) (K : (N : ℕ) → Σ ℕ (is-∞-strict-decreasing-value-sequence-ℕ f N)) where @@ -509,24 +509,10 @@ module _ ### The subsequences of a decreasing sequence of natural numbers don't all have a strict decreasing value -#### Strict decreasing values of subsequences - -```agda -module _ - (u : sequence ℕ) (v : subsequence u) - where - - is-strict-decreasing-value-subsequence-ℕ : ℕ → UU lzero - is-strict-decreasing-value-subsequence-ℕ = - is-strict-decreasing-value-sequence-ℕ (sequence-subsequence u v) -``` - -#### Not all subsequences of a decreasing sequence of natural nimbers have a strict decreasing value - ```agda module _ - (u : sequence ℕ) (H : is-decreasing-sequence-ℕ u) - (K : (v : subsequence u) → Σ ℕ (is-strict-decreasing-value-subsequence-ℕ u v)) + {u : sequence ℕ} (H : is-decreasing-sequence-ℕ u) + (K : Π-subsequence (Σ ℕ ∘ is-strict-decreasing-value-sequence-ℕ) u) where extract-strict-decreasing-value-subsequence-ℕ : ℕ → ℕ @@ -554,8 +540,8 @@ module _ ( extract-strict-decreasing-value-subsequence-ℕ n) ( u))) - no-strict-decreasing-value-subsequence-ℕ : empty - no-strict-decreasing-value-subsequence-ℕ = + no-strict-decreasing-value-Π-subsequence-ℕ : empty + no-strict-decreasing-value-Π-subsequence-ℕ = no-strict-decreasing-value-sequence-ℕ ( u ∘ extract-strict-decreasing-value-subsequence-ℕ) ( λ n → diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md index 651af10b2f..21252b5221 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -312,7 +312,7 @@ comp-strict-increasing-sequence-ℕ g f = ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ f)) ``` -### Strictly increasing sequences of natural numbers grow infinitely +### A strictly increasing sequence of natural numbers takes arbitrarily large values ```agda module _ diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index ba0b1e42fd..bef4af0faf 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -66,6 +66,9 @@ module _ ∞-value-∞-constant-sequence = u n is-modulus-∞-value-∞-constant-sequence = is-modulus-∞-asymptotically (value-∞-asymptotically H) + + const-∞-value-∞-constant-sequence : sequence A + const-∞-value-∞-constant-sequence n = ∞-value-∞-constant-sequence ``` ## Properties @@ -120,7 +123,7 @@ module _ where eq-∞-value-∞-constant-sequence : - eq-∞-sequence (const-sequence (∞-value-∞-constant-sequence H)) u + eq-∞-sequence (const-∞-value-∞-constant-sequence H) u eq-∞-value-∞-constant-sequence = ( modulus-∞-value-∞-constant-sequence H) , ( is-modulus-∞-value-∞-constant-sequence H) @@ -149,15 +152,12 @@ module _ ```agda module _ - {l : Level} {A : UU l} (u : sequence A) (v : subsequence u) + {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) where eq-∞-value-∞-constant-subsequence : - (H : is-∞-constant-sequence u) → - eq-∞-sequence - ( const-sequence (∞-value-∞-constant-sequence H)) - ( sequence-subsequence u v) - eq-∞-value-∞-constant-subsequence H = + Π-subsequence (eq-∞-sequence (const-∞-value-∞-constant-sequence H)) u + eq-∞-value-∞-constant-subsequence v = ( ( modulus-subsequence u v (modulus-∞-value-∞-constant-sequence H)) , ( λ n I → is-modulus-∞-value-∞-constant-sequence H @@ -167,13 +167,12 @@ module _ ( n) ( I)))) - is-∞-constant-subsequence : - is-∞-constant-sequence u → is-∞-constant-sequence (sequence-subsequence u v) - is-∞-constant-subsequence H = + is-∞-constant-subsequence : Π-subsequence is-∞-constant-sequence u + is-∞-constant-subsequence v = is-∞-constant-eq-∞-constant-sequence ( ∞-value-∞-constant-sequence H) ( sequence-subsequence u v) - ( eq-∞-value-∞-constant-subsequence H) + ( eq-∞-value-∞-constant-subsequence v) ``` ### A sequence is asymptotically constant if all its subsequences are asymptotically constant @@ -181,11 +180,12 @@ module _ ```agda module _ {l : Level} {A : UU l} (u : sequence A) - (H : (v : subsequence u) → is-∞-constant-sequence (sequence-subsequence u v)) + (H : Π-subsequence is-∞-constant-sequence u) where is-∞-constant-is-∞-constant-subsequence : is-∞-constant-sequence u - is-∞-constant-is-∞-constant-subsequence = H (refl-subsequence u) + is-∞-constant-is-∞-constant-subsequence = + sequence-Π-sequence is-∞-constant-sequence u H ``` ### A sequence asymptotically equal to an asymptotically constant sequence is asymptotically constant @@ -202,7 +202,7 @@ module _ ( ∞-value-∞-constant-sequence K) ( v) ( transitive-eq-∞-sequence - ( const-sequence (∞-value-∞-constant-sequence K)) + ( const-∞-value-∞-constant-sequence K) ( u) ( v) ( H) @@ -273,22 +273,20 @@ module _ where eq-∞-subsequence-is-∞-constant-sequence : - is-∞-constant-sequence u → - ((v : subsequence u) → eq-∞-sequence u (sequence-subsequence u v)) + is-∞-constant-sequence u → Π-subsequence (eq-∞-sequence u) u eq-∞-subsequence-is-∞-constant-sequence H v = transitive-eq-∞-sequence ( u) - ( const-sequence (∞-value-∞-constant-sequence H)) + ( const-∞-value-∞-constant-sequence H) ( sequence-subsequence u v) - ( eq-∞-value-∞-constant-subsequence u v H) + ( eq-∞-value-∞-constant-subsequence u H v) ( symmetric-eq-∞-sequence - ( const-sequence (∞-value-∞-constant-sequence H)) + ( const-∞-value-∞-constant-sequence H) ( u) ( eq-∞-value-∞-constant-sequence H)) is-∞-constant-eq-∞-sequence-subsequence : - ((v : subsequence u) → eq-∞-sequence u (sequence-subsequence u v)) → - is-∞-constant-sequence u + Π-subsequence (eq-∞-sequence u) u → is-∞-constant-sequence u is-∞-constant-eq-∞-sequence-subsequence H = is-∞-constant-is-∞-stationnary ( u) @@ -303,7 +301,7 @@ module _ where constant-subsequence-is-∞-constant-sequence : - Σ (subsequence u) (is-constant-sequence ∘ sequence-subsequence u) + Σ-subsequence is-constant-sequence u constant-subsequence-is-∞-constant-sequence = ( skip-subsequence (modulus-∞-value-∞-constant-sequence H) u) , ( λ p q → diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 6e0a29f1be..115640bdd7 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -190,28 +190,40 @@ module _ ( refl-leq-ℕ (modulus-subsequence n)) ``` +### Subsequential type families + +```agda +module _ + {l l1 : Level} {A : UU l} (P : sequence A → UU l1) + where + + Π-subsequence : sequence A → UU l1 + Π-subsequence u = (v : subsequence u) → P (sequence-subsequence u v) + + sequence-Π-sequence : (u : sequence A) → Π-subsequence u → P u + sequence-Π-sequence u H = H (refl-subsequence u) + + Σ-subsequence : sequence A → UU l1 + Σ-subsequence u = Σ (subsequence u) (P ∘ (sequence-subsequence u)) + + sequence-Σ-sequence : (u : sequence A) → P u → Σ-subsequence u + sequence-Σ-sequence u H = (refl-subsequence u , H) +``` + ### A dependent sequence is asymptotical if and only if all its subsequences are asymptotical ```agda module _ - {l : Level} (A : ℕ → UU l) + {l : Level} (A : ℕ → UU l) (H : asymptotically A) where - asymptotically-sequence-subsequence : - asymptotically A → - ((B : subsequence A) → asymptotically (sequence-subsequence A B)) - asymptotically-sequence-subsequence H B = + asymptotically-Π-subsequence : Π-subsequence asymptotically A + asymptotically-Π-subsequence B = map-Σ ( is-modulus-dependent-sequence (sequence-subsequence A B)) ( modulus-subsequence A B) - ( λ N K p I → - K - ( extract-subsequence A B p) - ( is-modulus-subsequence A B N p I)) + ( λ N K p → + ( K (extract-subsequence A B p)) ∘ + ( is-modulus-subsequence A B N p)) ( H) - - asymptotically-subsequence : - ((B : subsequence A) → asymptotically (sequence-subsequence A B)) → - asymptotically A - asymptotically-subsequence H = H (refl-subsequence A) ``` From 556b357373b5a1e42e8963d130b35c768432a8cf Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 27 May 2024 18:29:16 +0200 Subject: [PATCH 23/67] cleanup names --- ...notonic-sequences-natural-numbers.lagda.md | 10 +++++----- ...asymptotically-constant-sequences.lagda.md | 19 +++---------------- src/foundation/subsequences.lagda.md | 8 ++++---- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index fc1a6ab442..d2ec7e6636 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -190,9 +190,9 @@ module _ (u : sequence ℕ) where - is-increasing-subsequence-increasing-sequence-ℕ : + is-increasing-Π-subsequence-ℕ : (H : is-increasing-sequence-ℕ u) → Π-subsequence is-increasing-sequence-ℕ u - is-increasing-subsequence-increasing-sequence-ℕ H v p q I = + is-increasing-Π-subsequence-ℕ H v p q I = H ( extract-subsequence u v p) ( extract-subsequence u v q) @@ -203,9 +203,9 @@ module _ ( q) ( I)) - is-decreasing-subsequence-decreasing-sequence-ℕ : + is-decreasing-Π-subsequence-ℕ : (H : is-decreasing-sequence-ℕ u) → Π-subsequence is-decreasing-sequence-ℕ u - is-decreasing-subsequence-decreasing-sequence-ℕ H v p q I = + is-decreasing-Π-subsequence-ℕ H v p q I = H ( extract-subsequence u v p) ( extract-subsequence u v q) @@ -393,7 +393,7 @@ module _ ( J ∙_) ( ex-falso ∘ (K n I)) ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n - (is-decreasing-value-is-decreasing-sequence-ℕ f H n)))))) + ( is-decreasing-value-is-decreasing-sequence-ℕ f H n)))))) ``` ### A decreasing sequence of natural numbers with bounded strictly decreasing values is asymptotically constant diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index bef4af0faf..81f952be5c 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -167,27 +167,14 @@ module _ ( n) ( I)))) - is-∞-constant-subsequence : Π-subsequence is-∞-constant-sequence u - is-∞-constant-subsequence v = + is-∞-constant-Π-subsequence : Π-subsequence is-∞-constant-sequence u + is-∞-constant-Π-subsequence v = is-∞-constant-eq-∞-constant-sequence ( ∞-value-∞-constant-sequence H) ( sequence-subsequence u v) ( eq-∞-value-∞-constant-subsequence v) ``` -### A sequence is asymptotically constant if all its subsequences are asymptotically constant - -```agda -module _ - {l : Level} {A : UU l} (u : sequence A) - (H : Π-subsequence is-∞-constant-sequence u) - where - - is-∞-constant-is-∞-constant-subsequence : is-∞-constant-sequence u - is-∞-constant-is-∞-constant-subsequence = - sequence-Π-sequence is-∞-constant-sequence u H -``` - ### A sequence asymptotically equal to an asymptotically constant sequence is asymptotically constant ```agda @@ -219,7 +206,7 @@ module _ where is-∞-stationnary-sequence : UU l - is-∞-stationnary-sequence = asymptotically (λ n → u n = u (succ-ℕ n)) + is-∞-stationnary-sequence = asymptotically (is-stationnary-value-sequence u) is-∞-constant-modulus-is-∞-stationnary-sequence : (H : is-∞-stationnary-sequence) → diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 115640bdd7..7e5619c69b 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -200,14 +200,14 @@ module _ Π-subsequence : sequence A → UU l1 Π-subsequence u = (v : subsequence u) → P (sequence-subsequence u v) - sequence-Π-sequence : (u : sequence A) → Π-subsequence u → P u - sequence-Π-sequence u H = H (refl-subsequence u) + sequence-Π-subsequence : (u : sequence A) → Π-subsequence u → P u + sequence-Π-subsequence u H = H (refl-subsequence u) Σ-subsequence : sequence A → UU l1 Σ-subsequence u = Σ (subsequence u) (P ∘ (sequence-subsequence u)) - sequence-Σ-sequence : (u : sequence A) → P u → Σ-subsequence u - sequence-Σ-sequence u H = (refl-subsequence u , H) + sequence-Σ-subsequence : (u : sequence A) → P u → Σ-subsequence u + sequence-Σ-subsequence u H = (refl-subsequence u , H) ``` ### A dependent sequence is asymptotical if and only if all its subsequences are asymptotical From 6f333c72e98f738a4e55092020a1a20cb3807e9f Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 27 May 2024 18:33:12 +0200 Subject: [PATCH 24/67] fix indent --- src/foundation/asymptotically-constant-sequences.lagda.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 81f952be5c..7a2ede13b3 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -297,8 +297,8 @@ module _ ( H) ( skip-ℕ (modulus-∞-value-∞-constant-sequence H) p) ( leq-add-ℕ (modulus-∞-value-∞-constant-sequence H) (succ-ℕ p)))) ∙ - ( is-modulus-∞-value-∞-constant-sequence - ( H) - ( skip-ℕ (modulus-∞-value-∞-constant-sequence H) q) - ( leq-add-ℕ (modulus-∞-value-∞-constant-sequence H) (succ-ℕ q)))) + ( is-modulus-∞-value-∞-constant-sequence + ( H) + ( skip-ℕ (modulus-∞-value-∞-constant-sequence H) q) + ( leq-add-ℕ (modulus-∞-value-∞-constant-sequence H) (succ-ℕ q)))) ``` From ebae214642a4312430892b5627cd653a18d92462 Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 27 May 2024 19:53:46 +0200 Subject: [PATCH 25/67] more asymptotical lemma --- ...notonic-sequences-natural-numbers.lagda.md | 74 ++++++++++++++++++- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index d2ec7e6636..1307ea846c 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -183,6 +183,32 @@ module _ ( is-strict-increasing-value-is-strict-increasing-sequence-ℕ f H n)) ``` +### A sequence of natural numbers is constant if and only if it is increasing and decreasing + +```agda +module _ + (f : sequence ℕ) + where + + is-increasing-is-constant-sequence-ℕ : + is-constant-sequence f → is-increasing-sequence-ℕ f + is-increasing-is-constant-sequence-ℕ H p q I = leq-eq-ℕ (f p) (f q) (H p q) + + is-decreasing-is-constant-sequence-ℕ : + is-constant-sequence f → is-decreasing-sequence-ℕ f + is-decreasing-is-constant-sequence-ℕ H p q I = leq-eq-ℕ (f q) (f p) (H q p) + + is-constant-is-increasing-decreasing-sequence-ℕ : + is-increasing-sequence-ℕ f → + is-decreasing-sequence-ℕ f → + is-constant-sequence f + is-constant-is-increasing-decreasing-sequence-ℕ I J p q = + rec-coproduct + ( λ H → antisymmetric-leq-ℕ (f p) (f q) (I p q H) (J p q H)) + ( λ H → antisymmetric-leq-ℕ (f p) (f q) (J q p H) (I q p H)) + ( linear-leq-ℕ p q) +``` + ### Any subsequence of a monotonic sequence of natural numbers is monotonic ```agda @@ -221,7 +247,7 @@ module _ ```agda module _ - (u : sequence ℕ) + {u : sequence ℕ} where is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ : @@ -277,7 +303,7 @@ module _ ```agda module _ - (u : sequence ℕ) + {u : sequence ℕ} where is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ : @@ -285,7 +311,7 @@ module _ Σ-subsequence is-∞-constant-sequence u → is-∞-constant-sequence u is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ H = - ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ u H) ∘ + ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H) ∘ ( rec-Σ (λ v K → rec-Σ ( λ w I → ( sub-subsequence u v w , I)) @@ -298,7 +324,7 @@ module _ Σ-subsequence is-∞-constant-sequence u → is-∞-constant-sequence u is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ H = - ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ u H) ∘ + ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H) ∘ ( rec-Σ ( λ v → ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ @@ -306,6 +332,46 @@ module _ ( sequence-subsequence u v)))) ``` +### A decreasing sequence of natural numbers with an increasing subsequence is asymptotically constant + +```agda +module _ + {u : sequence ℕ} (H : is-decreasing-sequence-ℕ u) + where + + is-∞-constant-is-increasing-subsequence-decreasing-subsequence-ℕ : + Σ-subsequence is-increasing-sequence-ℕ u → is-∞-constant-sequence u + is-∞-constant-is-increasing-subsequence-decreasing-subsequence-ℕ = + ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H) ∘ + ( rec-Σ + ( λ v K → + ( v , + is-constant-is-increasing-decreasing-sequence-ℕ + ( sequence-subsequence u v) + ( K) + ( is-decreasing-Π-subsequence-ℕ u H v)))) +``` + +### An increasing sequence of natural numbers with an decreasing subsequence is asymptotically constant + +```agda +module _ + {u : sequence ℕ} (H : is-increasing-sequence-ℕ u) + where + + is-∞-constant-is-decreasing-subsequence-increasing-subsequence-ℕ : + Σ-subsequence is-decreasing-sequence-ℕ u → is-∞-constant-sequence u + is-∞-constant-is-decreasing-subsequence-increasing-subsequence-ℕ = + ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H) ∘ + ( rec-Σ + ( λ v K → + ( v , + is-constant-is-increasing-decreasing-sequence-ℕ + ( sequence-subsequence u v) + ( is-increasing-Π-subsequence-ℕ u H v) + ( K)))) +``` + ### A monotonic value is either stationnary or strictly monotonic ```agda From 7b7e1ce6c5d044bc47f1f4557cca65b6915d5625 Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 27 May 2024 20:12:13 +0200 Subject: [PATCH 26/67] =?UTF-8?q?use=20`tot`=20instead=20of=20`rec-=CE=A3`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...notonic-sequences-natural-numbers.lagda.md | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 1307ea846c..a2677f37f9 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -343,13 +343,12 @@ module _ Σ-subsequence is-increasing-sequence-ℕ u → is-∞-constant-sequence u is-∞-constant-is-increasing-subsequence-decreasing-subsequence-ℕ = ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H) ∘ - ( rec-Σ + ( tot ( λ v K → - ( v , - is-constant-is-increasing-decreasing-sequence-ℕ - ( sequence-subsequence u v) - ( K) - ( is-decreasing-Π-subsequence-ℕ u H v)))) + is-constant-is-increasing-decreasing-sequence-ℕ + ( sequence-subsequence u v) + ( K) + ( is-decreasing-Π-subsequence-ℕ u H v))) ``` ### An increasing sequence of natural numbers with an decreasing subsequence is asymptotically constant @@ -363,13 +362,12 @@ module _ Σ-subsequence is-decreasing-sequence-ℕ u → is-∞-constant-sequence u is-∞-constant-is-decreasing-subsequence-increasing-subsequence-ℕ = ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H) ∘ - ( rec-Σ + ( tot ( λ v K → - ( v , - is-constant-is-increasing-decreasing-sequence-ℕ - ( sequence-subsequence u v) - ( is-increasing-Π-subsequence-ℕ u H v) - ( K)))) + is-constant-is-increasing-decreasing-sequence-ℕ + ( sequence-subsequence u v) + ( is-increasing-Π-subsequence-ℕ u H v) + ( K))) ``` ### A monotonic value is either stationnary or strictly monotonic @@ -404,13 +402,11 @@ module _ is-∞-zero-is-zero-value-decreasing-sequence-ℕ : Σ ℕ (λ n → zero-ℕ = f n) → asymptotically (λ n → zero-ℕ = f n) is-∞-zero-is-zero-value-decreasing-sequence-ℕ = - rec-Σ - ( λ n K → - ( n , - λ k I → - is-zero-leq-zero-ℕ' - ( f k) - ( inv-tr (leq-ℕ (f k)) K (H n k I)))) + tot + ( λ n K k I → + is-zero-leq-zero-ℕ' + ( f k) + ( inv-tr (leq-ℕ (f k)) K (H n k I))) ``` ### A decreasing sequence of natural numbers that has no strictly decreasing value is constant From 234fb418d36350a7efcb456b6454554bcf6c46b3 Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 27 May 2024 20:13:47 +0200 Subject: [PATCH 27/67] fix indent --- ...onotonic-sequences-natural-numbers.lagda.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index a2677f37f9..5705682757 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -447,15 +447,15 @@ module _ ( f) ( ( N) , ( based-ind-ℕ - ( N) - ( λ n → f N = f n) - ( refl) - ( λ n I J → - rec-coproduct - ( J ∙_) - ( ex-falso ∘ (K n I)) - ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n - ( is-decreasing-value-is-decreasing-sequence-ℕ f H n)))))) + ( N) + ( λ n → f N = f n) + ( refl) + ( λ n I J → + rec-coproduct + ( J ∙_) + ( ex-falso ∘ (K n I)) + ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n + ( is-decreasing-value-is-decreasing-sequence-ℕ f H n)))))) ``` ### A decreasing sequence of natural numbers with bounded strictly decreasing values is asymptotically constant From 7083da2097ec71a81b3f5b4254600c437331dfd8 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 28 May 2024 03:55:48 +0200 Subject: [PATCH 28/67] =?UTF-8?q?le-skip-=E2=84=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../strict-monotonic-sequences-natural-numbers.lagda.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md index 21252b5221..61f398af9a 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -282,6 +282,12 @@ associative-skip-ℕ i j k = ( succ-ℕ) ( ( left-successor-law-add-ℕ (i +ℕ j) k) ∙ ( ap succ-ℕ (associative-add-ℕ i j k))) + +le-skip-ℕ : (m n : ℕ) → le-ℕ m (skip-ℕ m n) +le-skip-ℕ m n = le-succ-leq-ℕ m (m +ℕ n) (leq-add-ℕ m n) + +le-skip-ℕ' : (m n : ℕ) → le-ℕ m (skip-ℕ n m) +le-skip-ℕ' m n = le-succ-leq-ℕ m (n +ℕ m) (leq-add-ℕ' m n) ``` ### The composition of strictly increasing sequences of natural numbers is strictly increasing From 94ee7c4fb0e1fb85490a1eeb74c1ae5fbb260baf Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 28 May 2024 18:32:00 +0200 Subject: [PATCH 29/67] use `map-right-unit-law-coproduct-is-empty` --- .../monotonic-sequences-natural-numbers.lagda.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 5705682757..93852080de 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -29,6 +29,7 @@ open import foundation.propositions open import foundation.sequences open import foundation.subsequences open import foundation.transport-along-identifications +open import foundation.type-arithmetic-empty-type open import foundation.universe-levels ``` @@ -422,9 +423,10 @@ module _ is-constant-no-strict-decreasing-value-decreasing-sequence-ℕ K = is-constant-is-stationnary-value-sequence f ( λ n → - rec-coproduct - ( id) - ( ex-falso ∘ (K n)) + map-right-unit-law-coproduct-is-empty + ( is-stationnary-value-sequence f n) + ( is-strict-decreasing-value-sequence-ℕ f n) + ( K n) ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n ( is-decreasing-value-is-decreasing-sequence-ℕ f H n))) ``` From ba6b60241b86f1ef75465ac68cc927adac854473 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 28 May 2024 19:44:30 +0200 Subject: [PATCH 30/67] refactor/cleanup --- ...notonic-sequences-natural-numbers.lagda.md | 85 ++++++++++++------- .../asymptotical-dependent-sequences.lagda.md | 41 +++++---- ...asymptotically-constant-sequences.lagda.md | 6 +- 3 files changed, 82 insertions(+), 50 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 93852080de..23ae6898e3 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -37,8 +37,8 @@ open import foundation.universe-levels ## Idea -Monotic sequences of natural numbers are functions `f : ℕ → ℕ` that preserve or -reverse inequality of natural numbers. +Monotonic sequences of natural numbers are functions `f : ℕ → ℕ` that preserve +or reverse inequality of natural numbers. ## Definitions @@ -313,12 +313,11 @@ module _ is-∞-constant-sequence u is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ H = ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H) ∘ - ( rec-Σ (λ v K → - rec-Σ - ( λ w I → ( sub-subsequence u v w , I)) + ( rec-Σ + ( λ v → + ( rec-Σ ( λ w I → ( sub-subsequence u v w , I))) ∘ ( constant-subsequence-is-∞-constant-sequence - ( sequence-subsequence u v) - ( K)))) + ( sequence-subsequence u v)))) is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ : is-decreasing-sequence-ℕ u → @@ -393,7 +392,45 @@ module _ map-coproduct inv id (eq-or-le-leq-ℕ (f (succ-ℕ n)) (f n) H) ``` -### A decreasing sequence that takes the value zero is asymptotically equal to zero +### Any value of a monotonic sequence of natural numbers that is not a strict value is stationnary + +```agda +module _ + (f : sequence ℕ) + where + + is-stationnary-is-not-strict-value-increasing-sequence-ℕ : + is-increasing-sequence-ℕ f → + (n : ℕ) → + ¬ (is-strict-increasing-value-sequence-ℕ f n) → + is-stationnary-value-sequence f n + is-stationnary-is-not-strict-value-increasing-sequence-ℕ H n K = + map-right-unit-law-coproduct-is-empty + ( is-stationnary-value-sequence f n) + ( is-strict-increasing-value-sequence-ℕ f n) + ( K) + ( decide-is-stationnary-is-increasing-value-sequence-ℕ + ( f) + ( n) + ( is-increasing-value-is-increasing-sequence-ℕ f H n)) + + is-stationnary-is-not-strict-value-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ f → + (n : ℕ) → + ¬ (is-strict-decreasing-value-sequence-ℕ f n) → + is-stationnary-value-sequence f n + is-stationnary-is-not-strict-value-decreasing-sequence-ℕ H n K = + map-right-unit-law-coproduct-is-empty + ( is-stationnary-value-sequence f n) + ( is-strict-decreasing-value-sequence-ℕ f n) + ( K) + ( decide-is-stationnary-is-decreasing-value-sequence-ℕ + ( f) + ( n) + ( is-decreasing-value-is-decreasing-sequence-ℕ f H n)) +``` + +### A decreasing sequence of natural numbers that takes the value zero is asymptotically equal to zero ```agda module _ @@ -423,12 +460,11 @@ module _ is-constant-no-strict-decreasing-value-decreasing-sequence-ℕ K = is-constant-is-stationnary-value-sequence f ( λ n → - map-right-unit-law-coproduct-is-empty - ( is-stationnary-value-sequence f n) - ( is-strict-decreasing-value-sequence-ℕ f n) - ( K n) - ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n - ( is-decreasing-value-is-decreasing-sequence-ℕ f H n))) + is-stationnary-is-not-strict-value-decreasing-sequence-ℕ + ( f) + ( H) + ( n) + ( K n)) ``` ### A decreasing sequence of natural numbers that asymptotically has no strictly decreasing value is asymptotically constant @@ -442,22 +478,9 @@ module _ asymptotically (λ n → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → is-∞-constant-sequence f is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ = - rec-Σ - ( λ N K → - is-∞-constant-eq-∞-constant-sequence - ( f N) - ( f) - ( ( N) , - ( based-ind-ℕ - ( N) - ( λ n → f N = f n) - ( refl) - ( λ n I J → - rec-coproduct - ( J ∙_) - ( ex-falso ∘ (K n I)) - ( decide-is-stationnary-is-decreasing-value-sequence-ℕ f n - ( is-decreasing-value-is-decreasing-sequence-ℕ f H n)))))) + ( is-∞-constant-is-∞-stationnary-sequence f) ∘ + ( map-asymptotically-Π + ( is-stationnary-is-not-strict-value-decreasing-sequence-ℕ f H)) ``` ### A decreasing sequence of natural numbers with bounded strictly decreasing values is asymptotically constant @@ -518,7 +541,7 @@ module _ is-∞-constant-sequence f is-∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ = ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ H) ∘ - ( rec-Σ (λ N K → (N , λ n I J → K (n , (I , J))))) + ( tot (λ n K p I J → K (p , ( I , J)))) ``` ### A decreasing sequence of natural numbers cannot have arbitrarily large strict decreasing values diff --git a/src/foundation/asymptotical-dependent-sequences.lagda.md b/src/foundation/asymptotical-dependent-sequences.lagda.md index f60d009b44..0a32852c4c 100644 --- a/src/foundation/asymptotical-dependent-sequences.lagda.md +++ b/src/foundation/asymptotical-dependent-sequences.lagda.md @@ -102,22 +102,31 @@ module _ ### Asymptotical functorial action on asymptotical dependent sequences ```agda -map-asymptotically : - {l1 l2 : Level} {A : ℕ → UU l1} {B : ℕ → UU l2} → - asymptotically (λ n → A n → B n) → - asymptotically A → - asymptotically B -map-asymptotically H K = - ( max-ℕ (modulus-∞-asymptotically H) (modulus-∞-asymptotically K)) , - ( λ q I → - is-modulus-∞-asymptotically H q - ( leq-left-leq-max-ℕ q - ( modulus-∞-asymptotically H) - ( modulus-∞-asymptotically K) - ( I)) - ( is-modulus-∞-asymptotically K q - ( leq-right-leq-max-ℕ q +module _ + {l1 l2 : Level} {A : ℕ → UU l1} {B : ℕ → UU l2} + where + + map-asymptotically : + asymptotically (λ n → A n → B n) → + asymptotically A → + asymptotically B + map-asymptotically H K = + ( max-ℕ (modulus-∞-asymptotically H) (modulus-∞-asymptotically K)) , + ( λ q I → + is-modulus-∞-asymptotically H q + ( leq-left-leq-max-ℕ q ( modulus-∞-asymptotically H) ( modulus-∞-asymptotically K) - ( I)))) + ( I)) + ( is-modulus-∞-asymptotically K q + ( leq-right-leq-max-ℕ q + ( modulus-∞-asymptotically H) + ( modulus-∞-asymptotically K) + ( I)))) + + map-asymptotically-Π : + ((n : ℕ) → A n → B n) → + asymptotically A → + asymptotically B + map-asymptotically-Π H = map-asymptotically (asymptotically-Π H) ``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 7a2ede13b3..5b674ebf4e 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -228,9 +228,9 @@ module _ {l : Level} {A : UU l} (u : sequence A) where - is-∞-constant-is-∞-stationnary : + is-∞-constant-is-∞-stationnary-sequence : is-∞-stationnary-sequence u → is-∞-constant-sequence u - is-∞-constant-is-∞-stationnary H = + is-∞-constant-is-∞-stationnary-sequence H = is-∞-constant-eq-∞-constant-sequence ( u (modulus-∞-asymptotically H)) ( u) @@ -275,7 +275,7 @@ module _ is-∞-constant-eq-∞-sequence-subsequence : Π-subsequence (eq-∞-sequence u) u → is-∞-constant-sequence u is-∞-constant-eq-∞-sequence-subsequence H = - is-∞-constant-is-∞-stationnary + is-∞-constant-is-∞-stationnary-sequence ( u) ( H (skip-zero-sequence u)) ``` From d644cf9e5f9dd147747c59111fa8caa5c273bc86 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 28 May 2024 19:56:29 +0200 Subject: [PATCH 31/67] fix typos/headers --- src/foundation/asymptotical-dependent-sequences.lagda.md | 4 +++- src/foundation/asymptotically-constant-sequences.lagda.md | 2 +- src/foundation/asymptotically-equal-sequences.lagda.md | 4 +++- src/foundation/constant-sequences.lagda.md | 2 +- src/foundation/subsequences.lagda.md | 6 ++++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/foundation/asymptotical-dependent-sequences.lagda.md b/src/foundation/asymptotical-dependent-sequences.lagda.md index 0a32852c4c..7c820116f7 100644 --- a/src/foundation/asymptotical-dependent-sequences.lagda.md +++ b/src/foundation/asymptotical-dependent-sequences.lagda.md @@ -24,7 +24,7 @@ open import foundation.universe-levels A dependent sequence `A : ℕ → UU l` is **asymptotical** if `A n` is pointed for sufficiently large natural numbers `n`. -## Definition +## Definitions ### Asymptotical dependent sequences @@ -40,6 +40,8 @@ module _ asymptotically = Σ ℕ is-modulus-dependent-sequence ``` +### Modulus of an asymptotical dependent sequence + ```agda module _ {l : Level} {A : ℕ → UU l} (H : asymptotically A) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 5b674ebf4e..be79ead3f1 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -32,7 +32,7 @@ open import foundation.universe-levels A sequence `u` is **asymptotically constant** if `u p = u q` for sufficiently large `p` and `q`. -## Definition +## Definitions ### Asymptotically constant sequences diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index 2d5ffd9902..1703d35064 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -28,7 +28,7 @@ open import foundation-core.function-types Two sequences `u` and `v` are **asymptotically equal** if `u n = v n` for any sufficiently large natural number `n`. -## Definition +## Definitions ### The relation of being asymptotically equal sequences @@ -41,6 +41,8 @@ module _ eq-∞-sequence = asymptotically (λ n → u n = v n) ``` +### Modulus of asymptotical equality + ```agda module _ {l : Level} {A : UU l} {u v : sequence A} (H : eq-∞-sequence u v) diff --git a/src/foundation/constant-sequences.lagda.md b/src/foundation/constant-sequences.lagda.md index b3de7eb154..01d2fb352a 100644 --- a/src/foundation/constant-sequences.lagda.md +++ b/src/foundation/constant-sequences.lagda.md @@ -22,7 +22,7 @@ open import foundation.universe-levels A sequence `u` is **constant** if `u p = u q` for all `p` and `q`. -## Definition +## Definitions ### Constant sequences diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 7e5619c69b..f66c95a589 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -32,10 +32,10 @@ open import foundation.universe-levels A **subsequence** of a [sequence](foundation.sequences.md) `u : ℕ → A` is a sequence `u ∘ f` for some -[strictly increasing](elementary-number-theory.monotonic-sequences-natural-numbers.md) +[strictly increasing](elementary-number-theory.strict-monotonic-sequences-natural-numbers.md) map `f : ℕ → ℕ`. -## Definition +## Definitions ### Subsequences @@ -48,6 +48,8 @@ module _ subsequence = strict-increasing-sequence-ℕ ``` +### The extracted sequence of a subsequence + ```agda module _ {l : Level} {A : UU l} (u : sequence A) (v : subsequence u) From b31f3a8472d02750ed3943cd2810a9abf229db1f Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 28 May 2024 19:57:58 +0200 Subject: [PATCH 32/67] fix typo --- .../strict-monotonic-sequences-natural-numbers.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md index 61f398af9a..8f7d0e908b 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -36,7 +36,7 @@ open import foundation.universe-levels ## Idea -Strictly monotic sequences of natural numbers are functions `f : ℕ → ℕ` that +Strictly monotonic sequences of natural numbers are functions `f : ℕ → ℕ` that preserve or reverse strict inequality of natural numbers. Strictly decreasing sequences of natural numbers don't exist. From 9ee5a07f3b00fee971f950bbf1e3c0403be82a7d Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 28 May 2024 20:48:34 +0200 Subject: [PATCH 33/67] fix name --- src/foundation/asymptotically-constant-sequences.lagda.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index be79ead3f1..c80e1ac6e4 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -155,9 +155,9 @@ module _ {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) where - eq-∞-value-∞-constant-subsequence : + eq-∞-value-∞-constant-Π-subsequence : Π-subsequence (eq-∞-sequence (const-∞-value-∞-constant-sequence H)) u - eq-∞-value-∞-constant-subsequence v = + eq-∞-value-∞-constant-Π-subsequence v = ( ( modulus-subsequence u v (modulus-∞-value-∞-constant-sequence H)) , ( λ n I → is-modulus-∞-value-∞-constant-sequence H @@ -172,7 +172,7 @@ module _ is-∞-constant-eq-∞-constant-sequence ( ∞-value-∞-constant-sequence H) ( sequence-subsequence u v) - ( eq-∞-value-∞-constant-subsequence v) + ( eq-∞-value-∞-constant-Π-subsequence v) ``` ### A sequence asymptotically equal to an asymptotically constant sequence is asymptotically constant @@ -266,7 +266,7 @@ module _ ( u) ( const-∞-value-∞-constant-sequence H) ( sequence-subsequence u v) - ( eq-∞-value-∞-constant-subsequence u H v) + ( eq-∞-value-∞-constant-Π-subsequence u H v) ( symmetric-eq-∞-sequence ( const-∞-value-∞-constant-sequence H) ( u) From b817ff1655e11a642e1444d6852257905afab92a Mon Sep 17 00:00:00 2001 From: malarbol Date: Fri, 31 May 2024 19:09:51 +0200 Subject: [PATCH 34/67] stationnary intervals of decreasing sequences of natural numbers --- ...notonic-sequences-natural-numbers.lagda.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 23ae6898e3..519cd5c3ec 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -7,6 +7,7 @@ module elementary-number-theory.monotonic-sequences-natural-numbers where
Imports ```agda +open import elementary-number-theory.addition-natural-numbers open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers @@ -244,6 +245,40 @@ module _ ( I)) ``` +### A monotonic sequence of natural numbers `u` with `u (p + n) = u n` is constant between `n` and `p + n` + +```agda +module _ + (u : sequence ℕ) (p n : ℕ) (I : u (p +ℕ n) = u n) + where + + constant-value-is-stationnary-interval-increasing-sequence-ℕ : + is-increasing-sequence-ℕ u → + (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n + constant-value-is-stationnary-interval-increasing-sequence-ℕ H k J = + antisymmetric-leq-ℕ + ( u (k +ℕ n)) + ( u n) + ( concatenate-leq-eq-ℕ + ( u (k +ℕ n)) + ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J)) + ( I)) + ( H n (k +ℕ n) (leq-add-ℕ' n k)) + + constant-value-is-stationnary-interval-decreasing-sequence-ℕ : + is-decreasing-sequence-ℕ u → + (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n + constant-value-is-stationnary-interval-decreasing-sequence-ℕ H k J = + antisymmetric-leq-ℕ + ( u (k +ℕ n)) + ( u n) + ( H n (k +ℕ n) (leq-add-ℕ' n k)) + ( concatenate-eq-leq-ℕ + ( u (k +ℕ n)) + ( inv I) + ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J))) +``` + ### A monotonic sequence of natural numbers with a constant subsequence is asymptotically constant ```agda @@ -652,3 +687,63 @@ module _ ( extract-strict-decreasing-value-subsequence-ℕ n)))))) ( is-strict-value-extract-strict-decreasing-value-subsequence-ℕ n)) ``` + +### Decreasing sequences of natural numbers have arbitrarily long stationnary intervals + +```agda +stationnary-interval-bounded-decreasing-sequence-ℕ : + (u : sequence ℕ) (H : is-decreasing-sequence-ℕ u) (M : ℕ) → + (leq-ℕ (u zero-ℕ) M) → + ((p : ℕ) → Σ ℕ (λ n → u (p +ℕ n) = u n)) +stationnary-interval-bounded-decreasing-sequence-ℕ u H zero-ℕ I p = + ( zero-ℕ , + antisymmetric-leq-ℕ + ( u p) + ( u zero-ℕ) + ( H zero-ℕ p (leq-zero-ℕ p)) + ( transitive-leq-ℕ (u 0) 0 (u p) (leq-zero-ℕ (u p)) I)) +stationnary-interval-bounded-decreasing-sequence-ℕ u H (succ-ℕ M) I p = + rec-coproduct + ( λ J → (zero-ℕ , J)) + ( λ J → + rec-Σ + ( λ k H → (skip-ℕ p k , H)) + ( stationnary-interval-bounded-decreasing-sequence-ℕ + ( sequence-subsequence u (skip-subsequence p u)) + ( is-decreasing-Π-subsequence-ℕ + ( u) + ( H) + ( skip-subsequence p u)) + ( M) + ( transitive-leq-ℕ + ( u (succ-ℕ p)) + ( u p) + ( M) + ( leq-le-succ-ℕ + ( u p) + ( M) + ( concatenate-le-leq-ℕ {u p} {u 0} {succ-ℕ M} J I)) + ( H p (succ-ℕ p) (succ-leq-ℕ p))) + ( p))) + ( eq-or-le-leq-ℕ + ( u p) + ( u zero-ℕ) + ( H zero-ℕ p (leq-zero-ℕ p))) + +module _ + {u : sequence ℕ} (H : is-decreasing-sequence-ℕ u) + where + + stationnary-interval-decreasing-sequence-ℕ : + (p : ℕ) → Σ ℕ (λ n → u (p +ℕ n) = u n) + stationnary-interval-decreasing-sequence-ℕ = + stationnary-interval-bounded-decreasing-sequence-ℕ + ( u) + ( H) + ( u 0) + ( refl-leq-ℕ (u 0)) +``` + +## External links + +- [Decreasing sequences of natural numbers](https://ncatlab.org/nlab/show/natural+number#decreasing_sequences_of_natural_numbers) at $n$Lab From 8169cda3875a633cf088f1337981380d02fb0af9 Mon Sep 17 00:00:00 2001 From: malarbol Date: Fri, 31 May 2024 19:12:28 +0200 Subject: [PATCH 35/67] lint --- .../monotonic-sequences-natural-numbers.lagda.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 519cd5c3ec..5284896edb 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -746,4 +746,5 @@ module _ ## External links -- [Decreasing sequences of natural numbers](https://ncatlab.org/nlab/show/natural+number#decreasing_sequences_of_natural_numbers) at $n$Lab +- [Decreasing sequences of natural numbers](https://ncatlab.org/nlab/show/natural+number#decreasing_sequences_of_natural_numbers) + at $n$Lab From 7a3f3e9106d119eff5ab4757a7623ca7e8304078 Mon Sep 17 00:00:00 2001 From: malarbol Date: Fri, 31 May 2024 23:53:33 +0200 Subject: [PATCH 36/67] WIP sequences posets --- ...notonic-sequences-natural-numbers.lagda.md | 53 +++ src/foundation/sequences.lagda.md | 15 + src/foundation/subsequences.lagda.md | 12 + src/order-theory.lagda.md | 2 + .../monotonic-sequences-posets.lagda.md | 352 ++++++++++++++++++ src/order-theory/posets.lagda.md | 3 + src/order-theory/sequences-posets.lagda.md | 84 +++++ 7 files changed, 521 insertions(+) create mode 100644 src/order-theory/monotonic-sequences-posets.lagda.md create mode 100644 src/order-theory/sequences-posets.lagda.md diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md index 8f7d0e908b..8f03ce6b5f 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -236,6 +236,31 @@ module _ ( is-strict-decreasing-is-strict-decreasing-value-sequence-ℕ f) ``` +### Strictly increasing sequences of natural numbers preserve inequality + +```agda +module _ + (f : strict-increasing-sequence-ℕ) (p q : ℕ) + where + + preserves-leq-strict-increasing-sequence-ℕ : + leq-ℕ p q → + leq-ℕ + ( sequence-strict-increasing-sequence-ℕ f p) + ( sequence-strict-increasing-sequence-ℕ f q) + preserves-leq-strict-increasing-sequence-ℕ = + ( leq-eq-or-le-ℕ + (sequence-strict-increasing-sequence-ℕ f p) + (sequence-strict-increasing-sequence-ℕ f q)) ∘ + ( map-coproduct + ( ap (sequence-strict-increasing-sequence-ℕ f)) + ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ + ( f) + ( p) + ( q))) ∘ + ( eq-or-le-leq-ℕ p q) +``` + ### The identity sequence is strictly increasing ```agda @@ -246,6 +271,34 @@ strict-increasing-id-ℕ : strict-increasing-sequence-ℕ strict-increasing-id-ℕ = id , is-strict-increasing-id-ℕ ``` +### The identity sequence is lesser than all strictly increasing sequences of natural numbers + +```agda +module _ + (f : strict-increasing-sequence-ℕ) + where + + leq-id-strict-increasing-sequence-ℕ : + (n : ℕ) → leq-ℕ n (sequence-strict-increasing-sequence-ℕ f n) + leq-id-strict-increasing-sequence-ℕ = + ind-ℕ + ( leq-zero-ℕ (sequence-strict-increasing-sequence-ℕ f zero-ℕ)) + ( λ n H → + leq-succ-le-ℕ + ( n) + ( sequence-strict-increasing-sequence-ℕ f (succ-ℕ n)) + ( concatenate-leq-le-ℕ + { n} + { sequence-strict-increasing-sequence-ℕ f n} + { sequence-strict-increasing-sequence-ℕ f (succ-ℕ n)} + ( H) + ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ + ( f) + ( n) + ( succ-ℕ n) + ( succ-le-ℕ n)))) +``` + ### The successor function is strictly increasing ```agda diff --git a/src/foundation/sequences.lagda.md b/src/foundation/sequences.lagda.md index 5a8b9fa482..e06d8e1bde 100644 --- a/src/foundation/sequences.lagda.md +++ b/src/foundation/sequences.lagda.md @@ -7,7 +7,11 @@ module foundation.sequences where
Imports ```agda +open import elementary-number-theory.natural-numbers + open import foundation.dependent-sequences +open import foundation.function-extensionality +open import foundation.identity-types open import foundation.universe-levels open import foundation-core.function-types @@ -35,3 +39,14 @@ map-sequence : {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A → B) → sequence A → sequence B map-sequence f a = f ∘ a ``` + +### Equality of sequences + +```agda +module _ + {l : Level} {A : UU l} (u v : sequence A) + where + + eq-sequence : ((n : ℕ) → u n = v n) → u = v + eq-sequence = eq-htpy +``` diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index f66c95a589..7ace77402b 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -8,6 +8,7 @@ module foundation.subsequences where ```agda open import elementary-number-theory.addition-natural-numbers +open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers @@ -64,6 +65,17 @@ module _ is-strict-increasing-extract-subsequence = is-strict-increasing-sequence-strict-increasing-sequence-ℕ v + leq-id-extract-subsequence : + (p : ℕ) → leq-ℕ p (extract-subsequence p) + leq-id-extract-subsequence = leq-id-strict-increasing-sequence-ℕ v + + preserves-leq-extract-subsequence : + (p q : ℕ) → + leq-ℕ p q → + leq-ℕ (extract-subsequence p) (extract-subsequence q) + preserves-leq-extract-subsequence = + preserves-leq-strict-increasing-sequence-ℕ v + sequence-subsequence : sequence A sequence-subsequence n = u (extract-subsequence n) ``` diff --git a/src/order-theory.lagda.md b/src/order-theory.lagda.md index 1ce9b78699..f1f63c0c3d 100644 --- a/src/order-theory.lagda.md +++ b/src/order-theory.lagda.md @@ -77,6 +77,7 @@ open import order-theory.maximal-chains-posets public open import order-theory.maximal-chains-preorders public open import order-theory.meet-semilattices public open import order-theory.meet-suplattices public +open import order-theory.monotonic-sequences-posets public open import order-theory.nuclei-large-locales public open import order-theory.order-preserving-maps-large-posets public open import order-theory.order-preserving-maps-large-preorders public @@ -94,6 +95,7 @@ open import order-theory.preorders public open import order-theory.principal-lower-sets-large-posets public open import order-theory.principal-upper-sets-large-posets public open import order-theory.reflective-galois-connections-large-posets public +open import order-theory.sequences-posets public open import order-theory.similarity-of-elements-large-posets public open import order-theory.similarity-of-elements-large-preorders public open import order-theory.similarity-of-order-preserving-maps-large-posets public diff --git a/src/order-theory/monotonic-sequences-posets.lagda.md b/src/order-theory/monotonic-sequences-posets.lagda.md new file mode 100644 index 0000000000..cc8b0f55e5 --- /dev/null +++ b/src/order-theory/monotonic-sequences-posets.lagda.md @@ -0,0 +1,352 @@ +# Monotonic sequences in partially ordered sets + +```agda +module order-theory.monotonic-sequences-posets where +``` + +
Imports + +```agda +open import elementary-number-theory.based-induction-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-monotonic-sequences-natural-numbers + +open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotically-constant-sequences +open import foundation.binary-relations +open import foundation.constant-sequences +open import foundation.coproduct-types +open import foundation.dependent-pair-types +open import foundation.empty-types +open import foundation.function-types +open import foundation.functoriality-coproduct-types +open import foundation.functoriality-dependent-pair-types +open import foundation.identity-types +open import foundation.negation +open import foundation.propositions +open import foundation.sequences +open import foundation.subsequences +open import foundation.transport-along-identifications +open import foundation.universe-levels + +open import order-theory.posets +open import order-theory.sequences-posets +``` + +
+ +## Idea + +Monotonic sequences in partially ordered sets are sequences that preserve or +reverse the +[standard ordering on the natural numbers](elementary-number-theory.inequality-natural-numbers.md). + +## Definitions + +### Monotonic values of sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) (n : ℕ) + where + + is-increasing-value-prop-sequence-poset : Prop l2 + is-increasing-value-prop-sequence-poset = + leq-Poset-Prop P (u n) (u (succ-ℕ n)) + + is-increasing-value-sequence-poset : UU l2 + is-increasing-value-sequence-poset = + type-Prop is-increasing-value-prop-sequence-poset + + is-prop-is-increasing-value-sequence-poset : + is-prop is-increasing-value-sequence-poset + is-prop-is-increasing-value-sequence-poset = + is-prop-type-Prop is-increasing-value-prop-sequence-poset + + is-decreasing-value-prop-sequence-poset : Prop l2 + is-decreasing-value-prop-sequence-poset = + leq-Poset-Prop P (u (succ-ℕ n)) (u n) + + is-decreasing-value-sequence-poset : UU l2 + is-decreasing-value-sequence-poset = + type-Prop is-decreasing-value-prop-sequence-poset + + is-prop-is-decreasing-value-sequence-poset : + is-prop is-decreasing-value-sequence-poset + is-prop-is-decreasing-value-sequence-poset = + is-prop-type-Prop is-decreasing-value-prop-sequence-poset +``` + +### Monotonic sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + where + + is-increasing-prop-sequence-poset : Prop l2 + is-increasing-prop-sequence-poset = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → + hom-Prop + ( leq-ℕ-Prop i j) + ( leq-Poset-Prop P (u i) (u j)))) + + is-increasing-sequence-poset : UU l2 + is-increasing-sequence-poset = + type-Prop is-increasing-prop-sequence-poset + + is-prop-is-increasing-sequence-poset : + is-prop is-increasing-sequence-poset + is-prop-is-increasing-sequence-poset = + is-prop-type-Prop is-increasing-prop-sequence-poset + + is-decreasing-prop-sequence-poset : Prop l2 + is-decreasing-prop-sequence-poset = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → + hom-Prop + ( leq-ℕ-Prop i j) + ( leq-Poset-Prop P (u j) (u i)))) + + is-decreasing-sequence-poset : UU l2 + is-decreasing-sequence-poset = + type-Prop is-decreasing-prop-sequence-poset + + is-prop-is-decreasing-sequence-poset : + is-prop is-decreasing-sequence-poset + is-prop-is-decreasing-sequence-poset = + is-prop-type-Prop is-decreasing-prop-sequence-poset +``` + +## Properties + +### The value of a sequence in a partially ordered set is stationnary if and only if it is both increasing and decreasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} (n : ℕ) + where + + increasing-value-is-stationnary-value-sequence-poset : + is-stationnary-value-sequence u n → + is-increasing-value-sequence-poset P u n + increasing-value-is-stationnary-value-sequence-poset H = + leq-eq-Poset P H + + decreasing-value-is-stationnary-value-sequence-poset : + is-stationnary-value-sequence u n → + is-decreasing-value-sequence-poset P u n + decreasing-value-is-stationnary-value-sequence-poset H = + leq-eq-Poset P (inv H) + + stationnary-value-is-increasing-decreasing-value-sequence-poset : + is-increasing-value-sequence-poset P u n → + is-decreasing-value-sequence-poset P u n → + is-stationnary-value-sequence u n + stationnary-value-is-increasing-decreasing-value-sequence-poset = + antisymmetric-leq-Poset P (u n) (u (succ-ℕ n)) +``` + +### A sequence in a partially ordered set is monotonic if and only if all its values are monotonic with the same monotonicity + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + increasing-sequence-is-increasing-value-sequence-poset : + ((n : ℕ) → is-increasing-value-sequence-poset P u n) → + is-increasing-sequence-poset P u + increasing-sequence-is-increasing-value-sequence-poset H p = + based-ind-ℕ + ( p) + ( λ q → leq-Poset P (u p) (u q)) + ( refl-leq-Poset P (u p)) + ( λ q I → + transitive-leq-Poset P (u p) (u q) (u (succ-ℕ q)) (H q)) + + increasing-value-is-increasing-sequence-poset : + is-increasing-sequence-poset P u → + ((n : ℕ) → is-increasing-value-sequence-poset P u n) + increasing-value-is-increasing-sequence-poset H n = + H n (succ-ℕ n) (succ-leq-ℕ n) + + decreasing-sequence-is-decreasing-value-sequence-poset : + ((n : ℕ) → is-decreasing-value-sequence-poset P u n) → + is-decreasing-sequence-poset P u + decreasing-sequence-is-decreasing-value-sequence-poset H p = + based-ind-ℕ + ( p) + ( λ q → leq-Poset P (u q) (u p)) + ( refl-leq-Poset P (u p)) + ( λ q I J → + transitive-leq-Poset P (u (succ-ℕ q)) (u q) (u p) J (H q)) + + decreasing-value-is-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + ((n : ℕ) → is-decreasing-value-sequence-poset P u n) + decreasing-value-is-decreasing-sequence-poset H n = + H n (succ-ℕ n) (succ-leq-ℕ n) +``` + +### A sequence in a partially ordered set is constant if and only if it is both increasing and decreasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + increasing-is-constant-sequence-poset : + is-constant-sequence u → is-increasing-sequence-poset P u + increasing-is-constant-sequence-poset H p q I = leq-eq-Poset P (H p q) + + decreasing-is-constant-sequence-poset : + is-constant-sequence u → is-decreasing-sequence-poset P u + decreasing-is-constant-sequence-poset H p q I = leq-eq-Poset P (H q p) + + constant-is-increasing-decreasing-sequence-post : + is-increasing-sequence-poset P u → + is-decreasing-sequence-poset P u → + is-constant-sequence u + constant-is-increasing-decreasing-sequence-post I J p q = + rec-coproduct + ( λ H → antisymmetric-leq-Poset P (u p) (u q) (I p q H) (J p q H)) + ( λ H → antisymmetric-leq-Poset P (u p) (u q) (J q p H) (I q p H)) + ( linear-leq-ℕ p q) +``` + +### Any subsequence of a monotonic sequence in a partially ordered set is monotonic + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + increasing-Π-subsequence-increasing-sequence-poset : + is-increasing-sequence-poset P u → + Π-subsequence (is-increasing-sequence-poset P) u + increasing-Π-subsequence-increasing-sequence-poset H v p q I = + H + ( extract-subsequence u v p) + ( extract-subsequence u v q) + ( preserves-leq-extract-subsequence u v p q I) + + decreasing-Π-subsequence-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + Π-subsequence (is-decreasing-sequence-poset P) u + decreasing-Π-subsequence-decreasing-sequence-poset H v p q I = + H + ( extract-subsequence u v p) + ( extract-subsequence u v q) + ( preserves-leq-extract-subsequence u v p q I) +``` + +### A sequence in a partially ordered set is increasing if and only if it is lesser than all its subsequences + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + increasing-Π-subsequence-leq-sequence-poset : + Π-subsequence (λ v → leq-sequence-poset P u v) u → + is-increasing-sequence-poset P u + increasing-Π-subsequence-leq-sequence-poset H = + increasing-sequence-is-increasing-value-sequence-poset + ( P) + ( H (skip-zero-sequence u)) + + Π-subsequence-leq-increasing-sequence-Poset : + is-increasing-sequence-poset P u → + Π-subsequence (λ v → leq-sequence-poset P u v) u + Π-subsequence-leq-increasing-sequence-Poset H v n = + H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) +``` + +### A sequence in a partially ordered set is decreasing if and only if it is greater than all its subsequences + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + decreasing-Π-subsequence-leq-sequence-poset : + Π-subsequence (λ v → leq-sequence-poset P v u) u → + is-decreasing-sequence-poset P u + decreasing-Π-subsequence-leq-sequence-poset H = + decreasing-sequence-is-decreasing-value-sequence-poset + ( P) + ( H (skip-zero-sequence u)) + + Π-subsequence-leq-decreasing-sequence-Poset : + is-decreasing-sequence-poset P u → + Π-subsequence (λ v → leq-sequence-poset P v u) u + Π-subsequence-leq-decreasing-sequence-Poset H v n = + H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) +``` + +### Asymptotical behavior + +#### A monotonic sequence in a partially ordered set with a constant subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + ∞-constant-Σ-subsequence-constant-increasing-sequence-poset : + is-increasing-sequence-poset P u → + Σ-subsequence is-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-constant-increasing-sequence-poset H = + rec-Σ + ( λ v K → + is-∞-constant-eq-∞-constant-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-Poset + ( P) + ( sequence-subsequence u v zero-ℕ) + ( u n) + ( H (extract-subsequence u v zero-ℕ) n I) + ( concatenate-leq-eq-Poset + ( P) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n)) + ( K (modulus-subsequence u v n) zero-ℕ))))) + + ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + Σ-subsequence is-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset H = + rec-Σ + ( λ v K → + is-∞-constant-eq-∞-constant-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-Poset + ( P) + ( sequence-subsequence u v zero-ℕ) + ( u n) + ( concatenate-eq-leq-Poset + ( P) + ( K zero-ℕ (modulus-subsequence u v n)) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n))) + ( H (extract-subsequence u v zero-ℕ) n I)))) +``` diff --git a/src/order-theory/posets.lagda.md b/src/order-theory/posets.lagda.md index e3e5d5e91b..b17485d73c 100644 --- a/src/order-theory/posets.lagda.md +++ b/src/order-theory/posets.lagda.md @@ -74,6 +74,9 @@ module _ refl-leq-Poset : is-reflexive leq-Poset refl-leq-Poset = refl-leq-Preorder preorder-Poset + leq-eq-Poset : {x y : type-Poset} → x = y → leq-Poset x y + leq-eq-Poset {x} {.x} refl = refl-leq-Poset x + transitive-leq-Poset : is-transitive leq-Poset transitive-leq-Poset = transitive-leq-Preorder preorder-Poset diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md new file mode 100644 index 0000000000..1686b018ed --- /dev/null +++ b/src/order-theory/sequences-posets.lagda.md @@ -0,0 +1,84 @@ +# Sequences in partially ordered sets + +```agda +module order-theory.sequences-posets where +``` + +
Imports + +```agda +open import elementary-number-theory.natural-numbers + +open import foundation.binary-relations +open import foundation.dependent-pair-types +open import foundation.identity-types +open import foundation.propositions +open import foundation.sequences +open import foundation.universe-levels + +open import order-theory.posets +``` + +
+ +## Idea + +Sequences in a partially ordered set are sequences in the underlying set. They +can be partially ordered by pointwise comparison. + +## Definitions + +### Sequences in a partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + sequence-poset : UU l1 + sequence-poset = sequence (type-Poset P) +``` + +### Pointwise comparison on sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u v : sequence-poset P) + where + + leq-prop-sequence-poset : Prop l2 + leq-prop-sequence-poset = Π-Prop ℕ (λ n → leq-Poset-Prop P (u n) (v n)) + + leq-sequence-poset : UU l2 + leq-sequence-poset = type-Prop leq-prop-sequence-poset + + is-prop-leq-sequence-poset : is-prop leq-sequence-poset + is-prop-leq-sequence-poset = is-prop-type-Prop leq-prop-sequence-poset +``` + +### The partially ordered set of sequences in a partially ordered set + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + poset-sequence-poset : Poset l1 l2 + pr1 (pr1 poset-sequence-poset) = sequence-poset P + pr1 (pr2 (pr1 poset-sequence-poset)) = leq-prop-sequence-poset P + pr1 (pr2 (pr2 (pr1 poset-sequence-poset))) u n = refl-leq-Poset P (u n) + pr2 (pr2 (pr2 (pr1 poset-sequence-poset))) u v w J I n = + transitive-leq-Poset P (u n) (v n) (w n) (J n) (I n) + pr2 poset-sequence-poset u v I J = + eq-sequence u v (λ n → antisymmetric-leq-Poset P (u n) (v n) (I n) (J n)) + + refl-leq-sequence-poset : is-reflexive (leq-sequence-poset P) + refl-leq-sequence-poset = refl-leq-Poset poset-sequence-poset + + transitive-leq-sequence-poset : is-transitive (leq-sequence-poset P) + transitive-leq-sequence-poset = transitive-leq-Poset poset-sequence-poset + + antisymmetric-leq-sequence-poset : is-antisymmetric (leq-sequence-poset P) + antisymmetric-leq-sequence-poset = + antisymmetric-leq-Poset poset-sequence-poset +``` From 463c4275b9cd14757f21904abf7155cce1c5dd77 Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 02:22:48 +0200 Subject: [PATCH 37/67] refactor monotonic sequences posets --- ...notonic-sequences-natural-numbers.lagda.md | 409 ++---------------- .../monotonic-sequences-posets.lagda.md | 123 +++++- 2 files changed, 157 insertions(+), 375 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 5284896edb..e5c6625112 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -32,6 +32,8 @@ open import foundation.subsequences open import foundation.transport-along-identifications open import foundation.type-arithmetic-empty-type open import foundation.universe-levels + +open import order-theory.monotonic-sequences-posets ```
@@ -43,52 +45,6 @@ or reverse inequality of natural numbers. ## Definitions -### Increasing sequences of natural numbers - -```agda -module _ - (f : sequence ℕ) - where - - is-increasing-prop-sequence-ℕ : Prop lzero - is-increasing-prop-sequence-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f i) (f j)))) - - is-increasing-sequence-ℕ : UU lzero - is-increasing-sequence-ℕ = - type-Prop is-increasing-prop-sequence-ℕ - - is-prop-is-increasing-sequence-ℕ : - is-prop is-increasing-sequence-ℕ - is-prop-is-increasing-sequence-ℕ = - is-prop-type-Prop is-increasing-prop-sequence-ℕ -``` - -### Decreasing sequences of natural numbers - -```agda -module _ - (f : sequence ℕ) - where - - is-decreasing-sequence-prop-ℕ : Prop lzero - is-decreasing-sequence-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (leq-ℕ-Prop i j) (leq-ℕ-Prop (f j) (f i)))) - - is-decreasing-sequence-ℕ : UU lzero - is-decreasing-sequence-ℕ = type-Prop is-decreasing-sequence-prop-ℕ - - is-prop-is-decreasing-sequence-ℕ : is-prop is-decreasing-sequence-ℕ - is-prop-is-decreasing-sequence-ℕ = - is-prop-type-Prop is-decreasing-sequence-prop-ℕ -``` - ### Monotonic values of sequences of natural numbers ```agda @@ -96,316 +52,49 @@ module _ (f : sequence ℕ) (n : ℕ) where - is-increasing-value-prop-sequence-ℕ : Prop lzero - is-increasing-value-prop-sequence-ℕ = leq-ℕ-Prop (f n) (f (succ-ℕ n)) - is-increasing-value-sequence-ℕ : UU lzero is-increasing-value-sequence-ℕ = - type-Prop is-increasing-value-prop-sequence-ℕ - - is-prop-is-increasing-value-sequence-ℕ : - is-prop is-increasing-value-sequence-ℕ - is-prop-is-increasing-value-sequence-ℕ = - is-prop-type-Prop is-increasing-value-prop-sequence-ℕ - - is-decreasing-value-prop-sequence-ℕ : Prop lzero - is-decreasing-value-prop-sequence-ℕ = leq-ℕ-Prop (f (succ-ℕ n)) (f n) + is-increasing-value-sequence-poset ℕ-Poset f n is-decreasing-value-sequence-ℕ : UU lzero is-decreasing-value-sequence-ℕ = - type-Prop is-decreasing-value-prop-sequence-ℕ - - is-prop-is-decreasing-value-sequence-ℕ : - is-prop is-decreasing-value-sequence-ℕ - is-prop-is-decreasing-value-sequence-ℕ = - is-prop-type-Prop is-decreasing-value-prop-sequence-ℕ -``` - -## Properties - -### A sequence is monotonic if and only if all its values are monotonic of the same monotonicity - -```agda -module _ - (f : sequence ℕ) - where - - is-increasing-value-is-increasing-sequence-ℕ : - is-increasing-sequence-ℕ f → - ((n : ℕ) → is-increasing-value-sequence-ℕ f n) - is-increasing-value-is-increasing-sequence-ℕ H n = - H n (succ-ℕ n) (succ-leq-ℕ n) - - is-increasing-is-increasing-value-sequence-ℕ : - ((n : ℕ) → is-increasing-value-sequence-ℕ f n) → - is-increasing-sequence-ℕ f - is-increasing-is-increasing-value-sequence-ℕ H p = - based-ind-ℕ - ( p) - ( λ k → leq-ℕ (f p) (f k)) - ( refl-leq-ℕ (f p)) - ( λ n J → transitive-leq-ℕ (f p) (f n) (f (succ-ℕ n)) (H n)) - - is-decreasing-value-is-decreasing-sequence-ℕ : - is-decreasing-sequence-ℕ f → - ((n : ℕ) → is-decreasing-value-sequence-ℕ f n) - is-decreasing-value-is-decreasing-sequence-ℕ H n = - H n (succ-ℕ n) (succ-leq-ℕ n) - - is-decreasing-is-decreasing-value-sequence-ℕ : - ((n : ℕ) → is-decreasing-value-sequence-ℕ f n) → - is-decreasing-sequence-ℕ f - is-decreasing-is-decreasing-value-sequence-ℕ H p = - based-ind-ℕ - ( p) - ( λ k → leq-ℕ (f k) (f p)) - ( refl-leq-ℕ (f p)) - ( λ n J K → transitive-leq-ℕ (f (succ-ℕ n)) (f n) (f p) K (H n)) + is-decreasing-value-sequence-poset ℕ-Poset f n ``` -## Strictly increasing sequences of natural numbers are monotonic +### Monotonic sequences of natural numbers ```agda module _ (f : sequence ℕ) where - is-increasing-value-is-strict-increasing-value-sequence-ℕ : - (n : ℕ) → - is-strict-increasing-value-sequence-ℕ f n → - is-increasing-value-sequence-ℕ f n - is-increasing-value-is-strict-increasing-value-sequence-ℕ n = - leq-le-ℕ (f n) (f (succ-ℕ n)) - - is-increasing-is-strict-increasing-sequence-ℕ : - is-strict-increasing-sequence-ℕ f → is-increasing-sequence-ℕ f - is-increasing-is-strict-increasing-sequence-ℕ H = - is-increasing-is-increasing-value-sequence-ℕ f - ( λ n → is-increasing-value-is-strict-increasing-value-sequence-ℕ n - ( is-strict-increasing-value-is-strict-increasing-sequence-ℕ f H n)) -``` - -### A sequence of natural numbers is constant if and only if it is increasing and decreasing - -```agda -module _ - (f : sequence ℕ) - where - - is-increasing-is-constant-sequence-ℕ : - is-constant-sequence f → is-increasing-sequence-ℕ f - is-increasing-is-constant-sequence-ℕ H p q I = leq-eq-ℕ (f p) (f q) (H p q) - - is-decreasing-is-constant-sequence-ℕ : - is-constant-sequence f → is-decreasing-sequence-ℕ f - is-decreasing-is-constant-sequence-ℕ H p q I = leq-eq-ℕ (f q) (f p) (H q p) - - is-constant-is-increasing-decreasing-sequence-ℕ : - is-increasing-sequence-ℕ f → - is-decreasing-sequence-ℕ f → - is-constant-sequence f - is-constant-is-increasing-decreasing-sequence-ℕ I J p q = - rec-coproduct - ( λ H → antisymmetric-leq-ℕ (f p) (f q) (I p q H) (J p q H)) - ( λ H → antisymmetric-leq-ℕ (f p) (f q) (J q p H) (I q p H)) - ( linear-leq-ℕ p q) -``` - -### Any subsequence of a monotonic sequence of natural numbers is monotonic - -```agda -module _ - (u : sequence ℕ) - where - - is-increasing-Π-subsequence-ℕ : - (H : is-increasing-sequence-ℕ u) → Π-subsequence is-increasing-sequence-ℕ u - is-increasing-Π-subsequence-ℕ H v p q I = - H - ( extract-subsequence u v p) - ( extract-subsequence u v q) - ( is-increasing-is-strict-increasing-sequence-ℕ - ( extract-subsequence u v) - ( is-strict-increasing-extract-subsequence u v) - ( p) - ( q) - ( I)) - - is-decreasing-Π-subsequence-ℕ : - (H : is-decreasing-sequence-ℕ u) → Π-subsequence is-decreasing-sequence-ℕ u - is-decreasing-Π-subsequence-ℕ H v p q I = - H - ( extract-subsequence u v p) - ( extract-subsequence u v q) - ( is-increasing-is-strict-increasing-sequence-ℕ - ( extract-subsequence u v) - ( is-strict-increasing-extract-subsequence u v) - ( p) - ( q) - ( I)) -``` - -### A monotonic sequence of natural numbers `u` with `u (p + n) = u n` is constant between `n` and `p + n` - -```agda -module _ - (u : sequence ℕ) (p n : ℕ) (I : u (p +ℕ n) = u n) - where - - constant-value-is-stationnary-interval-increasing-sequence-ℕ : - is-increasing-sequence-ℕ u → - (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n - constant-value-is-stationnary-interval-increasing-sequence-ℕ H k J = - antisymmetric-leq-ℕ - ( u (k +ℕ n)) - ( u n) - ( concatenate-leq-eq-ℕ - ( u (k +ℕ n)) - ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J)) - ( I)) - ( H n (k +ℕ n) (leq-add-ℕ' n k)) - - constant-value-is-stationnary-interval-decreasing-sequence-ℕ : - is-decreasing-sequence-ℕ u → - (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n - constant-value-is-stationnary-interval-decreasing-sequence-ℕ H k J = - antisymmetric-leq-ℕ - ( u (k +ℕ n)) - ( u n) - ( H n (k +ℕ n) (leq-add-ℕ' n k)) - ( concatenate-eq-leq-ℕ - ( u (k +ℕ n)) - ( inv I) - ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J))) -``` - -### A monotonic sequence of natural numbers with a constant subsequence is asymptotically constant - -```agda -module _ - {u : sequence ℕ} - where - - is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ : - is-increasing-sequence-ℕ u → - Σ-subsequence is-constant-sequence u → - is-∞-constant-sequence u - is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H = - rec-Σ - ( λ v K → - is-∞-constant-eq-∞-constant-sequence - ( u (extract-subsequence u v zero-ℕ)) - ( u) - ( ( extract-subsequence u v zero-ℕ) , - ( λ n I → - antisymmetric-leq-ℕ - ( u (extract-subsequence u v zero-ℕ)) - ( u n) - ( H (extract-subsequence u v zero-ℕ) n I) - ( tr - ( leq-ℕ (u n)) - ( K (modulus-subsequence u v n) zero-ℕ) - ( H - ( n) - ( extract-modulus-subsequence u v n) - ( leq-extract-modulus-subsequence u v n)))))) - - is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ : - is-decreasing-sequence-ℕ u → - Σ-subsequence is-constant-sequence u → - is-∞-constant-sequence u - is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H = - rec-Σ - ( λ v K → - is-∞-constant-eq-∞-constant-sequence - ( u (extract-subsequence u v zero-ℕ)) - ( u) - ( ( extract-subsequence u v zero-ℕ) , - ( λ n I → - antisymmetric-leq-ℕ - ( u (extract-subsequence u v zero-ℕ)) - ( u n) - ( tr - ( λ k → leq-ℕ k (u n)) - ( K (modulus-subsequence u v n) zero-ℕ) - ( H - ( n) - ( extract-modulus-subsequence u v n) - ( leq-extract-modulus-subsequence u v n))) - ( H (extract-subsequence u v zero-ℕ) n I)))) -``` - -### A monotonic sequence of natural numbers with an asymptotically constant subsequence is asymptotically constant - -```agda -module _ - {u : sequence ℕ} - where + is-increasing-sequence-ℕ : UU lzero + is-increasing-sequence-ℕ = is-increasing-sequence-poset ℕ-Poset f - is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ : - is-increasing-sequence-ℕ u → - Σ-subsequence is-∞-constant-sequence u → - is-∞-constant-sequence u - is-∞-constant-is-∞-constant-subsequence-increasing-sequence-ℕ H = - ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H) ∘ - ( rec-Σ - ( λ v → - ( rec-Σ ( λ w I → ( sub-subsequence u v w , I))) ∘ - ( constant-subsequence-is-∞-constant-sequence - ( sequence-subsequence u v)))) - - is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ : - is-decreasing-sequence-ℕ u → - Σ-subsequence is-∞-constant-sequence u → - is-∞-constant-sequence u - is-∞-constant-is-∞-constant-subsequence-decreasing-sequence-ℕ H = - ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H) ∘ - ( rec-Σ - ( λ v → - ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ - ( constant-subsequence-is-∞-constant-sequence - ( sequence-subsequence u v)))) + is-decreasing-sequence-ℕ : UU lzero + is-decreasing-sequence-ℕ = is-decreasing-sequence-poset ℕ-Poset f ``` -### A decreasing sequence of natural numbers with an increasing subsequence is asymptotically constant - -```agda -module _ - {u : sequence ℕ} (H : is-decreasing-sequence-ℕ u) - where - - is-∞-constant-is-increasing-subsequence-decreasing-subsequence-ℕ : - Σ-subsequence is-increasing-sequence-ℕ u → is-∞-constant-sequence u - is-∞-constant-is-increasing-subsequence-decreasing-subsequence-ℕ = - ( is-∞-constant-is-constant-subsequence-decreasing-sequence-ℕ H) ∘ - ( tot - ( λ v K → - is-constant-is-increasing-decreasing-sequence-ℕ - ( sequence-subsequence u v) - ( K) - ( is-decreasing-Π-subsequence-ℕ u H v))) -``` +## Properties -### An increasing sequence of natural numbers with an decreasing subsequence is asymptotically constant +### A decreasing sequence of natural numbers that takes the value zero is asymptotically equal to zero ```agda module _ - {u : sequence ℕ} (H : is-increasing-sequence-ℕ u) + {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where - is-∞-constant-is-decreasing-subsequence-increasing-subsequence-ℕ : - Σ-subsequence is-decreasing-sequence-ℕ u → is-∞-constant-sequence u - is-∞-constant-is-decreasing-subsequence-increasing-subsequence-ℕ = - ( is-∞-constant-is-constant-subsequence-increasing-sequence-ℕ H) ∘ - ( tot - ( λ v K → - is-constant-is-increasing-decreasing-sequence-ℕ - ( sequence-subsequence u v) - ( is-increasing-Π-subsequence-ℕ u H v) - ( K))) + eq-∞-zero-is-zero-value-decreasing-sequence-ℕ : + Σ ℕ (λ n → zero-ℕ = f n) → asymptotically (λ n → zero-ℕ = f n) + eq-∞-zero-is-zero-value-decreasing-sequence-ℕ = + tot + ( λ n K k I → + is-zero-leq-zero-ℕ' + ( f k) + ( inv-tr (leq-ℕ (f k)) K (H n k I))) ``` -### A monotonic value is either stationnary or strictly monotonic +### A monotonic value of a sequence of natural numbers is either stationnary or strictly monotonic ```agda module _ @@ -434,12 +123,12 @@ module _ (f : sequence ℕ) where - is-stationnary-is-not-strict-value-increasing-sequence-ℕ : + stationnary-value-is-not-strict-value-increasing-sequence-ℕ : is-increasing-sequence-ℕ f → (n : ℕ) → ¬ (is-strict-increasing-value-sequence-ℕ f n) → is-stationnary-value-sequence f n - is-stationnary-is-not-strict-value-increasing-sequence-ℕ H n K = + stationnary-value-is-not-strict-value-increasing-sequence-ℕ H n K = map-right-unit-law-coproduct-is-empty ( is-stationnary-value-sequence f n) ( is-strict-increasing-value-sequence-ℕ f n) @@ -447,14 +136,14 @@ module _ ( decide-is-stationnary-is-increasing-value-sequence-ℕ ( f) ( n) - ( is-increasing-value-is-increasing-sequence-ℕ f H n)) + ( increasing-value-is-increasing-sequence-poset ℕ-Poset {f} H n)) - is-stationnary-is-not-strict-value-decreasing-sequence-ℕ : + stationnary-value-is-not-strict-value-decreasing-sequence-ℕ : is-decreasing-sequence-ℕ f → (n : ℕ) → ¬ (is-strict-decreasing-value-sequence-ℕ f n) → is-stationnary-value-sequence f n - is-stationnary-is-not-strict-value-decreasing-sequence-ℕ H n K = + stationnary-value-is-not-strict-value-decreasing-sequence-ℕ H n K = map-right-unit-law-coproduct-is-empty ( is-stationnary-value-sequence f n) ( is-strict-decreasing-value-sequence-ℕ f n) @@ -462,24 +151,7 @@ module _ ( decide-is-stationnary-is-decreasing-value-sequence-ℕ ( f) ( n) - ( is-decreasing-value-is-decreasing-sequence-ℕ f H n)) -``` - -### A decreasing sequence of natural numbers that takes the value zero is asymptotically equal to zero - -```agda -module _ - {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) - where - - is-∞-zero-is-zero-value-decreasing-sequence-ℕ : - Σ ℕ (λ n → zero-ℕ = f n) → asymptotically (λ n → zero-ℕ = f n) - is-∞-zero-is-zero-value-decreasing-sequence-ℕ = - tot - ( λ n K k I → - is-zero-leq-zero-ℕ' - ( f k) - ( inv-tr (leq-ℕ (f k)) K (H n k I))) + ( decreasing-value-is-decreasing-sequence-poset ℕ-Poset {f} H n)) ``` ### A decreasing sequence of natural numbers that has no strictly decreasing value is constant @@ -489,13 +161,13 @@ module _ {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where - is-constant-no-strict-decreasing-value-decreasing-sequence-ℕ : + constant-no-strict-decreasing-value-decreasing-sequence-ℕ : ((n : ℕ) → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → is-constant-sequence f - is-constant-no-strict-decreasing-value-decreasing-sequence-ℕ K = + constant-no-strict-decreasing-value-decreasing-sequence-ℕ K = is-constant-is-stationnary-value-sequence f ( λ n → - is-stationnary-is-not-strict-value-decreasing-sequence-ℕ + stationnary-value-is-not-strict-value-decreasing-sequence-ℕ ( f) ( H) ( n) @@ -509,13 +181,13 @@ module _ {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where - is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ : + ∞-constant-∞-no-strict-value-decreasing-sequence-ℕ : asymptotically (λ n → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → is-∞-constant-sequence f - is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ = + ∞-constant-∞-no-strict-value-decreasing-sequence-ℕ = ( is-∞-constant-is-∞-stationnary-sequence f) ∘ ( map-asymptotically-Π - ( is-stationnary-is-not-strict-value-decreasing-sequence-ℕ f H)) + ( stationnary-value-is-not-strict-value-decreasing-sequence-ℕ f H)) ``` ### A decreasing sequence of natural numbers with bounded strictly decreasing values is asymptotically constant @@ -533,11 +205,11 @@ module _ {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where - is-∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ : + ∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ : Σ ℕ (is-upper-bound-strict-decreasing-value-sequence-ℕ f) → is-∞-constant-sequence f - is-∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ = - ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ H) ∘ + ∞-constant-is-upper-bounded-strict-value-decreasing-sequence-ℕ = + ( ∞-constant-∞-no-strict-value-decreasing-sequence-ℕ H) ∘ ( rec-Σ (λ N I → (N , (λ n J L → contradiction-le-ℕ n N (I n L) J)))) ``` @@ -571,11 +243,11 @@ module _ {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where - is-∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ : + ∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ : Σ ℕ (λ N → ¬ Σ ℕ (is-∞-strict-decreasing-value-sequence-ℕ f N)) → is-∞-constant-sequence f - is-∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ = - ( is-∞-constant-∞-no-strict-value-decreasing-sequence-ℕ H) ∘ + ∞-constant-no-∞-strict-decreasing-value-decreasing-sequence-ℕ = + ( ∞-constant-∞-no-strict-value-decreasing-sequence-ℕ H) ∘ ( tot (λ n K p I J → K (p , ( I , J)))) ``` @@ -710,7 +382,8 @@ stationnary-interval-bounded-decreasing-sequence-ℕ u H (succ-ℕ M) I p = ( λ k H → (skip-ℕ p k , H)) ( stationnary-interval-bounded-decreasing-sequence-ℕ ( sequence-subsequence u (skip-subsequence p u)) - ( is-decreasing-Π-subsequence-ℕ + ( decreasing-Π-subsequence-decreasing-sequence-poset + ( ℕ-Poset) ( u) ( H) ( skip-subsequence p u)) diff --git a/src/order-theory/monotonic-sequences-posets.lagda.md b/src/order-theory/monotonic-sequences-posets.lagda.md index cc8b0f55e5..b3235c946d 100644 --- a/src/order-theory/monotonic-sequences-posets.lagda.md +++ b/src/order-theory/monotonic-sequences-posets.lagda.md @@ -7,6 +7,7 @@ module order-theory.monotonic-sequences-posets where
Imports ```agda +open import elementary-number-theory.addition-natural-numbers open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers @@ -126,11 +127,11 @@ module _ ## Properties -### The value of a sequence in a partially ordered set is stationnary if and only if it is both increasing and decreasing +### Any value of a sequence in a partially ordered set is stationnary if and only if it is both increasing and decreasing ```agda module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} (n : ℕ) + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) (n : ℕ) where increasing-value-is-stationnary-value-sequence-poset : @@ -210,11 +211,11 @@ module _ is-constant-sequence u → is-decreasing-sequence-poset P u decreasing-is-constant-sequence-poset H p q I = leq-eq-Poset P (H q p) - constant-is-increasing-decreasing-sequence-post : + constant-is-increasing-decreasing-sequence-poset : is-increasing-sequence-poset P u → is-decreasing-sequence-poset P u → is-constant-sequence u - constant-is-increasing-decreasing-sequence-post I J p q = + constant-is-increasing-decreasing-sequence-poset I J p q = rec-coproduct ( λ H → antisymmetric-leq-Poset P (u p) (u q) (I p q H) (J p q H)) ( λ H → antisymmetric-leq-Poset P (u p) (u q) (J q p H) (I q p H)) @@ -225,7 +226,7 @@ module _ ```agda module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) where increasing-Π-subsequence-increasing-sequence-poset : @@ -251,7 +252,7 @@ module _ ```agda module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) where increasing-Π-subsequence-leq-sequence-poset : @@ -273,7 +274,7 @@ module _ ```agda module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) where decreasing-Π-subsequence-leq-sequence-poset : @@ -291,6 +292,43 @@ module _ H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) ``` +### A monotonic sequence `u` with `u (p + n) = u p` is constant between `n` and `p + n` + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + (p n : ℕ) (I : u (p +ℕ n) = u n) + where + + constant-value-is-stationnary-interval-increasing-sequence-poset : + is-increasing-sequence-poset P u → + (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n + constant-value-is-stationnary-interval-increasing-sequence-poset H k J = + antisymmetric-leq-Poset + ( P) + ( u (k +ℕ n)) + ( u n) + ( concatenate-leq-eq-Poset + ( P) + ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J)) + ( I)) + ( H n (k +ℕ n) (leq-add-ℕ' n k)) + + constant-value-is-stationnary-interval-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n + constant-value-is-stationnary-interval-decreasing-sequence-poset H k J = + antisymmetric-leq-Poset + ( P) + ( u (k +ℕ n)) + ( u n) + ( H n (k +ℕ n) (leq-add-ℕ' n k)) + ( concatenate-eq-leq-Poset + ( P) + ( inv I) + ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J))) +``` + ### Asymptotical behavior #### A monotonic sequence in a partially ordered set with a constant subsequence is asymptotically constant @@ -350,3 +388,74 @@ module _ ( leq-extract-modulus-subsequence u v n))) ( H (extract-subsequence u v zero-ℕ) n I)))) ``` + +#### A monotonic sequence in a partially ordered set with an asymptotically constant subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + ∞-constant-Σ-subsequence-∞-constant-increasing-sequence-poset : + is-increasing-sequence-poset P u → + Σ-subsequence is-∞-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-∞-constant-increasing-sequence-poset H = + ( ∞-constant-Σ-subsequence-constant-increasing-sequence-poset P H) ∘ + ( rec-Σ + ( λ v → + ( rec-Σ ( λ w I → ( sub-subsequence u v w , I))) ∘ + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v)))) + + ∞-constant-Σ-subsequence-∞-constant-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + Σ-subsequence is-∞-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-∞-constant-decreasing-sequence-poset H = + ( ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset P H) ∘ + ( rec-Σ + ( λ v → + ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v)))) +``` + +#### An increasing sequence in a partially ordered set with a decreasing subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + (H : is-increasing-sequence-poset P u) + where + + ∞-constant-Σ-subsequence-decreasing-is-increasing-sequence-poset : + Σ-subsequence (is-decreasing-sequence-poset P) u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-decreasing-is-increasing-sequence-poset = + ( ∞-constant-Σ-subsequence-constant-increasing-sequence-poset P H) ∘ + ( tot + ( (constant-is-increasing-decreasing-sequence-poset P) ∘ + ( increasing-Π-subsequence-increasing-sequence-poset P u H))) +``` + +#### A decreasing sequence in a partially ordered set with an increasing subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + (H : is-decreasing-sequence-poset P u) + where + + ∞-constant-Σ-subsequence-increasing-is-decreasing-sequence-poset : + Σ-subsequence (is-increasing-sequence-poset P) u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-increasing-is-decreasing-sequence-poset = + ( ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset P H) ∘ + ( tot + ( λ v K → + constant-is-increasing-decreasing-sequence-poset + ( P) + ( K) + ( decreasing-Π-subsequence-decreasing-sequence-poset P u H v))) +``` From 020b954a77df7882abeba8e76a98445a520c9eff Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 03:28:30 +0200 Subject: [PATCH 38/67] asymptotical inequality sequences posets --- src/order-theory/sequences-posets.lagda.md | 53 +++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 1686b018ed..7f8ef58bfe 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -7,10 +7,14 @@ module order-theory.sequences-posets where
Imports ```agda +open import elementary-number-theory.maximum-natural-numbers open import elementary-number-theory.natural-numbers +open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotically-equal-sequences open import foundation.binary-relations open import foundation.dependent-pair-types +open import foundation.function-types open import foundation.identity-types open import foundation.propositions open import foundation.sequences @@ -46,8 +50,14 @@ module _ {l1 l2 : Level} (P : Poset l1 l2) (u v : sequence-poset P) where + leq-value-prop-sequence-poset : ℕ → Prop l2 + leq-value-prop-sequence-poset n = leq-Poset-Prop P (u n) (v n) + + leq-value-sequence-poset : ℕ → UU l2 + leq-value-sequence-poset n = type-Prop (leq-value-prop-sequence-poset n) + leq-prop-sequence-poset : Prop l2 - leq-prop-sequence-poset = Π-Prop ℕ (λ n → leq-Poset-Prop P (u n) (v n)) + leq-prop-sequence-poset = Π-Prop ℕ leq-value-prop-sequence-poset leq-sequence-poset : UU l2 leq-sequence-poset = type-Prop leq-prop-sequence-poset @@ -82,3 +92,44 @@ module _ antisymmetric-leq-sequence-poset = antisymmetric-leq-Poset poset-sequence-poset ``` + +### Asymptotical inequality of sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + ∞-leq-sequence-poset : (u v : sequence-poset P) → UU l2 + ∞-leq-sequence-poset u v = asymptotically (leq-value-sequence-poset P u v) + + refl-∞-leq-sequence-poset : is-reflexive ∞-leq-sequence-poset + refl-∞-leq-sequence-poset = asymptotically-Π ∘ (refl-leq-sequence-poset P) + + transitive-∞-leq-sequence-poset : is-transitive ∞-leq-sequence-poset + transitive-∞-leq-sequence-poset u v w (n , H) (m , K) = + ( max-ℕ m n) , + ( λ p I → + transitive-leq-Poset + ( P) + ( u p) + ( v p) + ( w p) + ( H p (leq-right-leq-max-ℕ p m n I)) + ( K p (leq-left-leq-max-ℕ p m n I))) + + ∞-antisymmetric-∞-leq-sequence-poset : + (u v : sequence-poset P) → + ∞-leq-sequence-poset u v → + ∞-leq-sequence-poset v u → + eq-∞-sequence u v + ∞-antisymmetric-∞-leq-sequence-poset u v (n , H) (m , K) = + ( max-ℕ n m) , + ( λ p I → + antisymmetric-leq-Poset + ( P) + ( u p) + ( v p) + ( H p (leq-left-leq-max-ℕ p n m I)) + ( K p (leq-right-leq-max-ℕ p n m I))) +``` From da95b0f04195604c9f3f903bd33438fc9e9fe29f Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 03:49:35 +0200 Subject: [PATCH 39/67] fix name --- src/order-theory/sequences-posets.lagda.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 7f8ef58bfe..76760032f9 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -54,7 +54,7 @@ module _ leq-value-prop-sequence-poset n = leq-Poset-Prop P (u n) (v n) leq-value-sequence-poset : ℕ → UU l2 - leq-value-sequence-poset n = type-Prop (leq-value-prop-sequence-poset n) + leq-value-sequence-poset = type-Prop ∘ leq-value-prop-sequence-poset leq-prop-sequence-poset : Prop l2 leq-prop-sequence-poset = Π-Prop ℕ leq-value-prop-sequence-poset @@ -100,14 +100,14 @@ module _ {l1 l2 : Level} (P : Poset l1 l2) where - ∞-leq-sequence-poset : (u v : sequence-poset P) → UU l2 - ∞-leq-sequence-poset u v = asymptotically (leq-value-sequence-poset P u v) + leq-∞-sequence-poset : (u v : sequence-poset P) → UU l2 + leq-∞-sequence-poset u v = asymptotically (leq-value-sequence-poset P u v) - refl-∞-leq-sequence-poset : is-reflexive ∞-leq-sequence-poset - refl-∞-leq-sequence-poset = asymptotically-Π ∘ (refl-leq-sequence-poset P) + refl-leq-∞-sequence-poset : is-reflexive leq-∞-sequence-poset + refl-leq-∞-sequence-poset = asymptotically-Π ∘ (refl-leq-sequence-poset P) - transitive-∞-leq-sequence-poset : is-transitive ∞-leq-sequence-poset - transitive-∞-leq-sequence-poset u v w (n , H) (m , K) = + transitive-leq-∞-sequence-poset : is-transitive leq-∞-sequence-poset + transitive-leq-∞-sequence-poset u v w (n , H) (m , K) = ( max-ℕ m n) , ( λ p I → transitive-leq-Poset @@ -118,12 +118,12 @@ module _ ( H p (leq-right-leq-max-ℕ p m n I)) ( K p (leq-left-leq-max-ℕ p m n I))) - ∞-antisymmetric-∞-leq-sequence-poset : + antisymmetric-∞-leq-∞-sequence-poset : (u v : sequence-poset P) → - ∞-leq-sequence-poset u v → - ∞-leq-sequence-poset v u → + leq-∞-sequence-poset u v → + leq-∞-sequence-poset v u → eq-∞-sequence u v - ∞-antisymmetric-∞-leq-sequence-poset u v (n , H) (m , K) = + antisymmetric-∞-leq-∞-sequence-poset u v (n , H) (m , K) = ( max-ℕ n m) , ( λ p I → antisymmetric-leq-Poset From 50cae5618120efccbbd9c96de60aca1e72a8b5eb Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 05:01:37 +0200 Subject: [PATCH 40/67] refactor using map-asymptotically --- .../asymptotical-dependent-sequences.lagda.md | 25 +++++++++++++++- .../asymptotically-equal-sequences.lagda.md | 12 ++------ src/order-theory/sequences-posets.lagda.md | 29 ++++++------------- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/foundation/asymptotical-dependent-sequences.lagda.md b/src/foundation/asymptotical-dependent-sequences.lagda.md index 7c820116f7..5cd16ca8e6 100644 --- a/src/foundation/asymptotical-dependent-sequences.lagda.md +++ b/src/foundation/asymptotical-dependent-sequences.lagda.md @@ -13,6 +13,7 @@ open import elementary-number-theory.natural-numbers open import foundation.dependent-pair-types open import foundation.dependent-sequences +open import foundation.function-types open import foundation.functoriality-dependent-pair-types open import foundation.universe-levels ``` @@ -130,5 +131,27 @@ module _ ((n : ℕ) → A n → B n) → asymptotically A → asymptotically B - map-asymptotically-Π H = map-asymptotically (asymptotically-Π H) + map-asymptotically-Π = map-asymptotically ∘ asymptotically-Π +``` + +### Asymptotical binary functorial action on asymptotical dependent sequences + +```agda +module _ + {l1 l2 l3 : Level} {A : ℕ → UU l1} {B : ℕ → UU l2} {C : ℕ → UU l3} + where + + map-binary-asymptotically : + asymptotically (λ n → A n → B n → C n) → + asymptotically A → + asymptotically B → + asymptotically C + map-binary-asymptotically I = map-asymptotically ∘ (map-asymptotically I) + + map-binary-asymptotically-Π : + ((n : ℕ) → A n → B n → C n) → + asymptotically A → + asymptotically B → + asymptotically C + map-binary-asymptotically-Π = map-binary-asymptotically ∘ asymptotically-Π ``` diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index 1703d35064..20f8e9a196 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -78,11 +78,7 @@ module _ where symmetric-eq-∞-sequence : eq-∞-sequence u v → eq-∞-sequence v u - symmetric-eq-∞-sequence = - map-Σ - ( is-modulus-dependent-sequence (λ n → v n = u n)) - ( id) - ( λ N H m K → inv (H m K)) + symmetric-eq-∞-sequence = map-asymptotically-Π (λ n → inv) ``` ### Asymptotical equality is a transitive relation @@ -96,9 +92,5 @@ module _ eq-∞-sequence v w → eq-∞-sequence u v → eq-∞-sequence u w - transitive-eq-∞-sequence (n , H) (m , K) = - ( max-ℕ m n) , - ( λ p I → - ( K p (leq-left-leq-max-ℕ p m n I)) ∙ - ( H p (leq-right-leq-max-ℕ p m n I))) + transitive-eq-∞-sequence = map-binary-asymptotically-Π (λ n I J → J ∙ I) ``` diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 76760032f9..610ea7ce8c 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -7,7 +7,6 @@ module order-theory.sequences-posets where
Imports ```agda -open import elementary-number-theory.maximum-natural-numbers open import elementary-number-theory.natural-numbers open import foundation.asymptotical-dependent-sequences @@ -106,30 +105,20 @@ module _ refl-leq-∞-sequence-poset : is-reflexive leq-∞-sequence-poset refl-leq-∞-sequence-poset = asymptotically-Π ∘ (refl-leq-sequence-poset P) + leq-∞-eq-∞-sequence-poset : + {u v : sequence-poset P} → eq-∞-sequence u v → leq-∞-sequence-poset u v + leq-∞-eq-∞-sequence-poset {u} {v} = + map-asymptotically-Π (λ n → leq-eq-Poset P) + transitive-leq-∞-sequence-poset : is-transitive leq-∞-sequence-poset - transitive-leq-∞-sequence-poset u v w (n , H) (m , K) = - ( max-ℕ m n) , - ( λ p I → - transitive-leq-Poset - ( P) - ( u p) - ( v p) - ( w p) - ( H p (leq-right-leq-max-ℕ p m n I)) - ( K p (leq-left-leq-max-ℕ p m n I))) + transitive-leq-∞-sequence-poset u v w = + map-binary-asymptotically-Π (λ n → transitive-leq-Poset P (u n) (v n) (w n)) antisymmetric-∞-leq-∞-sequence-poset : (u v : sequence-poset P) → leq-∞-sequence-poset u v → leq-∞-sequence-poset v u → eq-∞-sequence u v - antisymmetric-∞-leq-∞-sequence-poset u v (n , H) (m , K) = - ( max-ℕ n m) , - ( λ p I → - antisymmetric-leq-Poset - ( P) - ( u p) - ( v p) - ( H p (leq-left-leq-max-ℕ p n m I)) - ( K p (leq-right-leq-max-ℕ p n m I))) + antisymmetric-∞-leq-∞-sequence-poset u v = + map-binary-asymptotically-Π (λ n → antisymmetric-leq-Poset P (u n) (v n)) ``` From a79ade59576361e3ae93ebcb737b34ae9532f66c Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 05:33:06 +0200 Subject: [PATCH 41/67] asymptotical lemma --- src/order-theory/sequences-posets.lagda.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 610ea7ce8c..f26147bfe2 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -122,3 +122,21 @@ module _ antisymmetric-∞-leq-∞-sequence-poset u v = map-binary-asymptotically-Π (λ n → antisymmetric-leq-Poset P (u n) (v n)) ``` + +### Concatenation of asymptotical inequality and equality of sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u v w : sequence-poset P} + where + + concatenate-eq-∞-leq-∞-sequence-poset : + eq-∞-sequence u v → leq-∞-sequence-poset P v w → leq-∞-sequence-poset P u w + concatenate-eq-∞-leq-∞-sequence-poset = + map-binary-asymptotically-Π (λ n → concatenate-eq-leq-Poset P) + + concatenate-leq-∞-eq-∞-sequence-poset : + leq-∞-sequence-poset P u v → eq-∞-sequence v w → leq-∞-sequence-poset P u w + concatenate-leq-∞-eq-∞-sequence-poset = + map-binary-asymptotically-Π (λ n → concatenate-leq-eq-Poset P) +``` From b213e766603ed94a7a2a3af1892cfc9378d13442 Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 05:36:33 +0200 Subject: [PATCH 42/67] fix typo --- src/order-theory/sequences-posets.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index f26147bfe2..d59086892c 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -31,7 +31,7 @@ can be partially ordered by pointwise comparison. ## Definitions -### Sequences in a partially ordered sets +### Sequences in partially ordered sets ```agda module _ From 5aeb28d180ea81b14d66523cfcb4d672fb39ca06 Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 19:39:53 +0200 Subject: [PATCH 43/67] guarded asymptotical lemma sequences posets --- ...notonic-sequences-natural-numbers.lagda.md | 2 +- ...asymptotically-constant-sequences.lagda.md | 28 +-- .../asymptotically-equal-sequences.lagda.md | 12 +- .../monotonic-sequences-posets.lagda.md | 4 +- src/order-theory/sequences-posets.lagda.md | 162 ++++++++++++++++++ 5 files changed, 187 insertions(+), 21 deletions(-) diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index e5c6625112..55919d197e 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -185,7 +185,7 @@ module _ asymptotically (λ n → ¬ (is-strict-decreasing-value-sequence-ℕ f n)) → is-∞-constant-sequence f ∞-constant-∞-no-strict-value-decreasing-sequence-ℕ = - ( is-∞-constant-is-∞-stationnary-sequence f) ∘ + ( ∞-constant-is-∞-stationnary-sequence f) ∘ ( map-asymptotically-Π ( stationnary-value-is-not-strict-value-decreasing-sequence-ℕ f H)) ``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index c80e1ac6e4..e3cd0bdfe8 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -136,9 +136,9 @@ module _ {l : Level} {A : UU l} (x : A) (u : sequence A) where - is-∞-constant-eq-∞-constant-sequence : + ∞-constant-eq-∞-constant-sequence : (eq-∞-sequence (const-sequence x) u) → is-∞-constant-sequence u - is-∞-constant-eq-∞-constant-sequence H = + ∞-constant-eq-∞-constant-sequence H = ( modulus-eq-∞-sequence H) , ( λ p I → ( ( modulus-eq-∞-sequence H) , @@ -167,9 +167,9 @@ module _ ( n) ( I)))) - is-∞-constant-Π-subsequence : Π-subsequence is-∞-constant-sequence u - is-∞-constant-Π-subsequence v = - is-∞-constant-eq-∞-constant-sequence + ∞-constant-Π-subsequence : Π-subsequence is-∞-constant-sequence u + ∞-constant-Π-subsequence v = + ∞-constant-eq-∞-constant-sequence ( ∞-value-∞-constant-sequence H) ( sequence-subsequence u v) ( eq-∞-value-∞-constant-Π-subsequence v) @@ -185,7 +185,7 @@ module _ preserves-∞-constant-eq-∞-sequence : is-∞-constant-sequence u → is-∞-constant-sequence v preserves-∞-constant-eq-∞-sequence K = - is-∞-constant-eq-∞-constant-sequence + ∞-constant-eq-∞-constant-sequence ( ∞-value-∞-constant-sequence K) ( v) ( transitive-eq-∞-sequence @@ -228,18 +228,18 @@ module _ {l : Level} {A : UU l} (u : sequence A) where - is-∞-constant-is-∞-stationnary-sequence : + ∞-constant-is-∞-stationnary-sequence : is-∞-stationnary-sequence u → is-∞-constant-sequence u - is-∞-constant-is-∞-stationnary-sequence H = - is-∞-constant-eq-∞-constant-sequence + ∞-constant-is-∞-stationnary-sequence H = + ∞-constant-eq-∞-constant-sequence ( u (modulus-∞-asymptotically H)) ( u) ( ( modulus-∞-asymptotically H) , ( is-∞-constant-modulus-is-∞-stationnary-sequence u H)) - is-∞-stationnary-is-∞-constant-sequence : + ∞-stationnary-is-∞-constant-sequence : is-∞-constant-sequence u → is-∞-stationnary-sequence u - is-∞-stationnary-is-∞-constant-sequence H = + ∞-stationnary-is-∞-constant-sequence H = ( ( modulus-∞-value-∞-constant-sequence H) , ( λ n I → ( inv (is-modulus-∞-value-∞-constant-sequence H n I)) ∙ @@ -272,10 +272,10 @@ module _ ( u) ( eq-∞-value-∞-constant-sequence H)) - is-∞-constant-eq-∞-sequence-subsequence : + ∞-constant-eq-∞-sequence-subsequence : Π-subsequence (eq-∞-sequence u) u → is-∞-constant-sequence u - is-∞-constant-eq-∞-sequence-subsequence H = - is-∞-constant-is-∞-stationnary-sequence + ∞-constant-eq-∞-sequence-subsequence H = + ∞-constant-is-∞-stationnary-sequence ( u) ( H (skip-zero-sequence u)) ``` diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index 20f8e9a196..d0240c8162 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -62,12 +62,16 @@ module _ ```agda module _ - {l : Level} {A : UU l} (u : sequence A) + {l : Level} {A : UU l} where - refl-eq-∞-sequence : eq-∞-sequence u u - pr1 refl-eq-∞-sequence = zero-ℕ - pr2 refl-eq-∞-sequence m H = refl + refl-eq-∞-sequence : (u : sequence A) → eq-∞-sequence u u + pr1 (refl-eq-∞-sequence u) = zero-ℕ + pr2 (refl-eq-∞-sequence u) m H = refl + + eq-∞-eq-sequence : + {u v : sequence A} → ((n : ℕ) → (u n) = v n) → eq-∞-sequence u v + eq-∞-eq-sequence {u} {v} I = (zero-ℕ , λ n H → I n) ``` ### Asymptotical equality is a symmetric relation diff --git a/src/order-theory/monotonic-sequences-posets.lagda.md b/src/order-theory/monotonic-sequences-posets.lagda.md index b3235c946d..75117223a6 100644 --- a/src/order-theory/monotonic-sequences-posets.lagda.md +++ b/src/order-theory/monotonic-sequences-posets.lagda.md @@ -345,7 +345,7 @@ module _ ∞-constant-Σ-subsequence-constant-increasing-sequence-poset H = rec-Σ ( λ v K → - is-∞-constant-eq-∞-constant-sequence + ∞-constant-eq-∞-constant-sequence ( u (extract-subsequence u v zero-ℕ)) ( u) ( ( extract-subsequence u v zero-ℕ) , @@ -370,7 +370,7 @@ module _ ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset H = rec-Σ ( λ v K → - is-∞-constant-eq-∞-constant-sequence + ∞-constant-eq-∞-constant-sequence ( u (extract-subsequence u v zero-ℕ)) ( u) ( ( extract-subsequence u v zero-ℕ) , diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index d59086892c..d3b8efa294 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -10,8 +10,10 @@ module order-theory.sequences-posets where open import elementary-number-theory.natural-numbers open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotically-constant-sequences open import foundation.asymptotically-equal-sequences open import foundation.binary-relations +open import foundation.constant-sequences open import foundation.dependent-pair-types open import foundation.function-types open import foundation.identity-types @@ -121,6 +123,12 @@ module _ eq-∞-sequence u v antisymmetric-∞-leq-∞-sequence-poset u v = map-binary-asymptotically-Π (λ n → antisymmetric-leq-Poset P (u n) (v n)) + + leq-∞-leq-sequence-poset : + {u v : sequence-poset P} → + leq-sequence-poset P u v → + leq-∞-sequence-poset u v + leq-∞-leq-sequence-poset = asymptotically-Π ``` ### Concatenation of asymptotical inequality and equality of sequences in partially ordered sets @@ -139,4 +147,158 @@ module _ leq-∞-sequence-poset P u v → eq-∞-sequence v w → leq-∞-sequence-poset P u w concatenate-leq-∞-eq-∞-sequence-poset = map-binary-asymptotically-Π (λ n → concatenate-leq-eq-Poset P) + +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u v w z : sequence-poset P} + where + + concatenate-eq-∞-leq-∞-eq-∞-sequence-poset : + eq-∞-sequence u v → + leq-∞-sequence-poset P v w → + eq-∞-sequence w z → + leq-∞-sequence-poset P u z + concatenate-eq-∞-leq-∞-eq-∞-sequence-poset I = + map-binary-asymptotically + ( map-asymptotically-Π + ( λ n H J K → + concatenate-eq-leq-Poset + ( P) + ( H) + ( concatenate-leq-eq-Poset P J K)) + ( I)) +``` + +## Properties + +### Asymptotical values preserves asymptotical inequality of sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u v : sequence-poset P) + (I : leq-∞-sequence-poset P u v) + where + + leq-∞-left-leq-∞-constant-sequence-poset : + (H : is-∞-constant-sequence u) → + leq-∞-sequence-poset P (const-∞-value-∞-constant-sequence H) v + leq-∞-left-leq-∞-constant-sequence-poset H = + concatenate-eq-∞-leq-∞-sequence-poset + ( P) + ( eq-∞-value-∞-constant-sequence H) + ( I) + + leq-∞-right-leq-∞-constant-sequence-poset : + (H : is-∞-constant-sequence v) → + leq-∞-sequence-poset P u (const-∞-value-∞-constant-sequence H) + leq-∞-right-leq-∞-constant-sequence-poset H = + concatenate-leq-∞-eq-∞-sequence-poset + ( P) + ( I) + ( symmetric-eq-∞-sequence + ( const-∞-value-∞-constant-sequence H) + ( v) + ( eq-∞-value-∞-constant-sequence H)) + + leq-∞-value-leq-∞-constant-sequence-poset : + (H : is-∞-constant-sequence u) → + (K : is-∞-constant-sequence v) → + leq-Poset P (∞-value-∞-constant-sequence H) (∞-value-∞-constant-sequence K) + leq-∞-value-leq-∞-constant-sequence-poset H K = + value-∞-asymptotically + (concatenate-eq-∞-leq-∞-eq-∞-sequence-poset + ( P) + ( eq-∞-value-∞-constant-sequence H) + ( I) + ( symmetric-eq-∞-sequence + ( const-∞-value-∞-constant-sequence K) + ( v) + ( eq-∞-value-∞-constant-sequence K))) +``` + +### A sequence in a partially ordered set that asymptotically lies between two asymptotically equal sequences is asymptotically equal to them + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u v w : sequence-poset P) + (I : leq-∞-sequence-poset P u v) (J : leq-∞-sequence-poset P v w) + (E : eq-∞-sequence w u) + where + + left-eq-∞-guarded-sequence-poset : eq-∞-sequence u v + left-eq-∞-guarded-sequence-poset = + antisymmetric-∞-leq-∞-sequence-poset + ( P) + ( u) + ( v) + ( I) + ( concatenate-leq-∞-eq-∞-sequence-poset P J E) + + right-eq-∞-guarded-sequence-poset : eq-∞-sequence v w + right-eq-∞-guarded-sequence-poset = + antisymmetric-∞-leq-∞-sequence-poset + ( P) + ( v) + ( w) + ( J) + ( concatenate-eq-∞-leq-∞-sequence-poset P E I) +``` + +### A sequence in a partially ordered that asymptotically lies between two asymptotically constant sequences with the same asymptotical value is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u v w : sequence-poset P) + (I : leq-∞-sequence-poset P u v) (J : leq-∞-sequence-poset P v w) + (H : is-∞-constant-sequence u) (K : is-∞-constant-sequence w) + where + + ∞-constant-eq-∞-value-guarded-sequence-poset : + Id + (∞-value-∞-constant-sequence K) + (∞-value-∞-constant-sequence H) → + is-∞-constant-sequence v + ∞-constant-eq-∞-value-guarded-sequence-poset E = + ∞-constant-eq-∞-constant-sequence + ( ∞-value-∞-constant-sequence H) + ( v) + ( antisymmetric-∞-leq-∞-sequence-poset + ( P) + ( const-∞-value-∞-constant-sequence H) + ( v) + ( concatenate-eq-∞-leq-∞-sequence-poset + ( P) + ( eq-∞-value-∞-constant-sequence H) + ( I)) + ( concatenate-leq-∞-eq-∞-sequence-poset + ( P) + ( J) + ( transitive-eq-∞-sequence + ( w) + ( const-∞-value-∞-constant-sequence K) + ( const-∞-value-∞-constant-sequence H) + ( eq-∞-eq-sequence (λ n → E)) + ( symmetric-eq-∞-sequence + ( const-∞-value-∞-constant-sequence K) + ( w) + ( eq-∞-value-∞-constant-sequence K))))) + + ∞-constant-leq-∞-value-guarded-sequence-poset : + leq-Poset P + (∞-value-∞-constant-sequence K) + (∞-value-∞-constant-sequence H) → + is-∞-constant-sequence v + ∞-constant-leq-∞-value-guarded-sequence-poset E = + ∞-constant-eq-∞-value-guarded-sequence-poset + ( antisymmetric-leq-Poset + ( P) + ( ∞-value-∞-constant-sequence K) + ( ∞-value-∞-constant-sequence H) + ( E) + ( leq-∞-value-leq-∞-constant-sequence-poset + ( P) + ( u) + ( w) + ( transitive-leq-∞-sequence-poset P u v w J I) + ( H) + ( K))) ``` From 7b087255994656dad26468d04d76203585694c50 Mon Sep 17 00:00:00 2001 From: malarbol Date: Sat, 1 Jun 2024 20:18:08 +0200 Subject: [PATCH 44/67] cleanup --- src/order-theory/sequences-posets.lagda.md | 44 ++++++++++++---------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index d3b8efa294..813995b653 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -157,15 +157,11 @@ module _ leq-∞-sequence-poset P v w → eq-∞-sequence w z → leq-∞-sequence-poset P u z - concatenate-eq-∞-leq-∞-eq-∞-sequence-poset I = - map-binary-asymptotically - ( map-asymptotically-Π - ( λ n H J K → - concatenate-eq-leq-Poset - ( P) - ( H) - ( concatenate-leq-eq-Poset P J K)) - ( I)) + concatenate-eq-∞-leq-∞-eq-∞-sequence-poset = + ( map-binary-asymptotically) ∘ + ( map-asymptotically-Π + ( λ n H J → + (concatenate-eq-leq-Poset P H) ∘ (concatenate-leq-eq-Poset P J))) ``` ## Properties @@ -202,17 +198,25 @@ module _ leq-∞-value-leq-∞-constant-sequence-poset : (H : is-∞-constant-sequence u) → (K : is-∞-constant-sequence v) → - leq-Poset P (∞-value-∞-constant-sequence H) (∞-value-∞-constant-sequence K) + leq-∞-sequence-poset P + (const-∞-value-∞-constant-sequence H) + (const-∞-value-∞-constant-sequence K) leq-∞-value-leq-∞-constant-sequence-poset H K = - value-∞-asymptotically - (concatenate-eq-∞-leq-∞-eq-∞-sequence-poset - ( P) - ( eq-∞-value-∞-constant-sequence H) - ( I) - ( symmetric-eq-∞-sequence - ( const-∞-value-∞-constant-sequence K) - ( v) - ( eq-∞-value-∞-constant-sequence K))) + concatenate-eq-∞-leq-∞-eq-∞-sequence-poset + ( P) + ( eq-∞-value-∞-constant-sequence H) + ( I) + ( symmetric-eq-∞-sequence + ( const-∞-value-∞-constant-sequence K) + ( v) + ( eq-∞-value-∞-constant-sequence K)) + + leq-value-leq-∞-constant-sequence-poset : + (H : is-∞-constant-sequence u) → + (K : is-∞-constant-sequence v) → + leq-Poset P (∞-value-∞-constant-sequence H) (∞-value-∞-constant-sequence K) + leq-value-leq-∞-constant-sequence-poset H K = + value-∞-asymptotically (leq-∞-value-leq-∞-constant-sequence-poset H K) ``` ### A sequence in a partially ordered set that asymptotically lies between two asymptotically equal sequences is asymptotically equal to them @@ -294,7 +298,7 @@ module _ ( ∞-value-∞-constant-sequence K) ( ∞-value-∞-constant-sequence H) ( E) - ( leq-∞-value-leq-∞-constant-sequence-poset + ( leq-value-leq-∞-constant-sequence-poset ( P) ( u) ( w) From 7c1642483003c9ecc68b59c05dc5f24b5c7716e1 Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 01:37:01 +0200 Subject: [PATCH 45/67] WIP cleanup --- ...asymptotically-constant-sequences.lagda.md | 28 +++++++++++++++ .../asymptotically-equal-sequences.lagda.md | 35 +++++++++++++++++++ src/order-theory/sequences-posets.lagda.md | 27 +++----------- 3 files changed, 67 insertions(+), 23 deletions(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index e3cd0bdfe8..6650832ed7 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -148,6 +148,34 @@ module _ ( is-modulus-eq-∞-sequence H q J)))) ``` +### Two asymptotically constant sequences are asymptotically equal if and only if their asymptotical value is the same + +```agda +module _ + {l : Level} {A : UU l} (u v : sequence A) + (H : is-∞-constant-sequence u) (K : is-∞-constant-sequence v) + where + + eq-∞-sequence-eq-∞-value-∞-constant-sequence : + (∞-value-∞-constant-sequence H) = (∞-value-∞-constant-sequence K) → + eq-∞-sequence u v + eq-∞-sequence-eq-∞-value-∞-constant-sequence I = + conjugate-eq-∞-sequence + ( eq-∞-value-∞-constant-sequence H) + ( eq-∞-value-∞-constant-sequence K) + ( asymptotically-Π (λ n → I)) + + eq-∞-value-eq-∞-sequence-∞-constant-sequence : + eq-∞-sequence u v → + (∞-value-∞-constant-sequence H) = (∞-value-∞-constant-sequence K) + eq-∞-value-eq-∞-sequence-∞-constant-sequence I = + value-∞-asymptotically + ( conjugate-eq-∞-sequence' + ( eq-∞-value-∞-constant-sequence H) + ( eq-∞-value-∞-constant-sequence K) + ( I)) +``` + ### Any subsequence of an asymptotically constant sequence is asymptotically constant ```agda diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index d0240c8162..219f2dfdac 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -83,6 +83,13 @@ module _ symmetric-eq-∞-sequence : eq-∞-sequence u v → eq-∞-sequence v u symmetric-eq-∞-sequence = map-asymptotically-Π (λ n → inv) + +module _ + {l : Level} {A : UU l} {u v : sequence A} + where + + inv-eq-∞-sequence : eq-∞-sequence u v → eq-∞-sequence v u + inv-eq-∞-sequence = symmetric-eq-∞-sequence u v ``` ### Asymptotical equality is a transitive relation @@ -98,3 +105,31 @@ module _ eq-∞-sequence u w transitive-eq-∞-sequence = map-binary-asymptotically-Π (λ n I J → J ∙ I) ``` + +### conjunction-Propugation of asymptotical equality + +```agda +module _ + {l : Level} {A : UU l} {u u' v v' : sequence A} + where + + conjugate-eq-∞-sequence : + eq-∞-sequence u u' → + eq-∞-sequence v v' → + eq-∞-sequence u v → + eq-∞-sequence u' v' + conjugate-eq-∞-sequence H K I = + transitive-eq-∞-sequence u' u v' + ( transitive-eq-∞-sequence u v v' K I) + ( inv-eq-∞-sequence H) + + conjugate-eq-∞-sequence' : + eq-∞-sequence u u' → + eq-∞-sequence v v' → + eq-∞-sequence u' v' → + eq-∞-sequence u v + conjugate-eq-∞-sequence' H K I = + transitive-eq-∞-sequence u u' v + ( transitive-eq-∞-sequence u' v' v (inv-eq-∞-sequence K) I) + ( H) +``` diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 813995b653..13116975a7 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -262,29 +262,10 @@ module _ (∞-value-∞-constant-sequence H) → is-∞-constant-sequence v ∞-constant-eq-∞-value-guarded-sequence-poset E = - ∞-constant-eq-∞-constant-sequence - ( ∞-value-∞-constant-sequence H) - ( v) - ( antisymmetric-∞-leq-∞-sequence-poset - ( P) - ( const-∞-value-∞-constant-sequence H) - ( v) - ( concatenate-eq-∞-leq-∞-sequence-poset - ( P) - ( eq-∞-value-∞-constant-sequence H) - ( I)) - ( concatenate-leq-∞-eq-∞-sequence-poset - ( P) - ( J) - ( transitive-eq-∞-sequence - ( w) - ( const-∞-value-∞-constant-sequence K) - ( const-∞-value-∞-constant-sequence H) - ( eq-∞-eq-sequence (λ n → E)) - ( symmetric-eq-∞-sequence - ( const-∞-value-∞-constant-sequence K) - ( w) - ( eq-∞-value-∞-constant-sequence K))))) + preserves-∞-constant-eq-∞-sequence u v + ( left-eq-∞-guarded-sequence-poset P u v w I J + ( eq-∞-sequence-eq-∞-value-∞-constant-sequence w u K H E)) + ( H) ∞-constant-leq-∞-value-guarded-sequence-poset : leq-Poset P From c6465878bcd1d7426f6fbb5a9554e5e45e20580c Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 03:44:22 +0200 Subject: [PATCH 46/67] paren --- .../strict-monotonic-sequences-natural-numbers.lagda.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md index 8f03ce6b5f..85f61ff146 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -246,8 +246,8 @@ module _ preserves-leq-strict-increasing-sequence-ℕ : leq-ℕ p q → leq-ℕ - ( sequence-strict-increasing-sequence-ℕ f p) - ( sequence-strict-increasing-sequence-ℕ f q) + (sequence-strict-increasing-sequence-ℕ f p) + (sequence-strict-increasing-sequence-ℕ f q) preserves-leq-strict-increasing-sequence-ℕ = ( leq-eq-or-le-ℕ (sequence-strict-increasing-sequence-ℕ f p) @@ -268,7 +268,7 @@ is-strict-increasing-id-ℕ : is-strict-increasing-sequence-ℕ id is-strict-increasing-id-ℕ i j = id strict-increasing-id-ℕ : strict-increasing-sequence-ℕ -strict-increasing-id-ℕ = id , is-strict-increasing-id-ℕ +strict-increasing-id-ℕ = (id , is-strict-increasing-id-ℕ) ``` ### The identity sequence is lesser than all strictly increasing sequences of natural numbers From a53663fa289645d8ab9241042229481b53c3509a Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 20:18:41 +0200 Subject: [PATCH 47/67] fix name and cleanup --- ...notonic-sequences-natural-numbers.lagda.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md index 85f61ff146..c0850db988 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -15,9 +15,6 @@ open import elementary-number-theory.strict-inequality-natural-numbers open import foundation.action-on-identifications-functions open import foundation.asymptotical-dependent-sequences -open import foundation.cartesian-product-types -open import foundation.constant-sequences -open import foundation.coproduct-types open import foundation.dependent-pair-types open import foundation.empty-types open import foundation.function-types @@ -194,23 +191,23 @@ module _ ### There exist no strictly decreasing sequences of natural numbers ```agda -no-strict-decreasing-sequence-leq-ℕ : +no-bounded-strict-decreasing-sequence-ℕ : (f : sequence ℕ) → (N : ℕ) → - is-strict-decreasing-sequence-ℕ f → leq-ℕ (f zero-ℕ) N → + is-strict-decreasing-sequence-ℕ f → empty -no-strict-decreasing-sequence-leq-ℕ f zero-ℕ H = +no-bounded-strict-decreasing-sequence-ℕ f zero-ℕ K H = concatenate-le-leq-ℕ { f 1} { f 0} { 0} ( H 0 1 (succ-le-ℕ 0)) -no-strict-decreasing-sequence-leq-ℕ f (succ-ℕ N) H K = - no-strict-decreasing-sequence-leq-ℕ + ( K) +no-bounded-strict-decreasing-sequence-ℕ f (succ-ℕ N) K H = + no-bounded-strict-decreasing-sequence-ℕ ( f ∘ succ-ℕ) ( N) - ( λ i j → H (succ-ℕ i) (succ-ℕ j)) ( leq-le-succ-ℕ ( f 1) ( N) @@ -220,14 +217,15 @@ no-strict-decreasing-sequence-leq-ℕ f (succ-ℕ N) H K = { succ-ℕ N} ( H 0 1 (succ-le-ℕ 0)) ( K))) + ( λ i j → H (succ-ℕ i) (succ-ℕ j)) module _ (f : sequence ℕ) where no-strict-decreasing-sequence-ℕ : ¬ (is-strict-decreasing-sequence-ℕ f) - no-strict-decreasing-sequence-ℕ H = - no-strict-decreasing-sequence-leq-ℕ f (f 0) H (refl-leq-ℕ (f 0)) + no-strict-decreasing-sequence-ℕ = + no-bounded-strict-decreasing-sequence-ℕ f (f 0) (refl-leq-ℕ (f 0)) no-strict-decreasing-value-sequence-ℕ : ¬ ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) From 605bf173abef76c135cb98c81d9a7352d78dd486 Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 20:31:24 +0200 Subject: [PATCH 48/67] fix paren --- src/foundation/asymptotically-equal-sequences.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index 219f2dfdac..cd8667dc6f 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -70,7 +70,7 @@ module _ pr2 (refl-eq-∞-sequence u) m H = refl eq-∞-eq-sequence : - {u v : sequence A} → ((n : ℕ) → (u n) = v n) → eq-∞-sequence u v + {u v : sequence A} → ((n : ℕ) → u n = v n) → eq-∞-sequence u v eq-∞-eq-sequence {u} {v} I = (zero-ℕ , λ n H → I n) ``` From 711ebffadbb6de4a4c8417f372379a1896829a76 Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 20:44:02 +0200 Subject: [PATCH 49/67] refactor and fix typo --- .../asymptotically-constant-sequences.lagda.md | 10 ++++++---- .../asymptotically-equal-sequences.lagda.md | 2 +- src/order-theory/sequences-posets.lagda.md | 16 ++++------------ 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 6650832ed7..1bce903132 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -127,6 +127,11 @@ module _ eq-∞-value-∞-constant-sequence = ( modulus-∞-value-∞-constant-sequence H) , ( is-modulus-∞-value-∞-constant-sequence H) + + eq-∞-value-∞-constant-sequence' : + eq-∞-sequence u (const-∞-value-∞-constant-sequence H) + eq-∞-value-∞-constant-sequence' = + inv-eq-∞-sequence eq-∞-value-∞-constant-sequence ``` ### A sequence is asymptotically constant if it is asymptotically equal to some constant sequence @@ -295,10 +300,7 @@ module _ ( const-∞-value-∞-constant-sequence H) ( sequence-subsequence u v) ( eq-∞-value-∞-constant-Π-subsequence u H v) - ( symmetric-eq-∞-sequence - ( const-∞-value-∞-constant-sequence H) - ( u) - ( eq-∞-value-∞-constant-sequence H)) + ( eq-∞-value-∞-constant-sequence' H) ∞-constant-eq-∞-sequence-subsequence : Π-subsequence (eq-∞-sequence u) u → is-∞-constant-sequence u diff --git a/src/foundation/asymptotically-equal-sequences.lagda.md b/src/foundation/asymptotically-equal-sequences.lagda.md index cd8667dc6f..4b5d525437 100644 --- a/src/foundation/asymptotically-equal-sequences.lagda.md +++ b/src/foundation/asymptotically-equal-sequences.lagda.md @@ -106,7 +106,7 @@ module _ transitive-eq-∞-sequence = map-binary-asymptotically-Π (λ n I J → J ∙ I) ``` -### conjunction-Propugation of asymptotical equality +### Conjugation of asymptotical equality ```agda module _ diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 13116975a7..4c7ce22552 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -186,14 +186,9 @@ module _ leq-∞-right-leq-∞-constant-sequence-poset : (H : is-∞-constant-sequence v) → leq-∞-sequence-poset P u (const-∞-value-∞-constant-sequence H) - leq-∞-right-leq-∞-constant-sequence-poset H = - concatenate-leq-∞-eq-∞-sequence-poset - ( P) - ( I) - ( symmetric-eq-∞-sequence - ( const-∞-value-∞-constant-sequence H) - ( v) - ( eq-∞-value-∞-constant-sequence H)) + leq-∞-right-leq-∞-constant-sequence-poset = + ( concatenate-leq-∞-eq-∞-sequence-poset P I) ∘ + ( eq-∞-value-∞-constant-sequence') leq-∞-value-leq-∞-constant-sequence-poset : (H : is-∞-constant-sequence u) → @@ -206,10 +201,7 @@ module _ ( P) ( eq-∞-value-∞-constant-sequence H) ( I) - ( symmetric-eq-∞-sequence - ( const-∞-value-∞-constant-sequence K) - ( v) - ( eq-∞-value-∞-constant-sequence K)) + ( eq-∞-value-∞-constant-sequence' K) leq-value-leq-∞-constant-sequence-poset : (H : is-∞-constant-sequence u) → From 78097ddabd416a478c28fedec1baa7b434dd347d Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 21:07:43 +0200 Subject: [PATCH 50/67] rename and add wikipedia ref --- src/order-theory/sequences-posets.lagda.md | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 4c7ce22552..0bfe935b8a 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -220,8 +220,8 @@ module _ (E : eq-∞-sequence w u) where - left-eq-∞-guarded-sequence-poset : eq-∞-sequence u v - left-eq-∞-guarded-sequence-poset = + left-eq-∞-squeeze-sequence-poset : eq-∞-sequence u v + left-eq-∞-squeeze-sequence-poset = antisymmetric-∞-leq-∞-sequence-poset ( P) ( u) @@ -229,8 +229,8 @@ module _ ( I) ( concatenate-leq-∞-eq-∞-sequence-poset P J E) - right-eq-∞-guarded-sequence-poset : eq-∞-sequence v w - right-eq-∞-guarded-sequence-poset = + right-eq-∞-squeeze-sequence-poset : eq-∞-sequence v w + right-eq-∞-squeeze-sequence-poset = antisymmetric-∞-leq-∞-sequence-poset ( P) ( v) @@ -248,24 +248,24 @@ module _ (H : is-∞-constant-sequence u) (K : is-∞-constant-sequence w) where - ∞-constant-eq-∞-value-guarded-sequence-poset : + ∞-constant-eq-∞-value-squeeze-sequence-poset : Id (∞-value-∞-constant-sequence K) (∞-value-∞-constant-sequence H) → is-∞-constant-sequence v - ∞-constant-eq-∞-value-guarded-sequence-poset E = + ∞-constant-eq-∞-value-squeeze-sequence-poset E = preserves-∞-constant-eq-∞-sequence u v - ( left-eq-∞-guarded-sequence-poset P u v w I J + ( left-eq-∞-squeeze-sequence-poset P u v w I J ( eq-∞-sequence-eq-∞-value-∞-constant-sequence w u K H E)) ( H) - ∞-constant-leq-∞-value-guarded-sequence-poset : + ∞-constant-leq-∞-value-squeeze-sequence-poset : leq-Poset P (∞-value-∞-constant-sequence K) (∞-value-∞-constant-sequence H) → is-∞-constant-sequence v - ∞-constant-leq-∞-value-guarded-sequence-poset E = - ∞-constant-eq-∞-value-guarded-sequence-poset + ∞-constant-leq-∞-value-squeeze-sequence-poset E = + ∞-constant-eq-∞-value-squeeze-sequence-poset ( antisymmetric-leq-Poset ( P) ( ∞-value-∞-constant-sequence K) @@ -279,3 +279,8 @@ module _ ( H) ( K))) ``` + +## External links + +- The [squeeze theorem](https://en.wikipedia.org/wiki/Squeeze_theorem) at + Wikipedia From 69855f62a2382413b2439b292d07af715ea0c20a Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 21:16:07 +0200 Subject: [PATCH 51/67] fix name --- src/foundation/subsequences.lagda.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 7ace77402b..5f76977095 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -137,11 +137,11 @@ module _ sub-subsequence : subsequence u sub-subsequence = comp-strict-increasing-sequence-ℕ v w - eq-sub-subsequence : + compute-sub-subsequence : Id (sequence-subsequence u sub-subsequence) (sequence-subsequence (sequence-subsequence u v) w) - eq-sub-subsequence = refl + compute-sub-subsequence = refl ``` ### Subsequences are functorial From 119e759d8f36b5ba76eec95a9ce1fec0831704f0 Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 21:24:55 +0200 Subject: [PATCH 52/67] fix typo --- src/order-theory/monotonic-sequences-posets.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/order-theory/monotonic-sequences-posets.lagda.md b/src/order-theory/monotonic-sequences-posets.lagda.md index 75117223a6..f8ee14d7a5 100644 --- a/src/order-theory/monotonic-sequences-posets.lagda.md +++ b/src/order-theory/monotonic-sequences-posets.lagda.md @@ -292,7 +292,7 @@ module _ H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) ``` -### A monotonic sequence `u` with `u (p + n) = u p` is constant between `n` and `p + n` +### A monotonic sequence `u` with `u (p + n) = u n` is constant between `n` and `p + n` ```agda module _ From e3aafac1e0de8798521b857142c60ca37acabe0e Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 21:32:12 +0200 Subject: [PATCH 53/67] remove eq-sequence --- src/foundation/sequences.lagda.md | 13 ------------- src/order-theory/sequences-posets.lagda.md | 3 ++- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/foundation/sequences.lagda.md b/src/foundation/sequences.lagda.md index e06d8e1bde..53f07d5c44 100644 --- a/src/foundation/sequences.lagda.md +++ b/src/foundation/sequences.lagda.md @@ -10,8 +10,6 @@ module foundation.sequences where open import elementary-number-theory.natural-numbers open import foundation.dependent-sequences -open import foundation.function-extensionality -open import foundation.identity-types open import foundation.universe-levels open import foundation-core.function-types @@ -39,14 +37,3 @@ map-sequence : {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A → B) → sequence A → sequence B map-sequence f a = f ∘ a ``` - -### Equality of sequences - -```agda -module _ - {l : Level} {A : UU l} (u v : sequence A) - where - - eq-sequence : ((n : ℕ) → u n = v n) → u = v - eq-sequence = eq-htpy -``` diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 0bfe935b8a..849a969eeb 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -15,6 +15,7 @@ open import foundation.asymptotically-equal-sequences open import foundation.binary-relations open import foundation.constant-sequences open import foundation.dependent-pair-types +open import foundation.function-extensionality open import foundation.function-types open import foundation.identity-types open import foundation.propositions @@ -81,7 +82,7 @@ module _ pr2 (pr2 (pr2 (pr1 poset-sequence-poset))) u v w J I n = transitive-leq-Poset P (u n) (v n) (w n) (J n) (I n) pr2 poset-sequence-poset u v I J = - eq-sequence u v (λ n → antisymmetric-leq-Poset P (u n) (v n) (I n) (J n)) + eq-htpy (λ n → antisymmetric-leq-Poset P (u n) (v n) (I n) (J n)) refl-leq-sequence-poset : is-reflexive (leq-sequence-poset P) refl-leq-sequence-poset = refl-leq-Poset poset-sequence-poset From 21ca62e9640d37c65c7e2ac9395d908950eee7f7 Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 21:35:01 +0200 Subject: [PATCH 54/67] remove unused import --- src/foundation/sequences.lagda.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/foundation/sequences.lagda.md b/src/foundation/sequences.lagda.md index 53f07d5c44..5a8b9fa482 100644 --- a/src/foundation/sequences.lagda.md +++ b/src/foundation/sequences.lagda.md @@ -7,8 +7,6 @@ module foundation.sequences where
Imports ```agda -open import elementary-number-theory.natural-numbers - open import foundation.dependent-sequences open import foundation.universe-levels From b1c4164aa81a46438b4b7945d34e29aeb2908726 Mon Sep 17 00:00:00 2001 From: malarbol Date: Wed, 5 Jun 2024 21:39:43 +0200 Subject: [PATCH 55/67] fix typo --- src/order-theory/sequences-posets.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index 849a969eeb..a4c5f91a5e 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -167,7 +167,7 @@ module _ ## Properties -### Asymptotical values preserves asymptotical inequality of sequences in partially ordered sets +### Asymptotical values preserve asymptotical inequality of sequences in partially ordered sets ```agda module _ From a21b40092a8f0ebb275454daf88dd247002a8a64 Mon Sep 17 00:00:00 2001 From: malarbol Date: Fri, 7 Jun 2024 03:21:02 +0200 Subject: [PATCH 56/67] refactor unbounded strict increasing sequencees --- ...notonic-sequences-natural-numbers.lagda.md | 105 ++++++++++-------- src/foundation/subsequences.lagda.md | 17 +-- 2 files changed, 66 insertions(+), 56 deletions(-) diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md index c0850db988..12f07b4f48 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md @@ -151,16 +151,16 @@ module _ (f : sequence ℕ) where - is-strict-increasing-value-is-strict-increasing-sequence-ℕ : + strict-increasing-value-is-strict-increasing-sequence-ℕ : is-strict-increasing-sequence-ℕ f → ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) - is-strict-increasing-value-is-strict-increasing-sequence-ℕ H n = + strict-increasing-value-is-strict-increasing-sequence-ℕ H n = H n (succ-ℕ n) (succ-le-ℕ n) - is-strict-increasing-is-strict-increasing-value-sequence-ℕ : + strict-increasing-is-strict-increasing-value-sequence-ℕ : ((n : ℕ) → is-strict-increasing-value-sequence-ℕ f n) → is-strict-increasing-sequence-ℕ f - is-strict-increasing-is-strict-increasing-value-sequence-ℕ H p q I = + strict-increasing-is-strict-increasing-value-sequence-ℕ H p q I = based-ind-ℕ ( succ-ℕ p) ( λ k → le-ℕ (f p) (f k)) @@ -169,16 +169,16 @@ module _ ( q) ( leq-succ-le-ℕ p q I) - is-strict-decreasing-value-is-strict-decreasing-sequence-ℕ : + strict-decreasing-value-is-strict-decreasing-sequence-ℕ : is-strict-decreasing-sequence-ℕ f → ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) - is-strict-decreasing-value-is-strict-decreasing-sequence-ℕ H n = + strict-decreasing-value-is-strict-decreasing-sequence-ℕ H n = H n (succ-ℕ n) (succ-le-ℕ n) - is-strict-decreasing-is-strict-decreasing-value-sequence-ℕ : + strict-decreasing-is-strict-decreasing-value-sequence-ℕ : ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) → is-strict-decreasing-sequence-ℕ f - is-strict-decreasing-is-strict-decreasing-value-sequence-ℕ H p q I = + strict-decreasing-is-strict-decreasing-value-sequence-ℕ H p q I = based-ind-ℕ ( succ-ℕ p) ( λ k → le-ℕ (f k) (f p)) @@ -186,6 +186,20 @@ module _ ( λ n J → transitive-le-ℕ (f (succ-ℕ n)) (f n) (f p) (H n)) ( q) ( leq-succ-le-ℕ p q I) + +module _ + (f : strict-increasing-sequence-ℕ) + where + + strict-increasing-value-strict-increasing-sequence-ℕ : + (n : ℕ) → + is-strict-increasing-value-sequence-ℕ + (sequence-strict-increasing-sequence-ℕ f) + (n) + strict-increasing-value-strict-increasing-sequence-ℕ = + strict-increasing-value-is-strict-increasing-sequence-ℕ + ( sequence-strict-increasing-sequence-ℕ f) + ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ f) ``` ### There exist no strictly decreasing sequences of natural numbers @@ -231,7 +245,7 @@ module _ ¬ ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) no-strict-decreasing-value-sequence-ℕ = ( no-strict-decreasing-sequence-ℕ) ∘ - ( is-strict-decreasing-is-strict-decreasing-value-sequence-ℕ f) + ( strict-decreasing-is-strict-decreasing-value-sequence-ℕ f) ``` ### Strictly increasing sequences of natural numbers preserve inequality @@ -373,41 +387,44 @@ comp-strict-increasing-sequence-ℕ g f = ```agda module _ - (f : sequence ℕ) (H : is-strict-increasing-sequence-ℕ f) + (f : strict-increasing-sequence-ℕ) (M : ℕ) where - limit-∞-is-strict-increasing-sequence-ℕ : - (M : ℕ) → asymptotically (λ n → leq-ℕ M (f n)) - limit-∞-is-strict-increasing-sequence-ℕ zero-ℕ = - ( zero-ℕ , λ n K → leq-zero-ℕ (f n)) - limit-∞-is-strict-increasing-sequence-ℕ (succ-ℕ M) = - map-Σ - ( is-modulus-dependent-sequence (λ n → leq-ℕ (succ-ℕ M) (f n))) - ( succ-ℕ) - ( λ N K n I → - leq-succ-le-ℕ M (f n) - (concatenate-leq-le-ℕ - { M} - { f N} - { f n} - ( K N (refl-leq-ℕ N)) - ( H N n - ( concatenate-le-leq-ℕ - { N} - { succ-ℕ N} - { n} - ( succ-le-ℕ N) - ( I))))) - ( limit-∞-is-strict-increasing-sequence-ℕ M) - - modulus-limit-∞-is-strict-increasing-sequence-ℕ : ℕ → ℕ - modulus-limit-∞-is-strict-increasing-sequence-ℕ M = - pr1 (limit-∞-is-strict-increasing-sequence-ℕ M) - - is-modulus-limit-∞-is-strict-increasing-sequence-ℕ : - (M p : ℕ) → - leq-ℕ (modulus-limit-∞-is-strict-increasing-sequence-ℕ M) p → - leq-ℕ M (f p) - is-modulus-limit-∞-is-strict-increasing-sequence-ℕ M = - pr2 (limit-∞-is-strict-increasing-sequence-ℕ M) + unbounded-strict-increasing-sequence-ℕ : + Σ ℕ (λ n → leq-ℕ M (sequence-strict-increasing-sequence-ℕ f n)) + unbounded-strict-increasing-sequence-ℕ = + (M , leq-id-strict-increasing-sequence-ℕ f M) + + modulus-unbounded-strict-increasing-sequence-ℕ : ℕ + modulus-unbounded-strict-increasing-sequence-ℕ = + pr1 unbounded-strict-increasing-sequence-ℕ + + value-unbounded-strict-increasing-sequence-ℕ : ℕ + value-unbounded-strict-increasing-sequence-ℕ = + sequence-strict-increasing-sequence-ℕ f + modulus-unbounded-strict-increasing-sequence-ℕ + + is-modulus-unbounded-strict-increasing-sequence-ℕ : + leq-ℕ M value-unbounded-strict-increasing-sequence-ℕ + is-modulus-unbounded-strict-increasing-sequence-ℕ = + pr2 unbounded-strict-increasing-sequence-ℕ + + is-∞-modulus-unbounded-strict-increasing-sequence-ℕ : + (p : ℕ) → + leq-ℕ modulus-unbounded-strict-increasing-sequence-ℕ p → + leq-ℕ M (sequence-strict-increasing-sequence-ℕ f p) + is-∞-modulus-unbounded-strict-increasing-sequence-ℕ = + based-ind-ℕ + ( modulus-unbounded-strict-increasing-sequence-ℕ) + ( λ k → leq-ℕ M (sequence-strict-increasing-sequence-ℕ f k)) + ( is-modulus-unbounded-strict-increasing-sequence-ℕ) + ( λ n I → + transitive-leq-ℕ + ( M) + ( sequence-strict-increasing-sequence-ℕ f n) + ( sequence-strict-increasing-sequence-ℕ f (succ-ℕ n)) + ( leq-le-ℕ + ( sequence-strict-increasing-sequence-ℕ f n) + ( sequence-strict-increasing-sequence-ℕ f (succ-ℕ n)) + ( strict-increasing-value-strict-increasing-sequence-ℕ f n))) ``` diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 5f76977095..25aaa2d3f7 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -179,29 +179,22 @@ module _ modulus-subsequence : ℕ → ℕ modulus-subsequence = - modulus-limit-∞-is-strict-increasing-sequence-ℕ - ( extract-subsequence u v) - ( is-strict-increasing-extract-subsequence u v) + modulus-unbounded-strict-increasing-sequence-ℕ v is-modulus-subsequence : (N p : ℕ) → leq-ℕ (modulus-subsequence N) p → leq-ℕ N (extract-subsequence u v p) is-modulus-subsequence = - is-modulus-limit-∞-is-strict-increasing-sequence-ℕ - ( extract-subsequence u v) - ( is-strict-increasing-extract-subsequence u v) + is-∞-modulus-unbounded-strict-increasing-sequence-ℕ v extract-modulus-subsequence : ℕ → ℕ extract-modulus-subsequence = extract-subsequence u v ∘ modulus-subsequence leq-extract-modulus-subsequence : (n : ℕ) → leq-ℕ n (extract-modulus-subsequence n) - leq-extract-modulus-subsequence n = - is-modulus-subsequence - ( n) - ( modulus-subsequence n) - ( refl-leq-ℕ (modulus-subsequence n)) + leq-extract-modulus-subsequence = + is-modulus-unbounded-strict-increasing-sequence-ℕ v ``` ### Subsequential type families @@ -238,6 +231,6 @@ module _ ( modulus-subsequence A B) ( λ N K p → ( K (extract-subsequence A B p)) ∘ - ( is-modulus-subsequence A B N p)) + ( is-∞-modulus-unbounded-strict-increasing-sequence-ℕ B N p)) ( H) ``` From 4e47e01600c9ff2e63913bb51a7b384d50ab486e Mon Sep 17 00:00:00 2001 From: malarbol Date: Fri, 7 Jun 2024 19:25:09 +0200 Subject: [PATCH 57/67] refactor strict-monotonic-sequences-natural-numbers --- src/elementary-number-theory.lagda.md | 3 +- ...notonic-sequences-natural-numbers.lagda.md | 3 +- ...reasing-sequences-natural-numbers.lagda.md | 151 ++++++++++++++ ...easing-sequences-natural-numbers.lagda.md} | 192 ++++-------------- ...asymptotically-constant-sequences.lagda.md | 2 +- src/foundation/subsequences.lagda.md | 4 +- .../monotonic-sequences-posets.lagda.md | 2 +- 7 files changed, 202 insertions(+), 155 deletions(-) create mode 100644 src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md rename src/elementary-number-theory/{strict-monotonic-sequences-natural-numbers.lagda.md => strictly-increasing-sequences-natural-numbers.lagda.md} (71%) diff --git a/src/elementary-number-theory.lagda.md b/src/elementary-number-theory.lagda.md index 6590210b19..8ec4a3cf93 100644 --- a/src/elementary-number-theory.lagda.md +++ b/src/elementary-number-theory.lagda.md @@ -145,7 +145,8 @@ open import elementary-number-theory.strict-inequality-integer-fractions public open import elementary-number-theory.strict-inequality-integers public open import elementary-number-theory.strict-inequality-natural-numbers public open import elementary-number-theory.strict-inequality-rational-numbers public -open import elementary-number-theory.strict-monotonic-sequences-natural-numbers public +open import elementary-number-theory.strictly-decreasing-sequences-natural-numbers public +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers public open import elementary-number-theory.strictly-ordered-pairs-of-natural-numbers public open import elementary-number-theory.strong-induction-natural-numbers public open import elementary-number-theory.sums-of-natural-numbers public diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md index 55919d197e..e6619fa01d 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md @@ -12,7 +12,8 @@ open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers -open import elementary-number-theory.strict-monotonic-sequences-natural-numbers +open import elementary-number-theory.strictly-decreasing-sequences-natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences open import foundation.asymptotically-constant-sequences diff --git a/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md new file mode 100644 index 0000000000..44f6cc08da --- /dev/null +++ b/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md @@ -0,0 +1,151 @@ +# Strictly decreasing sequences of natural numbers + +```agda +module elementary-number-theory.strictly-decreasing-sequences-natural-numbers where +``` + +
Imports + +```agda +open import elementary-number-theory.based-induction-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-inequality-natural-numbers + +open import foundation.empty-types +open import foundation.function-types +open import foundation.negation +open import foundation.propositions +open import foundation.sequences +open import foundation.universe-levels +``` + +
+ +## Idea + +A sequences of natural numbers is **strictly increasing** if it reverses +[strict inequality](elementary-number-theory.strict-inequality-natural-numbers.md) +of natural numbers. + +Strictly decreasing sequences of natural numbers don't exist. + +## Definitions + +### Strictly decreasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-strict-decreasing-sequence-prop-ℕ : Prop lzero + is-strict-decreasing-sequence-prop-ℕ = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) + + is-strict-decreasing-sequence-ℕ : UU lzero + is-strict-decreasing-sequence-ℕ = + type-Prop is-strict-decreasing-sequence-prop-ℕ + + is-prop-is-strict-decreasing-sequence-ℕ : + is-prop is-strict-decreasing-sequence-ℕ + is-prop-is-strict-decreasing-sequence-ℕ = + is-prop-type-Prop is-strict-decreasing-sequence-prop-ℕ +``` + +### Strict decreasing values of sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) (n : ℕ) + where + + is-strict-decreasing-value-prop-sequence-ℕ : Prop lzero + is-strict-decreasing-value-prop-sequence-ℕ = le-ℕ-Prop (f (succ-ℕ n)) (f n) + + is-strict-decreasing-value-sequence-ℕ : UU lzero + is-strict-decreasing-value-sequence-ℕ = + type-Prop is-strict-decreasing-value-prop-sequence-ℕ + + is-prop-is-strict-decreasing-value-sequence-ℕ : + is-prop is-strict-decreasing-value-sequence-ℕ + is-prop-is-strict-decreasing-value-sequence-ℕ = + is-prop-type-Prop is-strict-decreasing-value-prop-sequence-ℕ +``` + +## Properties + +### A sequence is strictly decreasing if and only if all its values are strictly strictly decreasing + +```agda +module _ + (f : sequence ℕ) + where + + strict-decreasing-value-is-strict-decreasing-sequence-ℕ : + is-strict-decreasing-sequence-ℕ f → + ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) + strict-decreasing-value-is-strict-decreasing-sequence-ℕ H n = + H n (succ-ℕ n) (succ-le-ℕ n) + + strict-decreasing-is-strict-decreasing-value-sequence-ℕ : + ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) → + is-strict-decreasing-sequence-ℕ f + strict-decreasing-is-strict-decreasing-value-sequence-ℕ H p q I = + based-ind-ℕ + ( succ-ℕ p) + ( λ k → le-ℕ (f k) (f p)) + ( H p) + ( λ n J → transitive-le-ℕ (f (succ-ℕ n)) (f n) (f p) (H n)) + ( q) + ( leq-succ-le-ℕ p q I) +``` + +### There exist no strictly decreasing sequences of natural numbers + +```agda +no-bounded-strict-decreasing-sequence-ℕ : + (f : sequence ℕ) → + (N : ℕ) → + leq-ℕ (f zero-ℕ) N → + is-strict-decreasing-sequence-ℕ f → + empty +no-bounded-strict-decreasing-sequence-ℕ f zero-ℕ K H = + concatenate-le-leq-ℕ + { f 1} + { f 0} + { 0} + ( H 0 1 (succ-le-ℕ 0)) + ( K) +no-bounded-strict-decreasing-sequence-ℕ f (succ-ℕ N) K H = + no-bounded-strict-decreasing-sequence-ℕ + ( f ∘ succ-ℕ) + ( N) + ( leq-le-succ-ℕ + ( f 1) + ( N) + ( concatenate-le-leq-ℕ + { f 1} + { f 0} + { succ-ℕ N} + ( H 0 1 (succ-le-ℕ 0)) + ( K))) + ( λ i j → H (succ-ℕ i) (succ-ℕ j)) + +module _ + (f : sequence ℕ) + where + + no-strict-decreasing-sequence-ℕ : ¬ (is-strict-decreasing-sequence-ℕ f) + no-strict-decreasing-sequence-ℕ = + no-bounded-strict-decreasing-sequence-ℕ f (f 0) (refl-leq-ℕ (f 0)) + + no-strict-decreasing-value-sequence-ℕ : + ¬ ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) + no-strict-decreasing-value-sequence-ℕ = + ( no-strict-decreasing-sequence-ℕ) ∘ + ( strict-decreasing-is-strict-decreasing-value-sequence-ℕ f) +``` diff --git a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md similarity index 71% rename from src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md rename to src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md index 12f07b4f48..3109716fe5 100644 --- a/src/elementary-number-theory/strict-monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md @@ -1,7 +1,7 @@ -# Strictly monotonic sequences of natural numbers +# Strictly increasing sequences of natural numbers ```agda -module elementary-number-theory.strict-monotonic-sequences-natural-numbers where +module elementary-number-theory.strictly-increasing-sequences-natural-numbers where ```
Imports @@ -14,18 +14,13 @@ open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers open import foundation.action-on-identifications-functions -open import foundation.asymptotical-dependent-sequences open import foundation.dependent-pair-types -open import foundation.empty-types open import foundation.function-types open import foundation.functoriality-coproduct-types -open import foundation.functoriality-dependent-pair-types open import foundation.identity-types -open import foundation.negation open import foundation.propositions open import foundation.sequences open import foundation.subtypes -open import foundation.transport-along-identifications open import foundation.universe-levels ``` @@ -33,13 +28,12 @@ open import foundation.universe-levels ## Idea -Strictly monotonic sequences of natural numbers are functions `f : ℕ → ℕ` that -preserve or reverse strict inequality of natural numbers. +Strictly increasing sequences of natural numbers are sequences `f : ℕ → ℕ` that +preserve inequality of natural numbers. -Strictly decreasing sequences of natural numbers don't exist. - -Strictly increasing sequences of natural numbers are stable under composition -and can get arbitrarily large. +The identity sequence is strictly increasing. Strictly increasing sequences of +natural numbers are stable under composition. Strictly increasing sequences of +natural numbers and can get arbitrarily large. ## Definitions @@ -86,31 +80,7 @@ module _ is-strict-increasing-sequence-strict-increasing-sequence-ℕ = pr2 f ``` -### Strictly decreasing sequences of natural numbers - -```agda -module _ - (f : sequence ℕ) - where - - is-strict-decreasing-sequence-prop-ℕ : Prop lzero - is-strict-decreasing-sequence-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) - - is-strict-decreasing-sequence-ℕ : UU lzero - is-strict-decreasing-sequence-ℕ = - type-Prop is-strict-decreasing-sequence-prop-ℕ - - is-prop-is-strict-decreasing-sequence-ℕ : - is-prop is-strict-decreasing-sequence-ℕ - is-prop-is-strict-decreasing-sequence-ℕ = - is-prop-type-Prop is-strict-decreasing-sequence-prop-ℕ -``` - -### Strict monotonic values of sequences of natural numbers +### Strictly increasing values of a sequence of natural numbers ```agda module _ @@ -128,23 +98,11 @@ module _ is-prop is-strict-increasing-value-sequence-ℕ is-prop-is-strict-increasing-value-sequence-ℕ = is-prop-type-Prop is-strict-increasing-value-prop-sequence-ℕ - - is-strict-decreasing-value-prop-sequence-ℕ : Prop lzero - is-strict-decreasing-value-prop-sequence-ℕ = le-ℕ-Prop (f (succ-ℕ n)) (f n) - - is-strict-decreasing-value-sequence-ℕ : UU lzero - is-strict-decreasing-value-sequence-ℕ = - type-Prop is-strict-decreasing-value-prop-sequence-ℕ - - is-prop-is-strict-decreasing-value-sequence-ℕ : - is-prop is-strict-decreasing-value-sequence-ℕ - is-prop-is-strict-decreasing-value-sequence-ℕ = - is-prop-type-Prop is-strict-decreasing-value-prop-sequence-ℕ ``` ## Properties -### A sequence is strictly monotonic if and only if all its values are strictly monotonic with the same monotonicity +### A sequence of natural numbers is strictly invceasing if and only if all its values are strictly increasing ```agda module _ @@ -169,24 +127,6 @@ module _ ( q) ( leq-succ-le-ℕ p q I) - strict-decreasing-value-is-strict-decreasing-sequence-ℕ : - is-strict-decreasing-sequence-ℕ f → - ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) - strict-decreasing-value-is-strict-decreasing-sequence-ℕ H n = - H n (succ-ℕ n) (succ-le-ℕ n) - - strict-decreasing-is-strict-decreasing-value-sequence-ℕ : - ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) → - is-strict-decreasing-sequence-ℕ f - strict-decreasing-is-strict-decreasing-value-sequence-ℕ H p q I = - based-ind-ℕ - ( succ-ℕ p) - ( λ k → le-ℕ (f k) (f p)) - ( H p) - ( λ n J → transitive-le-ℕ (f (succ-ℕ n)) (f n) (f p) (H n)) - ( q) - ( leq-succ-le-ℕ p q I) - module _ (f : strict-increasing-sequence-ℕ) where @@ -202,52 +142,6 @@ module _ ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ f) ``` -### There exist no strictly decreasing sequences of natural numbers - -```agda -no-bounded-strict-decreasing-sequence-ℕ : - (f : sequence ℕ) → - (N : ℕ) → - leq-ℕ (f zero-ℕ) N → - is-strict-decreasing-sequence-ℕ f → - empty -no-bounded-strict-decreasing-sequence-ℕ f zero-ℕ K H = - concatenate-le-leq-ℕ - { f 1} - { f 0} - { 0} - ( H 0 1 (succ-le-ℕ 0)) - ( K) -no-bounded-strict-decreasing-sequence-ℕ f (succ-ℕ N) K H = - no-bounded-strict-decreasing-sequence-ℕ - ( f ∘ succ-ℕ) - ( N) - ( leq-le-succ-ℕ - ( f 1) - ( N) - ( concatenate-le-leq-ℕ - { f 1} - { f 0} - { succ-ℕ N} - ( H 0 1 (succ-le-ℕ 0)) - ( K))) - ( λ i j → H (succ-ℕ i) (succ-ℕ j)) - -module _ - (f : sequence ℕ) - where - - no-strict-decreasing-sequence-ℕ : ¬ (is-strict-decreasing-sequence-ℕ f) - no-strict-decreasing-sequence-ℕ = - no-bounded-strict-decreasing-sequence-ℕ f (f 0) (refl-leq-ℕ (f 0)) - - no-strict-decreasing-value-sequence-ℕ : - ¬ ((n : ℕ) → is-strict-decreasing-value-sequence-ℕ f n) - no-strict-decreasing-value-sequence-ℕ = - ( no-strict-decreasing-sequence-ℕ) ∘ - ( strict-decreasing-is-strict-decreasing-value-sequence-ℕ f) -``` - ### Strictly increasing sequences of natural numbers preserve inequality ```agda @@ -321,40 +215,6 @@ strict-increasing-succ-ℕ : strict-increasing-sequence-ℕ strict-increasing-succ-ℕ = (succ-ℕ , is-strict-increasing-succ-ℕ) ``` -### The strictly increasing sequence of natural numbers that skips the `n + 1` first terms - -```agda -skip-ℕ : ℕ → ℕ → ℕ -skip-ℕ n m = succ-ℕ (n +ℕ m) - -is-strict-increasing-skip-ℕ : - (n : ℕ) → is-strict-increasing-sequence-ℕ (skip-ℕ n) -is-strict-increasing-skip-ℕ n p q I = - concatenate-le-leq-ℕ - { add-ℕ n p} - { succ-ℕ (add-ℕ n p)} - { add-ℕ n q} - ( succ-le-ℕ (add-ℕ n p)) - ( preserves-leq-right-add-ℕ n (succ-ℕ p) q (leq-succ-le-ℕ p q I)) - -strict-increasing-skip-ℕ : (n : ℕ) → strict-increasing-sequence-ℕ -strict-increasing-skip-ℕ n = (skip-ℕ n , is-strict-increasing-skip-ℕ n) - -associative-skip-ℕ : (i j k : ℕ) → - skip-ℕ (skip-ℕ i j) k = skip-ℕ i (skip-ℕ j k) -associative-skip-ℕ i j k = - ap - ( succ-ℕ) - ( ( left-successor-law-add-ℕ (i +ℕ j) k) ∙ - ( ap succ-ℕ (associative-add-ℕ i j k))) - -le-skip-ℕ : (m n : ℕ) → le-ℕ m (skip-ℕ m n) -le-skip-ℕ m n = le-succ-leq-ℕ m (m +ℕ n) (leq-add-ℕ m n) - -le-skip-ℕ' : (m n : ℕ) → le-ℕ m (skip-ℕ n m) -le-skip-ℕ' m n = le-succ-leq-ℕ m (n +ℕ m) (leq-add-ℕ' m n) -``` - ### The composition of strictly increasing sequences of natural numbers is strictly increasing ```agda @@ -428,3 +288,37 @@ module _ ( sequence-strict-increasing-sequence-ℕ f (succ-ℕ n)) ( strict-increasing-value-strict-increasing-sequence-ℕ f n))) ``` + +### The strictly increasing sequence of natural numbers that skips the `n + 1` first terms + +```agda +skip-ℕ : ℕ → ℕ → ℕ +skip-ℕ n m = succ-ℕ (n +ℕ m) + +is-strict-increasing-skip-ℕ : + (n : ℕ) → is-strict-increasing-sequence-ℕ (skip-ℕ n) +is-strict-increasing-skip-ℕ n p q I = + concatenate-le-leq-ℕ + { add-ℕ n p} + { succ-ℕ (add-ℕ n p)} + { add-ℕ n q} + ( succ-le-ℕ (add-ℕ n p)) + ( preserves-leq-right-add-ℕ n (succ-ℕ p) q (leq-succ-le-ℕ p q I)) + +strict-increasing-skip-ℕ : (n : ℕ) → strict-increasing-sequence-ℕ +strict-increasing-skip-ℕ n = (skip-ℕ n , is-strict-increasing-skip-ℕ n) + +associative-skip-ℕ : (i j k : ℕ) → + skip-ℕ (skip-ℕ i j) k = skip-ℕ i (skip-ℕ j k) +associative-skip-ℕ i j k = + ap + ( succ-ℕ) + ( ( left-successor-law-add-ℕ (i +ℕ j) k) ∙ + ( ap succ-ℕ (associative-add-ℕ i j k))) + +le-skip-ℕ : (m n : ℕ) → le-ℕ m (skip-ℕ m n) +le-skip-ℕ m n = le-succ-leq-ℕ m (m +ℕ n) (leq-add-ℕ m n) + +le-skip-ℕ' : (m n : ℕ) → le-ℕ m (skip-ℕ n m) +le-skip-ℕ' m n = le-succ-leq-ℕ m (n +ℕ m) (leq-add-ℕ' m n) +``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 1bce903132..5ab40d8324 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -11,7 +11,7 @@ open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.maximum-natural-numbers open import elementary-number-theory.natural-numbers -open import elementary-number-theory.strict-monotonic-sequences-natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences open import foundation.asymptotically-equal-sequences diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 25aaa2d3f7..8f23578def 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -12,7 +12,7 @@ open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers open import elementary-number-theory.strict-inequality-natural-numbers -open import elementary-number-theory.strict-monotonic-sequences-natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences open import foundation.dependent-pair-types @@ -33,7 +33,7 @@ open import foundation.universe-levels A **subsequence** of a [sequence](foundation.sequences.md) `u : ℕ → A` is a sequence `u ∘ f` for some -[strictly increasing](elementary-number-theory.strict-monotonic-sequences-natural-numbers.md) +[strictly increasing](elementary-number-theory.strictly-increasing-sequences-natural-numbers.md) map `f : ℕ → ℕ`. ## Definitions diff --git a/src/order-theory/monotonic-sequences-posets.lagda.md b/src/order-theory/monotonic-sequences-posets.lagda.md index f8ee14d7a5..679ac6e86a 100644 --- a/src/order-theory/monotonic-sequences-posets.lagda.md +++ b/src/order-theory/monotonic-sequences-posets.lagda.md @@ -11,7 +11,7 @@ open import elementary-number-theory.addition-natural-numbers open import elementary-number-theory.based-induction-natural-numbers open import elementary-number-theory.inequality-natural-numbers open import elementary-number-theory.natural-numbers -open import elementary-number-theory.strict-monotonic-sequences-natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences open import foundation.asymptotically-constant-sequences From b216935e2643f389400ed91265a388a6252b23ee Mon Sep 17 00:00:00 2001 From: malarbol Date: Fri, 7 Jun 2024 19:27:08 +0200 Subject: [PATCH 58/67] fix typo --- .../strictly-decreasing-sequences-natural-numbers.lagda.md | 4 ++-- .../strictly-increasing-sequences-natural-numbers.lagda.md | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md index 44f6cc08da..cfe0ade954 100644 --- a/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md @@ -24,7 +24,7 @@ open import foundation.universe-levels ## Idea -A sequences of natural numbers is **strictly increasing** if it reverses +A sequences of natural numbers is **strictly decreasing** if it reverses [strict inequality](elementary-number-theory.strict-inequality-natural-numbers.md) of natural numbers. @@ -78,7 +78,7 @@ module _ ## Properties -### A sequence is strictly decreasing if and only if all its values are strictly strictly decreasing +### A sequence is strictly decreasing if and only if all its values are strictly decreasing ```agda module _ diff --git a/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md index 3109716fe5..202ae189f1 100644 --- a/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md @@ -28,8 +28,9 @@ open import foundation.universe-levels ## Idea -Strictly increasing sequences of natural numbers are sequences `f : ℕ → ℕ` that -preserve inequality of natural numbers. +A sequences of natural numbers is **strictly increasing** if it preserves +[strict inequality](elementary-number-theory.strict-inequality-natural-numbers.md) +of natural numbers. The identity sequence is strictly increasing. Strictly increasing sequences of natural numbers are stable under composition. Strictly increasing sequences of From 282c3119718cfef02eca7ef1c6e8782095e55c69 Mon Sep 17 00:00:00 2001 From: malarbol Date: Fri, 7 Jun 2024 19:39:15 +0200 Subject: [PATCH 59/67] cleanup --- ...y-decreasing-sequences-natural-numbers.lagda.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md index cfe0ade954..12e8dc2dd6 100644 --- a/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strictly-decreasing-sequences-natural-numbers.lagda.md @@ -39,21 +39,9 @@ module _ (f : sequence ℕ) where - is-strict-decreasing-sequence-prop-ℕ : Prop lzero - is-strict-decreasing-sequence-prop-ℕ = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → hom-Prop (le-ℕ-Prop i j) (le-ℕ-Prop (f j) (f i)))) - is-strict-decreasing-sequence-ℕ : UU lzero is-strict-decreasing-sequence-ℕ = - type-Prop is-strict-decreasing-sequence-prop-ℕ - - is-prop-is-strict-decreasing-sequence-ℕ : - is-prop is-strict-decreasing-sequence-ℕ - is-prop-is-strict-decreasing-sequence-ℕ = - is-prop-type-Prop is-strict-decreasing-sequence-prop-ℕ + (i j : ℕ) → le-ℕ i j → le-ℕ (f j) (f i) ``` ### Strict decreasing values of sequences of natural numbers From a7b9a55943fe4ec7bbe0b976381b71368191956d Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 10 Jun 2024 19:00:01 +0200 Subject: [PATCH 60/67] refactor asymptotical value sequences --- src/foundation.lagda.md | 1 + .../asymptotical-value-sequences.lagda.md | 107 ++++++++++++++++++ ...asymptotically-constant-sequences.lagda.md | 79 ++++++------- src/foundation/constant-sequences.lagda.md | 2 +- src/foundation/sequences.lagda.md | 14 +++ .../monotonic-sequences-posets.lagda.md | 4 +- 6 files changed, 162 insertions(+), 45 deletions(-) create mode 100644 src/foundation/asymptotical-value-sequences.lagda.md diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index bb138f0ccf..d9c156e43e 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -27,6 +27,7 @@ open import foundation.apartness-relations public open import foundation.arithmetic-law-coproduct-and-sigma-decompositions public open import foundation.arithmetic-law-product-and-pi-decompositions public open import foundation.asymptotical-dependent-sequences public +open import foundation.asymptotical-value-sequences public open import foundation.asymptotically-constant-sequences public open import foundation.asymptotically-equal-sequences public open import foundation.automorphisms public diff --git a/src/foundation/asymptotical-value-sequences.lagda.md b/src/foundation/asymptotical-value-sequences.lagda.md new file mode 100644 index 0000000000..8871d439a5 --- /dev/null +++ b/src/foundation/asymptotical-value-sequences.lagda.md @@ -0,0 +1,107 @@ +# Asymptotical value of a sequence + +```agda +module foundation.asymptotical-value-sequences where +``` + +
Imports + +```agda +open import elementary-number-theory.based-induction-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.maximum-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers + +open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotically-equal-sequences +open import foundation.constant-sequences +open import foundation.dependent-pair-types +open import foundation.function-types +open import foundation.functoriality-dependent-pair-types +open import foundation.identity-types +open import foundation.sequences +open import foundation.subsequences +open import foundation.universe-levels +``` + +
+ +## Idea + +A sequence `u` in a type `A` has an **asymptotical value** `x : A` if `x = u n` +for sufficiently large natural numbers `n`. + +## Definitions + +### Asymptotical values of sequences + +```agda +module _ + {l : Level} {A : UU l} (x : A) (u : sequence A) + where + + is-∞-value-sequence : UU l + is-∞-value-sequence = asymptotically (is-value-sequence x u) +``` + +### Modulus of an asymptotical value of a sequence + +```agda +module _ + {l : Level} {A : UU l} {x : A} {u : sequence A} (H : is-∞-value-sequence x u) + where + + modulus-∞-value-sequence : ℕ + modulus-∞-value-sequence = pr1 H + + is-modulus-∞-value-sequence : + (n : ℕ) → leq-ℕ modulus-∞-value-sequence n → x = u n + is-modulus-∞-value-sequence = pr2 H +``` + +## Properties + +### Asymptotical values are unique + +```agda +module _ + {l : Level} {A : UU l} (x y : A) (u : sequence A) + (H : is-∞-value-sequence x u) (K : is-∞-value-sequence y u) + where + + all-eq-∞-value-sequence : x = y + all-eq-∞-value-sequence = + value-∞-asymptotically + (map-binary-asymptotically-Π (λ n I J → I ∙ (inv J)) H K) +``` + +### Asymptotical equality preserves asymptotical value + +```agda +module _ + {l : Level} {A : UU l} (x : A) (u v : sequence A) + where + + preserves-∞-value-eq-∞-sequence : + eq-∞-sequence u v → is-∞-value-sequence x u → is-∞-value-sequence x v + preserves-∞-value-eq-∞-sequence = + map-binary-asymptotically-Π (λ n I H → H ∙ I) +``` + +### The asymptotical value of a sequence is an asymptotical value of all it subsequences + +```agda +module _ + {l : Level} {A : UU l} {x : A} {u : sequence A} (H : is-∞-value-sequence x u) + where + + Π-subsequence-∞-value-sequence : Π-subsequence (is-∞-value-sequence x) u + Π-subsequence-∞-value-sequence v = + ( modulus-subsequence u v (modulus-∞-value-sequence H)) , + ( λ n I → + is-modulus-∞-value-sequence + ( H) + ( extract-subsequence u v n) + ( is-modulus-subsequence u v (modulus-∞-value-sequence H) n I)) +``` diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 5ab40d8324..f4da4477ef 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -14,6 +14,7 @@ open import elementary-number-theory.natural-numbers open import elementary-number-theory.strictly-increasing-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotical-value-sequences open import foundation.asymptotically-equal-sequences open import foundation.constant-sequences open import foundation.dependent-pair-types @@ -56,16 +57,20 @@ module _ ∞-value-∞-constant-sequence : A ∞-value-∞-constant-sequence = u (modulus-∞-asymptotically H) + is-∞-value-∞-constant-sequence : + is-∞-value-sequence ∞-value-∞-constant-sequence u + is-∞-value-∞-constant-sequence = value-∞-asymptotically H + modulus-∞-value-∞-constant-sequence : ℕ modulus-∞-value-∞-constant-sequence = - modulus-∞-asymptotically (value-∞-asymptotically H) + modulus-∞-asymptotically is-∞-value-∞-constant-sequence is-modulus-∞-value-∞-constant-sequence : (n : ℕ) → leq-ℕ modulus-∞-value-∞-constant-sequence n → ∞-value-∞-constant-sequence = u n is-modulus-∞-value-∞-constant-sequence = - is-modulus-∞-asymptotically (value-∞-asymptotically H) + is-modulus-∞-asymptotically is-∞-value-∞-constant-sequence const-∞-value-∞-constant-sequence : sequence A const-∞-value-∞-constant-sequence n = ∞-value-∞-constant-sequence @@ -96,23 +101,30 @@ module _ all-equal-∞-value-∞-constant-sequence : ∞-value-∞-constant-sequence H = ∞-value-∞-constant-sequence K all-equal-∞-value-∞-constant-sequence = - ( is-modulus-∞-value-∞-constant-sequence - ( H) - ( max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K)) - ( leq-left-max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K))) ∙ - ( inv - ( is-modulus-∞-value-∞-constant-sequence - ( K) - ( max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K)) - ( leq-right-max-ℕ - ( modulus-∞-value-∞-constant-sequence H) - ( modulus-∞-value-∞-constant-sequence K)))) + all-eq-∞-value-sequence + ( ∞-value-∞-constant-sequence H) + ( ∞-value-∞-constant-sequence K) + ( u) + ( is-∞-value-∞-constant-sequence H) + ( is-∞-value-∞-constant-sequence K) +``` + +### A sequence is asymptotically constant if it has some asymptotical value + +```agda +module _ + {l : Level} {A : UU l} (x : A) (u : sequence A) + where + + ∞-constant-is-∞-value-sequence : + is-∞-value-sequence x u → is-∞-constant-sequence u + ∞-constant-is-∞-value-sequence H = + ( modulus-∞-value-sequence H) , + ( λ p I → + ( modulus-∞-value-sequence H) , + ( λ q J → + ( inv (is-modulus-∞-value-sequence H p I)) ∙ + ( is-modulus-∞-value-sequence H q J))) ``` ### An asymptotically constant sequence is asymptotically equal to the constant sequence of its asymptotical value @@ -134,25 +146,6 @@ module _ inv-eq-∞-sequence eq-∞-value-∞-constant-sequence ``` -### A sequence is asymptotically constant if it is asymptotically equal to some constant sequence - -```agda -module _ - {l : Level} {A : UU l} (x : A) (u : sequence A) - where - - ∞-constant-eq-∞-constant-sequence : - (eq-∞-sequence (const-sequence x) u) → is-∞-constant-sequence u - ∞-constant-eq-∞-constant-sequence H = - ( modulus-eq-∞-sequence H) , - ( λ p I → - ( ( modulus-eq-∞-sequence H) , - ( λ q J → - ( inv - ( is-modulus-eq-∞-sequence H p I)) ∙ - ( is-modulus-eq-∞-sequence H q J)))) -``` - ### Two asymptotically constant sequences are asymptotically equal if and only if their asymptotical value is the same ```agda @@ -202,10 +195,12 @@ module _ ∞-constant-Π-subsequence : Π-subsequence is-∞-constant-sequence u ∞-constant-Π-subsequence v = - ∞-constant-eq-∞-constant-sequence + ∞-constant-is-∞-value-sequence ( ∞-value-∞-constant-sequence H) ( sequence-subsequence u v) - ( eq-∞-value-∞-constant-Π-subsequence v) + ( Π-subsequence-∞-value-sequence + ( is-∞-value-∞-constant-sequence H) + ( v)) ``` ### A sequence asymptotically equal to an asymptotically constant sequence is asymptotically constant @@ -218,7 +213,7 @@ module _ preserves-∞-constant-eq-∞-sequence : is-∞-constant-sequence u → is-∞-constant-sequence v preserves-∞-constant-eq-∞-sequence K = - ∞-constant-eq-∞-constant-sequence + ∞-constant-is-∞-value-sequence ( ∞-value-∞-constant-sequence K) ( v) ( transitive-eq-∞-sequence @@ -264,7 +259,7 @@ module _ ∞-constant-is-∞-stationnary-sequence : is-∞-stationnary-sequence u → is-∞-constant-sequence u ∞-constant-is-∞-stationnary-sequence H = - ∞-constant-eq-∞-constant-sequence + ∞-constant-is-∞-value-sequence ( u (modulus-∞-asymptotically H)) ( u) ( ( modulus-∞-asymptotically H) , diff --git a/src/foundation/constant-sequences.lagda.md b/src/foundation/constant-sequences.lagda.md index 01d2fb352a..5e461cf986 100644 --- a/src/foundation/constant-sequences.lagda.md +++ b/src/foundation/constant-sequences.lagda.md @@ -63,7 +63,7 @@ module _ ```agda module _ - {l : Level} {A : UU l} (u : sequence A) (H : is-constant-sequence u) + {l : Level} {A : UU l} {u : sequence A} (H : is-constant-sequence u) where value-constant-sequence : A diff --git a/src/foundation/sequences.lagda.md b/src/foundation/sequences.lagda.md index 5a8b9fa482..a29bc3122d 100644 --- a/src/foundation/sequences.lagda.md +++ b/src/foundation/sequences.lagda.md @@ -7,7 +7,10 @@ module foundation.sequences where
Imports ```agda +open import elementary-number-theory.natural-numbers + open import foundation.dependent-sequences +open import foundation.identity-types open import foundation.universe-levels open import foundation-core.function-types @@ -28,6 +31,17 @@ sequence : {l : Level} → UU l → UU l sequence A = dependent-sequence (λ _ → A) ``` +### Values of a sequence + +```agda +module _ + {l : Level} {A : UU l} + where + + is-value-sequence : A → sequence A → ℕ → UU l + is-value-sequence x u n = x = u n +``` + ### Functorial action on maps of sequences ```agda diff --git a/src/order-theory/monotonic-sequences-posets.lagda.md b/src/order-theory/monotonic-sequences-posets.lagda.md index 679ac6e86a..7a8e545bc2 100644 --- a/src/order-theory/monotonic-sequences-posets.lagda.md +++ b/src/order-theory/monotonic-sequences-posets.lagda.md @@ -345,7 +345,7 @@ module _ ∞-constant-Σ-subsequence-constant-increasing-sequence-poset H = rec-Σ ( λ v K → - ∞-constant-eq-∞-constant-sequence + ∞-constant-is-∞-value-sequence ( u (extract-subsequence u v zero-ℕ)) ( u) ( ( extract-subsequence u v zero-ℕ) , @@ -370,7 +370,7 @@ module _ ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset H = rec-Σ ( λ v K → - ∞-constant-eq-∞-constant-sequence + ∞-constant-is-∞-value-sequence ( u (extract-subsequence u v zero-ℕ)) ( u) ( ( extract-subsequence u v zero-ℕ) , From f5dad809a1a14da256cbcebce2cdbe30963b08fe Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 10 Jun 2024 19:31:23 +0200 Subject: [PATCH 61/67] cleanup --- .../asymptotical-value-sequences.lagda.md | 16 ++++++++++++++++ .../asymptotically-constant-sequences.lagda.md | 17 ++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/foundation/asymptotical-value-sequences.lagda.md b/src/foundation/asymptotical-value-sequences.lagda.md index 8871d439a5..1f5e943365 100644 --- a/src/foundation/asymptotical-value-sequences.lagda.md +++ b/src/foundation/asymptotical-value-sequences.lagda.md @@ -76,6 +76,22 @@ module _ (map-binary-asymptotically-Π (λ n I J → I ∙ (inv J)) H K) ``` +### A sequence has an asymptotical value if and only if it is asymptotically equal to some constant sequence + +```agda +module _ + {l : Level} {A : UU l} (x : A) (u : sequence A) + where + + eq-∞-const-sequence-is-∞-value-sequence : + is-∞-value-sequence x u → eq-∞-sequence (const-sequence x) u + eq-∞-const-sequence-is-∞-value-sequence = tot (λ n K → K) + + is-∞-value-eq-∞-constant-sequence : + eq-∞-sequence (const-sequence x) u → is-∞-value-sequence x u + is-∞-value-eq-∞-constant-sequence = tot (λ n K → K) +``` + ### Asymptotical equality preserves asymptotical value ```agda diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index f4da4477ef..0545a89b2c 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -181,18 +181,6 @@ module _ {l : Level} {A : UU l} (u : sequence A) (H : is-∞-constant-sequence u) where - eq-∞-value-∞-constant-Π-subsequence : - Π-subsequence (eq-∞-sequence (const-∞-value-∞-constant-sequence H)) u - eq-∞-value-∞-constant-Π-subsequence v = - ( ( modulus-subsequence u v (modulus-∞-value-∞-constant-sequence H)) , - ( λ n I → - is-modulus-∞-value-∞-constant-sequence H - ( extract-subsequence u v n) - ( is-modulus-subsequence u v - ( modulus-∞-value-∞-constant-sequence H) - ( n) - ( I)))) - ∞-constant-Π-subsequence : Π-subsequence is-∞-constant-sequence u ∞-constant-Π-subsequence v = ∞-constant-is-∞-value-sequence @@ -294,7 +282,10 @@ module _ ( u) ( const-∞-value-∞-constant-sequence H) ( sequence-subsequence u v) - ( eq-∞-value-∞-constant-Π-subsequence u H v) + ( eq-∞-const-sequence-is-∞-value-sequence + ( ∞-value-∞-constant-sequence H) + ( sequence-subsequence u v) + ( Π-subsequence-∞-value-sequence (is-∞-value-∞-constant-sequence H) v)) ( eq-∞-value-∞-constant-sequence' H) ∞-constant-eq-∞-sequence-subsequence : From c54882390238d3fe9214381e8d4a0b0da6e0ce33 Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 10 Jun 2024 21:20:14 +0200 Subject: [PATCH 62/67] refactor monotonic sequences --- src/elementary-number-theory.lagda.md | 3 +- ...easing-sequences-natural-numbers.lagda.md} | 48 +-- ...reasing-sequences-natural-numbers.lagda.md | 97 +++++ src/order-theory.lagda.md | 3 + .../constant-sequences-posets.lagda.md | 57 +++ .../decreasing-sequences-posets.lagda.md | 209 +++++++++ .../increasing-sequences-posets.lagda.md | 203 +++++++++ .../monotonic-sequences-posets.lagda.md | 405 +----------------- src/order-theory/sequences-posets.lagda.md | 61 +++ 9 files changed, 650 insertions(+), 436 deletions(-) rename src/elementary-number-theory/{monotonic-sequences-natural-numbers.lagda.md => decreasing-sequences-natural-numbers.lagda.md} (88%) create mode 100644 src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md create mode 100644 src/order-theory/constant-sequences-posets.lagda.md create mode 100644 src/order-theory/decreasing-sequences-posets.lagda.md create mode 100644 src/order-theory/increasing-sequences-posets.lagda.md diff --git a/src/elementary-number-theory.lagda.md b/src/elementary-number-theory.lagda.md index 8ec4a3cf93..17d5a5ee62 100644 --- a/src/elementary-number-theory.lagda.md +++ b/src/elementary-number-theory.lagda.md @@ -37,6 +37,7 @@ open import elementary-number-theory.decidable-total-order-natural-numbers publi open import elementary-number-theory.decidable-total-order-rational-numbers public open import elementary-number-theory.decidable-total-order-standard-finite-types public open import elementary-number-theory.decidable-types public +open import elementary-number-theory.decreasing-sequences-natural-numbers public open import elementary-number-theory.difference-integers public open import elementary-number-theory.difference-rational-numbers public open import elementary-number-theory.dirichlet-convolution public @@ -64,6 +65,7 @@ open import elementary-number-theory.greatest-common-divisor-natural-numbers pub open import elementary-number-theory.group-of-integers public open import elementary-number-theory.half-integers public open import elementary-number-theory.hardy-ramanujan-number public +open import elementary-number-theory.increasing-sequences-natural-numbers public open import elementary-number-theory.inequality-integer-fractions public open import elementary-number-theory.inequality-integers public open import elementary-number-theory.inequality-natural-numbers public @@ -88,7 +90,6 @@ open import elementary-number-theory.modular-arithmetic public open import elementary-number-theory.modular-arithmetic-standard-finite-types public open import elementary-number-theory.monoid-of-natural-numbers-with-addition public open import elementary-number-theory.monoid-of-natural-numbers-with-maximum public -open import elementary-number-theory.monotonic-sequences-natural-numbers public open import elementary-number-theory.multiplication-integer-fractions public open import elementary-number-theory.multiplication-integers public open import elementary-number-theory.multiplication-lists-of-natural-numbers public diff --git a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md similarity index 88% rename from src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md rename to src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md index e6619fa01d..aa80be79c5 100644 --- a/src/elementary-number-theory/monotonic-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md @@ -1,7 +1,7 @@ -# Monotonic sequences of natural numbers +# Decreasing sequences of natural numbers ```agda -module elementary-number-theory.monotonic-sequences-natural-numbers where +module elementary-number-theory.decreasing-sequences-natural-numbers where ```
Imports @@ -34,44 +34,38 @@ open import foundation.transport-along-identifications open import foundation.type-arithmetic-empty-type open import foundation.universe-levels -open import order-theory.monotonic-sequences-posets +open import order-theory.decreasing-sequences-posets +open import order-theory.sequences-posets ```
## Idea -Monotonic sequences of natural numbers are functions `f : ℕ → ℕ` that preserve -or reverse inequality of natural numbers. +A sequences of natural numbers is **decreasing** if it reverses +[inequality of natural numbers](elementary-number-theory.inequality-natural-numbers.md). ## Definitions -### Monotonic values of sequences of natural numbers +### Decreasing values of sequences of natural numbers ```agda module _ (f : sequence ℕ) (n : ℕ) where - is-increasing-value-sequence-ℕ : UU lzero - is-increasing-value-sequence-ℕ = - is-increasing-value-sequence-poset ℕ-Poset f n - is-decreasing-value-sequence-ℕ : UU lzero is-decreasing-value-sequence-ℕ = is-decreasing-value-sequence-poset ℕ-Poset f n ``` -### Monotonic sequences of natural numbers +### Decreasing sequences of natural numbers ```agda module _ (f : sequence ℕ) where - is-increasing-sequence-ℕ : UU lzero - is-increasing-sequence-ℕ = is-increasing-sequence-poset ℕ-Poset f - is-decreasing-sequence-ℕ : UU lzero is-decreasing-sequence-ℕ = is-decreasing-sequence-poset ℕ-Poset f ``` @@ -95,20 +89,13 @@ module _ ( inv-tr (leq-ℕ (f k)) K (H n k I))) ``` -### A monotonic value of a sequence of natural numbers is either stationnary or strictly monotonic +### A decreasing value of a sequence of natural numbers is either stationnary or strictly decreasing ```agda module _ (f : sequence ℕ) (n : ℕ) where - decide-is-stationnary-is-increasing-value-sequence-ℕ : - is-increasing-value-sequence-ℕ f n → - (is-stationnary-value-sequence f n) + - (is-strict-increasing-value-sequence-ℕ f n) - decide-is-stationnary-is-increasing-value-sequence-ℕ = - eq-or-le-leq-ℕ (f n) (f (succ-ℕ n)) - decide-is-stationnary-is-decreasing-value-sequence-ℕ : is-decreasing-value-sequence-ℕ f n → (is-stationnary-value-sequence f n) + @@ -117,28 +104,13 @@ module _ map-coproduct inv id (eq-or-le-leq-ℕ (f (succ-ℕ n)) (f n) H) ``` -### Any value of a monotonic sequence of natural numbers that is not a strict value is stationnary +### Any value of a decreasing sequence of natural numbers that is not a strict value is stationnary ```agda module _ (f : sequence ℕ) where - stationnary-value-is-not-strict-value-increasing-sequence-ℕ : - is-increasing-sequence-ℕ f → - (n : ℕ) → - ¬ (is-strict-increasing-value-sequence-ℕ f n) → - is-stationnary-value-sequence f n - stationnary-value-is-not-strict-value-increasing-sequence-ℕ H n K = - map-right-unit-law-coproduct-is-empty - ( is-stationnary-value-sequence f n) - ( is-strict-increasing-value-sequence-ℕ f n) - ( K) - ( decide-is-stationnary-is-increasing-value-sequence-ℕ - ( f) - ( n) - ( increasing-value-is-increasing-sequence-poset ℕ-Poset {f} H n)) - stationnary-value-is-not-strict-value-decreasing-sequence-ℕ : is-decreasing-sequence-ℕ f → (n : ℕ) → diff --git a/src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md new file mode 100644 index 0000000000..0b8be82360 --- /dev/null +++ b/src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md @@ -0,0 +1,97 @@ +# Increasing sequences of natural numbers + +```agda +module elementary-number-theory.increasing-sequences-natural-numbers where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strict-inequality-natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers + +open import foundation.constant-sequences +open import foundation.coproduct-types +open import foundation.negation +open import foundation.propositions +open import foundation.sequences +open import foundation.type-arithmetic-empty-type +open import foundation.universe-levels + +open import order-theory.increasing-sequences-posets +open import order-theory.sequences-posets +``` + +
+ +## Idea + +A sequences of natural numbers is **increasing** if it preserves +[inequality of natural numbers](elementary-number-theory.inequality-natural-numbers.md). + +## Definitions + +### Increasing values of sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) (n : ℕ) + where + + is-increasing-value-sequence-ℕ : UU lzero + is-increasing-value-sequence-ℕ = + is-increasing-value-sequence-poset ℕ-Poset f n +``` + +### Increasing sequences of natural numbers + +```agda +module _ + (f : sequence ℕ) + where + + is-increasing-sequence-ℕ : UU lzero + is-increasing-sequence-ℕ = is-increasing-sequence-poset ℕ-Poset f +``` + +## Properties + +### An increasing value of a sequence of natural numbers is either stationnary or strictly increasing + +```agda +module _ + (f : sequence ℕ) (n : ℕ) + where + + decide-is-stationnary-is-increasing-value-sequence-ℕ : + is-increasing-value-sequence-ℕ f n → + (is-stationnary-value-sequence f n) + + (is-strict-increasing-value-sequence-ℕ f n) + decide-is-stationnary-is-increasing-value-sequence-ℕ = + eq-or-le-leq-ℕ (f n) (f (succ-ℕ n)) +``` + +### Any value of an increasing sequence of natural numbers that is not a strict value is stationnary + +```agda +module _ + (f : sequence ℕ) + where + + stationnary-value-is-not-strict-value-increasing-sequence-ℕ : + is-increasing-sequence-ℕ f → + (n : ℕ) → + ¬ (is-strict-increasing-value-sequence-ℕ f n) → + is-stationnary-value-sequence f n + stationnary-value-is-not-strict-value-increasing-sequence-ℕ H n K = + map-right-unit-law-coproduct-is-empty + ( is-stationnary-value-sequence f n) + ( is-strict-increasing-value-sequence-ℕ f n) + ( K) + ( decide-is-stationnary-is-increasing-value-sequence-ℕ + ( f) + ( n) + ( increasing-value-is-increasing-sequence-poset ℕ-Poset {f} H n)) +``` diff --git a/src/order-theory.lagda.md b/src/order-theory.lagda.md index f1f63c0c3d..740a34857c 100644 --- a/src/order-theory.lagda.md +++ b/src/order-theory.lagda.md @@ -14,6 +14,7 @@ open import order-theory.closure-operators-large-locales public open import order-theory.closure-operators-large-posets public open import order-theory.commuting-squares-of-galois-connections-large-posets public open import order-theory.commuting-squares-of-order-preserving-maps-large-posets public +open import order-theory.constant-sequences-posets public open import order-theory.coverings-locales public open import order-theory.decidable-posets public open import order-theory.decidable-preorders public @@ -21,6 +22,7 @@ open import order-theory.decidable-subposets public open import order-theory.decidable-subpreorders public open import order-theory.decidable-total-orders public open import order-theory.decidable-total-preorders public +open import order-theory.decreasing-sequences-posets public open import order-theory.dependent-products-large-frames public open import order-theory.dependent-products-large-locales public open import order-theory.dependent-products-large-meet-semilattices public @@ -49,6 +51,7 @@ open import order-theory.homomorphisms-meet-semilattices public open import order-theory.homomorphisms-meet-sup-lattices public open import order-theory.homomorphisms-sup-lattices public open import order-theory.ideals-preorders public +open import order-theory.increasing-sequences-posets public open import order-theory.inhabited-finite-total-orders public open import order-theory.interval-subposets public open import order-theory.join-semilattices public diff --git a/src/order-theory/constant-sequences-posets.lagda.md b/src/order-theory/constant-sequences-posets.lagda.md new file mode 100644 index 0000000000..a49f372a54 --- /dev/null +++ b/src/order-theory/constant-sequences-posets.lagda.md @@ -0,0 +1,57 @@ +# Constant sequences in partially ordered sets + +```agda +module order-theory.constant-sequences-posets where +``` + +
Imports + +```agda +open import elementary-number-theory.inequality-natural-numbers + +open import foundation.constant-sequences +open import foundation.coproduct-types +open import foundation.universe-levels + +open import order-theory.decreasing-sequences-posets +open import order-theory.increasing-sequences-posets +open import order-theory.posets +open import order-theory.sequences-posets +``` + +
+ +## Idea + +A [sequence in a partially ordered set](order-theory.sequences-posets.md) is +[constant](foundation.constant-sequences.md) if it is both +[increasing](order-theory.increasing-sequences-posets.md) and +[decreasing](order-theory.decreasing-sequences-posets.md). + +## Properties + +### A sequence in a partially ordered set is constant if and only if it is both increasing and decreasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + increasing-is-constant-sequence-poset : + is-constant-sequence u → is-increasing-sequence-poset P u + increasing-is-constant-sequence-poset H p q I = leq-eq-Poset P (H p q) + + decreasing-is-constant-sequence-poset : + is-constant-sequence u → is-decreasing-sequence-poset P u + decreasing-is-constant-sequence-poset H p q I = leq-eq-Poset P (H q p) + + constant-is-increasing-decreasing-sequence-poset : + is-increasing-sequence-poset P u → + is-decreasing-sequence-poset P u → + is-constant-sequence u + constant-is-increasing-decreasing-sequence-poset I J p q = + rec-coproduct + ( λ H → antisymmetric-leq-Poset P (u p) (u q) (I p q H) (J p q H)) + ( λ H → antisymmetric-leq-Poset P (u p) (u q) (J q p H) (I q p H)) + ( linear-leq-ℕ p q) +``` diff --git a/src/order-theory/decreasing-sequences-posets.lagda.md b/src/order-theory/decreasing-sequences-posets.lagda.md new file mode 100644 index 0000000000..55892002c8 --- /dev/null +++ b/src/order-theory/decreasing-sequences-posets.lagda.md @@ -0,0 +1,209 @@ +# Decreasing sequences in partially ordered sets + +```agda +module order-theory.decreasing-sequences-posets where +``` + +
Imports + +```agda +open import elementary-number-theory.addition-natural-numbers +open import elementary-number-theory.based-induction-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers + +open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotically-constant-sequences +open import foundation.constant-sequences +open import foundation.coproduct-types +open import foundation.dependent-pair-types +open import foundation.function-types +open import foundation.identity-types +open import foundation.propositions +open import foundation.sequences +open import foundation.subsequences +open import foundation.universe-levels + +open import order-theory.posets +open import order-theory.sequences-posets +``` + +
+ +## Idea + +A [sequence in a partially ordered set](order-theory.sequences-posets.md) is +**decreasing** if it reverses the +[standard ordering on the natural numbers](elementary-number-theory.inequality-natural-numbers.md). + +## Definitions + +### Decreasing sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + where + + is-decreasing-prop-sequence-poset : Prop l2 + is-decreasing-prop-sequence-poset = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → + hom-Prop + ( leq-ℕ-Prop i j) + ( leq-Poset-Prop P (u j) (u i)))) + + is-decreasing-sequence-poset : UU l2 + is-decreasing-sequence-poset = + type-Prop is-decreasing-prop-sequence-poset + + is-prop-is-decreasing-sequence-poset : + is-prop is-decreasing-sequence-poset + is-prop-is-decreasing-sequence-poset = + is-prop-type-Prop is-decreasing-prop-sequence-poset +``` + +## Properties + +### A sequence in a partially ordered set is decreasing if and only if all its values are decreasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + decreasing-sequence-is-decreasing-value-sequence-poset : + ((n : ℕ) → is-decreasing-value-sequence-poset P u n) → + is-decreasing-sequence-poset P u + decreasing-sequence-is-decreasing-value-sequence-poset H p = + based-ind-ℕ + ( p) + ( λ q → leq-Poset P (u q) (u p)) + ( refl-leq-Poset P (u p)) + ( λ q I J → + transitive-leq-Poset P (u (succ-ℕ q)) (u q) (u p) J (H q)) + + decreasing-value-is-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + ((n : ℕ) → is-decreasing-value-sequence-poset P u n) + decreasing-value-is-decreasing-sequence-poset H n = + H n (succ-ℕ n) (succ-leq-ℕ n) +``` + +### Any subsequence of a decreasing sequence in a partially ordered set is decreasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + where + + decreasing-Π-subsequence-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + Π-subsequence (is-decreasing-sequence-poset P) u + decreasing-Π-subsequence-decreasing-sequence-poset H v p q I = + H + ( extract-subsequence u v p) + ( extract-subsequence u v q) + ( preserves-leq-extract-subsequence u v p q I) +``` + +### A sequence in a partially ordered set is decreasing if and only if it is greater than all its subsequences + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + where + + decreasing-Π-subsequence-leq-sequence-poset : + Π-subsequence (λ v → leq-sequence-poset P v u) u → + is-decreasing-sequence-poset P u + decreasing-Π-subsequence-leq-sequence-poset H = + decreasing-sequence-is-decreasing-value-sequence-poset + ( P) + ( H (skip-zero-sequence u)) + + Π-subsequence-leq-decreasing-sequence-Poset : + is-decreasing-sequence-poset P u → + Π-subsequence (λ v → leq-sequence-poset P v u) u + Π-subsequence-leq-decreasing-sequence-Poset H v n = + H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) +``` + +### A decreasing sequence `u` with `u (p + n) = u n` is constant between `n` and `p + n` + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + (p n : ℕ) (I : u (p +ℕ n) = u n) + where + + constant-value-is-stationnary-interval-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n + constant-value-is-stationnary-interval-decreasing-sequence-poset H k J = + antisymmetric-leq-Poset + ( P) + ( u (k +ℕ n)) + ( u n) + ( H n (k +ℕ n) (leq-add-ℕ' n k)) + ( concatenate-eq-leq-Poset + ( P) + ( inv I) + ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J))) +``` + +### A decreasing sequence in a partially ordered set with a constant subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + Σ-subsequence is-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset H = + rec-Σ + ( λ v K → + ∞-constant-is-∞-value-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-Poset + ( P) + ( sequence-subsequence u v zero-ℕ) + ( u n) + ( concatenate-eq-leq-Poset + ( P) + ( K zero-ℕ (modulus-subsequence u v n)) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n))) + ( H (extract-subsequence u v zero-ℕ) n I)))) +``` + +### A decreasing sequence in a partially ordered set with an asymptotically constant subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + ∞-constant-Σ-subsequence-∞-constant-decreasing-sequence-poset : + is-decreasing-sequence-poset P u → + Σ-subsequence is-∞-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-∞-constant-decreasing-sequence-poset H = + ( ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset P H) ∘ + ( rec-Σ + ( λ v → + ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v)))) +``` diff --git a/src/order-theory/increasing-sequences-posets.lagda.md b/src/order-theory/increasing-sequences-posets.lagda.md new file mode 100644 index 0000000000..047d9231f3 --- /dev/null +++ b/src/order-theory/increasing-sequences-posets.lagda.md @@ -0,0 +1,203 @@ +# Increasing sequences in partially ordered sets + +```agda +module order-theory.increasing-sequences-posets where +``` + +
Imports + +```agda +open import elementary-number-theory.addition-natural-numbers +open import elementary-number-theory.based-induction-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers +open import elementary-number-theory.strictly-increasing-sequences-natural-numbers + +open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotically-constant-sequences +open import foundation.constant-sequences +open import foundation.dependent-pair-types +open import foundation.function-types +open import foundation.identity-types +open import foundation.propositions +open import foundation.sequences +open import foundation.subsequences +open import foundation.universe-levels + +open import order-theory.posets +open import order-theory.sequences-posets +``` + +
+ +## Idea + +A [sequence in a partially ordered set](order-theory.sequences-posets.md) is +**increasing** if it preserves the +[standard ordering on the natural numbers](elementary-number-theory.inequality-natural-numbers.md). + +## Definitions + +### Increasing sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + where + + is-increasing-prop-sequence-poset : Prop l2 + is-increasing-prop-sequence-poset = + Π-Prop ℕ + ( λ i → + Π-Prop ℕ + ( λ j → + hom-Prop + ( leq-ℕ-Prop i j) + ( leq-Poset-Prop P (u i) (u j)))) + + is-increasing-sequence-poset : UU l2 + is-increasing-sequence-poset = + type-Prop is-increasing-prop-sequence-poset +``` + +## Properties + +### A sequence in a partially ordered set is increasing if and only if all its values are increasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + increasing-sequence-is-increasing-value-sequence-poset : + ((n : ℕ) → is-increasing-value-sequence-poset P u n) → + is-increasing-sequence-poset P u + increasing-sequence-is-increasing-value-sequence-poset H p = + based-ind-ℕ + ( p) + ( λ q → leq-Poset P (u p) (u q)) + ( refl-leq-Poset P (u p)) + ( λ q I → + transitive-leq-Poset P (u p) (u q) (u (succ-ℕ q)) (H q)) + + increasing-value-is-increasing-sequence-poset : + is-increasing-sequence-poset P u → + ((n : ℕ) → is-increasing-value-sequence-poset P u n) + increasing-value-is-increasing-sequence-poset H n = + H n (succ-ℕ n) (succ-leq-ℕ n) +``` + +### Any subsequence of an increasing sequence in a partially ordered set is increasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + where + + increasing-Π-subsequence-increasing-sequence-poset : + is-increasing-sequence-poset P u → + Π-subsequence (is-increasing-sequence-poset P) u + increasing-Π-subsequence-increasing-sequence-poset H v p q I = + H + ( extract-subsequence u v p) + ( extract-subsequence u v q) + ( preserves-leq-extract-subsequence u v p q I) +``` + +### A sequence in a partially ordered set is increasing if and only if it is lesser than all its subsequences + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + where + + increasing-Π-subsequence-leq-sequence-poset : + Π-subsequence (λ v → leq-sequence-poset P u v) u → + is-increasing-sequence-poset P u + increasing-Π-subsequence-leq-sequence-poset H = + increasing-sequence-is-increasing-value-sequence-poset + ( P) + ( H (skip-zero-sequence u)) + + Π-subsequence-leq-increasing-sequence-Poset : + is-increasing-sequence-poset P u → + Π-subsequence (λ v → leq-sequence-poset P u v) u + Π-subsequence-leq-increasing-sequence-Poset H v n = + H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) +``` + +### An increasing sequence `u` with `u (p + n) = u n` is constant between `n` and `p + n` + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) + (p n : ℕ) (I : u (p +ℕ n) = u n) + where + + constant-value-is-stationnary-interval-increasing-sequence-poset : + is-increasing-sequence-poset P u → + (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n + constant-value-is-stationnary-interval-increasing-sequence-poset H k J = + antisymmetric-leq-Poset + ( P) + ( u (k +ℕ n)) + ( u n) + ( concatenate-leq-eq-Poset + ( P) + ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J)) + ( I)) + ( H n (k +ℕ n) (leq-add-ℕ' n k)) +``` + +### An increasing sequence in a partially ordered set with a constant subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + ∞-constant-Σ-subsequence-constant-increasing-sequence-poset : + is-increasing-sequence-poset P u → + Σ-subsequence is-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-constant-increasing-sequence-poset H = + rec-Σ + ( λ v K → + ∞-constant-is-∞-value-sequence + ( u (extract-subsequence u v zero-ℕ)) + ( u) + ( ( extract-subsequence u v zero-ℕ) , + ( λ n I → + antisymmetric-leq-Poset + ( P) + ( sequence-subsequence u v zero-ℕ) + ( u n) + ( H (extract-subsequence u v zero-ℕ) n I) + ( concatenate-leq-eq-Poset + ( P) + ( H + ( n) + ( extract-modulus-subsequence u v n) + ( leq-extract-modulus-subsequence u v n)) + ( K (modulus-subsequence u v n) zero-ℕ))))) +``` + +### An increasing sequence in a partially ordered set with an asymptotically constant subsequence is asymptotically constant + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} + where + + ∞-constant-Σ-subsequence-∞-constant-increasing-sequence-poset : + is-increasing-sequence-poset P u → + Σ-subsequence is-∞-constant-sequence u → + is-∞-constant-sequence u + ∞-constant-Σ-subsequence-∞-constant-increasing-sequence-poset H = + ( ∞-constant-Σ-subsequence-constant-increasing-sequence-poset P H) ∘ + ( rec-Σ + ( λ v → + ( rec-Σ ( λ w I → ( sub-subsequence u v w , I))) ∘ + ( constant-subsequence-is-∞-constant-sequence + ( sequence-subsequence u v)))) +``` diff --git a/src/order-theory/monotonic-sequences-posets.lagda.md b/src/order-theory/monotonic-sequences-posets.lagda.md index 7a8e545bc2..0c5a0bc170 100644 --- a/src/order-theory/monotonic-sequences-posets.lagda.md +++ b/src/order-theory/monotonic-sequences-posets.lagda.md @@ -7,30 +7,17 @@ module order-theory.monotonic-sequences-posets where
Imports ```agda -open import elementary-number-theory.addition-natural-numbers -open import elementary-number-theory.based-induction-natural-numbers -open import elementary-number-theory.inequality-natural-numbers -open import elementary-number-theory.natural-numbers -open import elementary-number-theory.strictly-increasing-sequences-natural-numbers - -open import foundation.asymptotical-dependent-sequences open import foundation.asymptotically-constant-sequences -open import foundation.binary-relations -open import foundation.constant-sequences -open import foundation.coproduct-types open import foundation.dependent-pair-types -open import foundation.empty-types open import foundation.function-types -open import foundation.functoriality-coproduct-types open import foundation.functoriality-dependent-pair-types -open import foundation.identity-types -open import foundation.negation -open import foundation.propositions -open import foundation.sequences open import foundation.subsequences open import foundation.transport-along-identifications open import foundation.universe-levels +open import order-theory.constant-sequences-posets +open import order-theory.decreasing-sequences-posets +open import order-theory.increasing-sequences-posets open import order-theory.posets open import order-theory.sequences-posets ``` @@ -39,389 +26,13 @@ open import order-theory.sequences-posets ## Idea -Monotonic sequences in partially ordered sets are sequences that preserve or -reverse the -[standard ordering on the natural numbers](elementary-number-theory.inequality-natural-numbers.md). - -## Definitions - -### Monotonic values of sequences in partially ordered sets - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) (n : ℕ) - where - - is-increasing-value-prop-sequence-poset : Prop l2 - is-increasing-value-prop-sequence-poset = - leq-Poset-Prop P (u n) (u (succ-ℕ n)) - - is-increasing-value-sequence-poset : UU l2 - is-increasing-value-sequence-poset = - type-Prop is-increasing-value-prop-sequence-poset - - is-prop-is-increasing-value-sequence-poset : - is-prop is-increasing-value-sequence-poset - is-prop-is-increasing-value-sequence-poset = - is-prop-type-Prop is-increasing-value-prop-sequence-poset - - is-decreasing-value-prop-sequence-poset : Prop l2 - is-decreasing-value-prop-sequence-poset = - leq-Poset-Prop P (u (succ-ℕ n)) (u n) - - is-decreasing-value-sequence-poset : UU l2 - is-decreasing-value-sequence-poset = - type-Prop is-decreasing-value-prop-sequence-poset - - is-prop-is-decreasing-value-sequence-poset : - is-prop is-decreasing-value-sequence-poset - is-prop-is-decreasing-value-sequence-poset = - is-prop-type-Prop is-decreasing-value-prop-sequence-poset -``` - -### Monotonic sequences in partially ordered sets - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) - where - - is-increasing-prop-sequence-poset : Prop l2 - is-increasing-prop-sequence-poset = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → - hom-Prop - ( leq-ℕ-Prop i j) - ( leq-Poset-Prop P (u i) (u j)))) - - is-increasing-sequence-poset : UU l2 - is-increasing-sequence-poset = - type-Prop is-increasing-prop-sequence-poset - - is-prop-is-increasing-sequence-poset : - is-prop is-increasing-sequence-poset - is-prop-is-increasing-sequence-poset = - is-prop-type-Prop is-increasing-prop-sequence-poset - - is-decreasing-prop-sequence-poset : Prop l2 - is-decreasing-prop-sequence-poset = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → - hom-Prop - ( leq-ℕ-Prop i j) - ( leq-Poset-Prop P (u j) (u i)))) - - is-decreasing-sequence-poset : UU l2 - is-decreasing-sequence-poset = - type-Prop is-decreasing-prop-sequence-poset - - is-prop-is-decreasing-sequence-poset : - is-prop is-decreasing-sequence-poset - is-prop-is-decreasing-sequence-poset = - is-prop-type-Prop is-decreasing-prop-sequence-poset -``` +A [sequence in a partially ordered set](order-theory.sequences-posets.md) is +**monotonic** if it is [increasing](order-theory.increasing-sequences-posets.md) +or [decreasing](order-theory.decreasing-sequences-posets.md). ## Properties -### Any value of a sequence in a partially ordered set is stationnary if and only if it is both increasing and decreasing - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) (n : ℕ) - where - - increasing-value-is-stationnary-value-sequence-poset : - is-stationnary-value-sequence u n → - is-increasing-value-sequence-poset P u n - increasing-value-is-stationnary-value-sequence-poset H = - leq-eq-Poset P H - - decreasing-value-is-stationnary-value-sequence-poset : - is-stationnary-value-sequence u n → - is-decreasing-value-sequence-poset P u n - decreasing-value-is-stationnary-value-sequence-poset H = - leq-eq-Poset P (inv H) - - stationnary-value-is-increasing-decreasing-value-sequence-poset : - is-increasing-value-sequence-poset P u n → - is-decreasing-value-sequence-poset P u n → - is-stationnary-value-sequence u n - stationnary-value-is-increasing-decreasing-value-sequence-poset = - antisymmetric-leq-Poset P (u n) (u (succ-ℕ n)) -``` - -### A sequence in a partially ordered set is monotonic if and only if all its values are monotonic with the same monotonicity - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} - where - - increasing-sequence-is-increasing-value-sequence-poset : - ((n : ℕ) → is-increasing-value-sequence-poset P u n) → - is-increasing-sequence-poset P u - increasing-sequence-is-increasing-value-sequence-poset H p = - based-ind-ℕ - ( p) - ( λ q → leq-Poset P (u p) (u q)) - ( refl-leq-Poset P (u p)) - ( λ q I → - transitive-leq-Poset P (u p) (u q) (u (succ-ℕ q)) (H q)) - - increasing-value-is-increasing-sequence-poset : - is-increasing-sequence-poset P u → - ((n : ℕ) → is-increasing-value-sequence-poset P u n) - increasing-value-is-increasing-sequence-poset H n = - H n (succ-ℕ n) (succ-leq-ℕ n) - - decreasing-sequence-is-decreasing-value-sequence-poset : - ((n : ℕ) → is-decreasing-value-sequence-poset P u n) → - is-decreasing-sequence-poset P u - decreasing-sequence-is-decreasing-value-sequence-poset H p = - based-ind-ℕ - ( p) - ( λ q → leq-Poset P (u q) (u p)) - ( refl-leq-Poset P (u p)) - ( λ q I J → - transitive-leq-Poset P (u (succ-ℕ q)) (u q) (u p) J (H q)) - - decreasing-value-is-decreasing-sequence-poset : - is-decreasing-sequence-poset P u → - ((n : ℕ) → is-decreasing-value-sequence-poset P u n) - decreasing-value-is-decreasing-sequence-poset H n = - H n (succ-ℕ n) (succ-leq-ℕ n) -``` - -### A sequence in a partially ordered set is constant if and only if it is both increasing and decreasing - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} - where - - increasing-is-constant-sequence-poset : - is-constant-sequence u → is-increasing-sequence-poset P u - increasing-is-constant-sequence-poset H p q I = leq-eq-Poset P (H p q) - - decreasing-is-constant-sequence-poset : - is-constant-sequence u → is-decreasing-sequence-poset P u - decreasing-is-constant-sequence-poset H p q I = leq-eq-Poset P (H q p) - - constant-is-increasing-decreasing-sequence-poset : - is-increasing-sequence-poset P u → - is-decreasing-sequence-poset P u → - is-constant-sequence u - constant-is-increasing-decreasing-sequence-poset I J p q = - rec-coproduct - ( λ H → antisymmetric-leq-Poset P (u p) (u q) (I p q H) (J p q H)) - ( λ H → antisymmetric-leq-Poset P (u p) (u q) (J q p H) (I q p H)) - ( linear-leq-ℕ p q) -``` - -### Any subsequence of a monotonic sequence in a partially ordered set is monotonic - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) - where - - increasing-Π-subsequence-increasing-sequence-poset : - is-increasing-sequence-poset P u → - Π-subsequence (is-increasing-sequence-poset P) u - increasing-Π-subsequence-increasing-sequence-poset H v p q I = - H - ( extract-subsequence u v p) - ( extract-subsequence u v q) - ( preserves-leq-extract-subsequence u v p q I) - - decreasing-Π-subsequence-decreasing-sequence-poset : - is-decreasing-sequence-poset P u → - Π-subsequence (is-decreasing-sequence-poset P) u - decreasing-Π-subsequence-decreasing-sequence-poset H v p q I = - H - ( extract-subsequence u v p) - ( extract-subsequence u v q) - ( preserves-leq-extract-subsequence u v p q I) -``` - -### A sequence in a partially ordered set is increasing if and only if it is lesser than all its subsequences - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) - where - - increasing-Π-subsequence-leq-sequence-poset : - Π-subsequence (λ v → leq-sequence-poset P u v) u → - is-increasing-sequence-poset P u - increasing-Π-subsequence-leq-sequence-poset H = - increasing-sequence-is-increasing-value-sequence-poset - ( P) - ( H (skip-zero-sequence u)) - - Π-subsequence-leq-increasing-sequence-Poset : - is-increasing-sequence-poset P u → - Π-subsequence (λ v → leq-sequence-poset P u v) u - Π-subsequence-leq-increasing-sequence-Poset H v n = - H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) -``` - -### A sequence in a partially ordered set is decreasing if and only if it is greater than all its subsequences - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) - where - - decreasing-Π-subsequence-leq-sequence-poset : - Π-subsequence (λ v → leq-sequence-poset P v u) u → - is-decreasing-sequence-poset P u - decreasing-Π-subsequence-leq-sequence-poset H = - decreasing-sequence-is-decreasing-value-sequence-poset - ( P) - ( H (skip-zero-sequence u)) - - Π-subsequence-leq-decreasing-sequence-Poset : - is-decreasing-sequence-poset P u → - Π-subsequence (λ v → leq-sequence-poset P v u) u - Π-subsequence-leq-decreasing-sequence-Poset H v n = - H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) -``` - -### A monotonic sequence `u` with `u (p + n) = u n` is constant between `n` and `p + n` - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) - (p n : ℕ) (I : u (p +ℕ n) = u n) - where - - constant-value-is-stationnary-interval-increasing-sequence-poset : - is-increasing-sequence-poset P u → - (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n - constant-value-is-stationnary-interval-increasing-sequence-poset H k J = - antisymmetric-leq-Poset - ( P) - ( u (k +ℕ n)) - ( u n) - ( concatenate-leq-eq-Poset - ( P) - ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J)) - ( I)) - ( H n (k +ℕ n) (leq-add-ℕ' n k)) - - constant-value-is-stationnary-interval-decreasing-sequence-poset : - is-decreasing-sequence-poset P u → - (k : ℕ) (J : leq-ℕ k p) → u (k +ℕ n) = u n - constant-value-is-stationnary-interval-decreasing-sequence-poset H k J = - antisymmetric-leq-Poset - ( P) - ( u (k +ℕ n)) - ( u n) - ( H n (k +ℕ n) (leq-add-ℕ' n k)) - ( concatenate-eq-leq-Poset - ( P) - ( inv I) - ( H (k +ℕ n) (p +ℕ n) (preserves-leq-left-add-ℕ n k p J))) -``` - -### Asymptotical behavior - -#### A monotonic sequence in a partially ordered set with a constant subsequence is asymptotically constant - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} - where - - ∞-constant-Σ-subsequence-constant-increasing-sequence-poset : - is-increasing-sequence-poset P u → - Σ-subsequence is-constant-sequence u → - is-∞-constant-sequence u - ∞-constant-Σ-subsequence-constant-increasing-sequence-poset H = - rec-Σ - ( λ v K → - ∞-constant-is-∞-value-sequence - ( u (extract-subsequence u v zero-ℕ)) - ( u) - ( ( extract-subsequence u v zero-ℕ) , - ( λ n I → - antisymmetric-leq-Poset - ( P) - ( sequence-subsequence u v zero-ℕ) - ( u n) - ( H (extract-subsequence u v zero-ℕ) n I) - ( concatenate-leq-eq-Poset - ( P) - ( H - ( n) - ( extract-modulus-subsequence u v n) - ( leq-extract-modulus-subsequence u v n)) - ( K (modulus-subsequence u v n) zero-ℕ))))) - - ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset : - is-decreasing-sequence-poset P u → - Σ-subsequence is-constant-sequence u → - is-∞-constant-sequence u - ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset H = - rec-Σ - ( λ v K → - ∞-constant-is-∞-value-sequence - ( u (extract-subsequence u v zero-ℕ)) - ( u) - ( ( extract-subsequence u v zero-ℕ) , - ( λ n I → - antisymmetric-leq-Poset - ( P) - ( sequence-subsequence u v zero-ℕ) - ( u n) - ( concatenate-eq-leq-Poset - ( P) - ( K zero-ℕ (modulus-subsequence u v n)) - ( H - ( n) - ( extract-modulus-subsequence u v n) - ( leq-extract-modulus-subsequence u v n))) - ( H (extract-subsequence u v zero-ℕ) n I)))) -``` - -#### A monotonic sequence in a partially ordered set with an asymptotically constant subsequence is asymptotically constant - -```agda -module _ - {l1 l2 : Level} (P : Poset l1 l2) {u : sequence-poset P} - where - - ∞-constant-Σ-subsequence-∞-constant-increasing-sequence-poset : - is-increasing-sequence-poset P u → - Σ-subsequence is-∞-constant-sequence u → - is-∞-constant-sequence u - ∞-constant-Σ-subsequence-∞-constant-increasing-sequence-poset H = - ( ∞-constant-Σ-subsequence-constant-increasing-sequence-poset P H) ∘ - ( rec-Σ - ( λ v → - ( rec-Σ ( λ w I → ( sub-subsequence u v w , I))) ∘ - ( constant-subsequence-is-∞-constant-sequence - ( sequence-subsequence u v)))) - - ∞-constant-Σ-subsequence-∞-constant-decreasing-sequence-poset : - is-decreasing-sequence-poset P u → - Σ-subsequence is-∞-constant-sequence u → - is-∞-constant-sequence u - ∞-constant-Σ-subsequence-∞-constant-decreasing-sequence-poset H = - ( ∞-constant-Σ-subsequence-constant-decreasing-sequence-poset P H) ∘ - ( rec-Σ - ( λ v → - ( rec-Σ (λ w I → (sub-subsequence u v w , I))) ∘ - ( constant-subsequence-is-∞-constant-sequence - ( sequence-subsequence u v)))) -``` - -#### An increasing sequence in a partially ordered set with a decreasing subsequence is asymptotically constant +### An increasing sequence in a partially ordered set with a decreasing subsequence is asymptotically constant ```agda module _ @@ -439,7 +50,7 @@ module _ ( increasing-Π-subsequence-increasing-sequence-poset P u H))) ``` -#### A decreasing sequence in a partially ordered set with an increasing subsequence is asymptotically constant +### A decreasing sequence in a partially ordered set with an increasing subsequence is asymptotically constant ```agda module _ diff --git a/src/order-theory/sequences-posets.lagda.md b/src/order-theory/sequences-posets.lagda.md index a4c5f91a5e..168d1e47ea 100644 --- a/src/order-theory/sequences-posets.lagda.md +++ b/src/order-theory/sequences-posets.lagda.md @@ -45,6 +45,40 @@ module _ sequence-poset = sequence (type-Poset P) ``` +### Monotonic values of sequences in partially ordered sets + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) (n : ℕ) + where + + is-increasing-value-prop-sequence-poset : Prop l2 + is-increasing-value-prop-sequence-poset = + leq-Poset-Prop P (u n) (u (succ-ℕ n)) + + is-increasing-value-sequence-poset : UU l2 + is-increasing-value-sequence-poset = + type-Prop is-increasing-value-prop-sequence-poset + + is-prop-is-increasing-value-sequence-poset : + is-prop is-increasing-value-sequence-poset + is-prop-is-increasing-value-sequence-poset = + is-prop-type-Prop is-increasing-value-prop-sequence-poset + + is-decreasing-value-prop-sequence-poset : Prop l2 + is-decreasing-value-prop-sequence-poset = + leq-Poset-Prop P (u (succ-ℕ n)) (u n) + + is-decreasing-value-sequence-poset : UU l2 + is-decreasing-value-sequence-poset = + type-Prop is-decreasing-value-prop-sequence-poset + + is-prop-is-decreasing-value-sequence-poset : + is-prop is-decreasing-value-sequence-poset + is-prop-is-decreasing-value-sequence-poset = + is-prop-type-Prop is-decreasing-value-prop-sequence-poset +``` + ### Pointwise comparison on sequences in partially ordered sets ```agda @@ -167,6 +201,33 @@ module _ ## Properties +### Any value of a sequence in a partially ordered set is stationnary if and only if it is both increasing and decreasing + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (u : sequence-poset P) (n : ℕ) + where + + increasing-value-is-stationnary-value-sequence-poset : + is-stationnary-value-sequence u n → + is-increasing-value-sequence-poset P u n + increasing-value-is-stationnary-value-sequence-poset H = + leq-eq-Poset P H + + decreasing-value-is-stationnary-value-sequence-poset : + is-stationnary-value-sequence u n → + is-decreasing-value-sequence-poset P u n + decreasing-value-is-stationnary-value-sequence-poset H = + leq-eq-Poset P (inv H) + + stationnary-value-is-increasing-decreasing-value-sequence-poset : + is-increasing-value-sequence-poset P u n → + is-decreasing-value-sequence-poset P u n → + is-stationnary-value-sequence u n + stationnary-value-is-increasing-decreasing-value-sequence-poset = + antisymmetric-leq-Poset P (u n) (u (succ-ℕ n)) +``` + ### Asymptotical values preserve asymptotical inequality of sequences in partially ordered sets ```agda From da703185e826cfd87883f1f2f9c655f6b6bf7c09 Mon Sep 17 00:00:00 2001 From: malarbol Date: Mon, 10 Jun 2024 21:57:37 +0200 Subject: [PATCH 63/67] use preserves-order-Poset --- src/order-theory/increasing-sequences-posets.lagda.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/order-theory/increasing-sequences-posets.lagda.md b/src/order-theory/increasing-sequences-posets.lagda.md index 047d9231f3..568c4c23ab 100644 --- a/src/order-theory/increasing-sequences-posets.lagda.md +++ b/src/order-theory/increasing-sequences-posets.lagda.md @@ -24,6 +24,7 @@ open import foundation.sequences open import foundation.subsequences open import foundation.universe-levels +open import order-theory.order-preserving-maps-posets open import order-theory.posets open import order-theory.sequences-posets ``` @@ -47,13 +48,7 @@ module _ is-increasing-prop-sequence-poset : Prop l2 is-increasing-prop-sequence-poset = - Π-Prop ℕ - ( λ i → - Π-Prop ℕ - ( λ j → - hom-Prop - ( leq-ℕ-Prop i j) - ( leq-Poset-Prop P (u i) (u j)))) + preserves-order-Poset-Prop ℕ-Poset P u is-increasing-sequence-poset : UU l2 is-increasing-sequence-poset = From 43434a9e053543cb268a2006d0601747a283973d Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 11 Jun 2024 19:43:06 +0200 Subject: [PATCH 64/67] cleanup --- .../decreasing-sequences-natural-numbers.lagda.md | 7 ++++--- ...y-increasing-sequences-natural-numbers.lagda.md | 14 +++++++------- .../asymptotically-constant-sequences.lagda.md | 2 +- src/foundation/subsequences.lagda.md | 2 +- .../decreasing-sequences-posets.lagda.md | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md index aa80be79c5..92dc34446c 100644 --- a/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md @@ -16,6 +16,7 @@ open import elementary-number-theory.strictly-decreasing-sequences-natural-numbe open import elementary-number-theory.strictly-increasing-sequences-natural-numbers open import foundation.asymptotical-dependent-sequences +open import foundation.asymptotical-value-sequences open import foundation.asymptotically-constant-sequences open import foundation.cartesian-product-types open import foundation.constant-sequences @@ -79,9 +80,9 @@ module _ {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where - eq-∞-zero-is-zero-value-decreasing-sequence-ℕ : - Σ ℕ (λ n → zero-ℕ = f n) → asymptotically (λ n → zero-ℕ = f n) - eq-∞-zero-is-zero-value-decreasing-sequence-ℕ = + is-∞-zero-value-is-zero-value-decreasing-sequence-ℕ : + Σ ℕ (is-value-sequence zero-ℕ f) → is-∞-value-sequence zero-ℕ f + is-∞-zero-value-is-zero-value-decreasing-sequence-ℕ = tot ( λ n K k I → is-zero-leq-zero-ℕ' diff --git a/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md index 202ae189f1..88284ead5f 100644 --- a/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/strictly-increasing-sequences-natural-numbers.lagda.md @@ -45,8 +45,8 @@ module _ (f : sequence ℕ) where - is-strict-increasing-sequence-prop-ℕ : Prop lzero - is-strict-increasing-sequence-prop-ℕ = + is-strict-increasing-prop-sequence-ℕ : Prop lzero + is-strict-increasing-prop-sequence-ℕ = Π-Prop ℕ ( λ i → Π-Prop ℕ @@ -54,19 +54,19 @@ module _ is-strict-increasing-sequence-ℕ : UU lzero is-strict-increasing-sequence-ℕ = - type-Prop is-strict-increasing-sequence-prop-ℕ + type-Prop is-strict-increasing-prop-sequence-ℕ is-prop-is-strict-increasing-sequence-ℕ : is-prop is-strict-increasing-sequence-ℕ is-prop-is-strict-increasing-sequence-ℕ = - is-prop-type-Prop is-strict-increasing-sequence-prop-ℕ + is-prop-type-Prop is-strict-increasing-prop-sequence-ℕ ``` ### The type of strictly increasing sequences of natural numbers ```agda strict-increasing-sequence-ℕ : UU lzero -strict-increasing-sequence-ℕ = type-subtype is-strict-increasing-sequence-prop-ℕ +strict-increasing-sequence-ℕ = type-subtype is-strict-increasing-prop-sequence-ℕ module _ (f : strict-increasing-sequence-ℕ) @@ -129,11 +129,10 @@ module _ ( leq-succ-le-ℕ p q I) module _ - (f : strict-increasing-sequence-ℕ) + (f : strict-increasing-sequence-ℕ) (n : ℕ) where strict-increasing-value-strict-increasing-sequence-ℕ : - (n : ℕ) → is-strict-increasing-value-sequence-ℕ (sequence-strict-increasing-sequence-ℕ f) (n) @@ -141,6 +140,7 @@ module _ strict-increasing-value-is-strict-increasing-sequence-ℕ ( sequence-strict-increasing-sequence-ℕ f) ( is-strict-increasing-sequence-strict-increasing-sequence-ℕ f) + ( n) ``` ### Strictly increasing sequences of natural numbers preserve inequality diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index 0545a89b2c..d78f8d6829 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -214,7 +214,7 @@ module _ ### Asymptotically stationnary sequences -#### The type of being asymptotically stationnary +#### The predicate of being asymptotically stationnary ```agda module _ diff --git a/src/foundation/subsequences.lagda.md b/src/foundation/subsequences.lagda.md index 8f23578def..4cabe4a7e4 100644 --- a/src/foundation/subsequences.lagda.md +++ b/src/foundation/subsequences.lagda.md @@ -170,7 +170,7 @@ module _ compute-map-subsequence = refl ``` -### Modulus of a subsquence +### Modulus of a subsequence ```agda module _ diff --git a/src/order-theory/decreasing-sequences-posets.lagda.md b/src/order-theory/decreasing-sequences-posets.lagda.md index 55892002c8..75b7f92f38 100644 --- a/src/order-theory/decreasing-sequences-posets.lagda.md +++ b/src/order-theory/decreasing-sequences-posets.lagda.md @@ -125,10 +125,10 @@ module _ ( P) ( H (skip-zero-sequence u)) - Π-subsequence-leq-decreasing-sequence-Poset : + Π-subsequence-leq-decreasing-sequence-poset : is-decreasing-sequence-poset P u → Π-subsequence (λ v → leq-sequence-poset P v u) u - Π-subsequence-leq-decreasing-sequence-Poset H v n = + Π-subsequence-leq-decreasing-sequence-poset H v n = H n (extract-subsequence u v n) (leq-id-extract-subsequence u v n) ``` From 92c431a7edbb102118e35475676d61e59c2f6aa0 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 11 Jun 2024 19:55:45 +0200 Subject: [PATCH 65/67] fix typo --- .../decreasing-sequences-natural-numbers.lagda.md | 2 +- .../increasing-sequences-natural-numbers.lagda.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md index 92dc34446c..c0af103770 100644 --- a/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md @@ -43,7 +43,7 @@ open import order-theory.sequences-posets ## Idea -A sequences of natural numbers is **decreasing** if it reverses +A sequence of natural numbers is **decreasing** if it reverses [inequality of natural numbers](elementary-number-theory.inequality-natural-numbers.md). ## Definitions diff --git a/src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md index 0b8be82360..bdc7711943 100644 --- a/src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/increasing-sequences-natural-numbers.lagda.md @@ -28,7 +28,7 @@ open import order-theory.sequences-posets ## Idea -A sequences of natural numbers is **increasing** if it preserves +A sequence of natural numbers is **increasing** if it preserves [inequality of natural numbers](elementary-number-theory.inequality-natural-numbers.md). ## Definitions From 23c2f9f1ab5bcdb0cfac0a24468ecea78ee48248 Mon Sep 17 00:00:00 2001 From: malarbol Date: Tue, 11 Jun 2024 20:01:54 +0200 Subject: [PATCH 66/67] cleanup --- src/foundation/asymptotically-constant-sequences.lagda.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/foundation/asymptotically-constant-sequences.lagda.md b/src/foundation/asymptotically-constant-sequences.lagda.md index d78f8d6829..07fc4e0185 100644 --- a/src/foundation/asymptotically-constant-sequences.lagda.md +++ b/src/foundation/asymptotically-constant-sequences.lagda.md @@ -85,9 +85,9 @@ module _ {l : Level} {A : UU l} {u : sequence A} (H : is-constant-sequence u) where - is-∞-constant-is-constant-sequence : is-∞-constant-sequence u - pr1 is-∞-constant-is-constant-sequence = zero-ℕ - pr2 is-∞-constant-is-constant-sequence p I = (zero-ℕ , λ q J → H p q) + ∞-constant-is-constant-sequence : is-∞-constant-sequence u + pr1 ∞-constant-is-constant-sequence = zero-ℕ + pr2 ∞-constant-is-constant-sequence p I = (zero-ℕ , λ q J → H p q) ``` ### The asymptotical value of an asymptotically constant sequence is unique From 17deaa934be5290eb8d9df643a4e09d6994e660d Mon Sep 17 00:00:00 2001 From: malarbol Date: Thu, 13 Jun 2024 18:39:13 +0200 Subject: [PATCH 67/67] cleanup --- .../decreasing-sequences-natural-numbers.lagda.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md index c0af103770..4ef89df848 100644 --- a/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md +++ b/src/elementary-number-theory/decreasing-sequences-natural-numbers.lagda.md @@ -80,9 +80,9 @@ module _ {f : sequence ℕ} (H : is-decreasing-sequence-ℕ f) where - is-∞-zero-value-is-zero-value-decreasing-sequence-ℕ : + ∞-zero-value-is-zero-value-decreasing-sequence-ℕ : Σ ℕ (is-value-sequence zero-ℕ f) → is-∞-value-sequence zero-ℕ f - is-∞-zero-value-is-zero-value-decreasing-sequence-ℕ = + ∞-zero-value-is-zero-value-decreasing-sequence-ℕ = tot ( λ n K k I → is-zero-leq-zero-ℕ'