The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Data.Nat.ChineseRemainder

16 declarations. Mathlib docs · Source

Chinese Remainder Theorem

This file provides definitions and theorems for the Chinese Remainder Theorem. These are used in Gödel's Beta function, which is used in proving Gödel's incompleteness theorems.

Main result

  • chineseRemainderOfList: Definition of the Chinese remainder of a list

Tags

Chinese Remainder Theorem, Gödel, beta function

theorem Nat.chineseRemainderOfList.match_1.congr_eq_1 E1 #

∀ {ι : Type u_1} (s : ι → ℕ) (motive : (x : List ι) → List.Pairwise (Function.onFun Nat.Coprime s) x → Sort u_2)
  (x : List ι) (x_1 : List.Pairwise (Function.onFun Nat.Coprime s) x)
  (h_1 : (x : List.Pairwise (Function.onFun Nat.Coprime s) []) → motive [] x)
  (h_2 : (i : ι) → (l : List ι) → (co : List.Pairwise (Function.onFun Nat.Coprime s) (i :: l)) → motive (i :: l) co)
  (x_2 : List.Pairwise (Function.onFun Nat.Coprime s) []),
  x = [] →
    x_1 ≍ x_2 →
      (match x, x_1 with
        | [], x => h_1 x
        | i :: l, co => h_2 i l co) ≍
        h_1 x_2

theorem Quotient.recOn.congr_simp E1 #

∀ {α : Sort u} {s : Setoid α} {motive : Quotient s → Sort v} (q : Quotient s) (f f_1 : (a : α) → motive ⟦a⟧)
  (e_f : f = f_1) (h : ∀ (a b : α) (p : a ≈ b), ⋯ ▸ f a = f b), Quotient.recOn q f h = Quotient.recOn q f_1 ⋯

theorem Nat.chineseRemainderOfList.match_1.congr_eq_2 E1 #

∀ {ι : Type u_1} (s : ι → ℕ) (motive : (x : List ι) → List.Pairwise (Function.onFun Nat.Coprime s) x → Sort u_2)
  (x : List ι) (x_1 : List.Pairwise (Function.onFun Nat.Coprime s) x)
  (h_1 : (x : List.Pairwise (Function.onFun Nat.Coprime s) []) → motive [] x)
  (h_2 : (i : ι) → (l : List ι) → (co : List.Pairwise (Function.onFun Nat.Coprime s) (i :: l)) → motive (i :: l) co)
  (i : ι) (l : List ι) (co : List.Pairwise (Function.onFun Nat.Coprime s) (i :: l)),
  x = i :: l →
    x_1 ≍ co →
      (match x, x_1 with
        | [], x => h_1 x
        | i :: l, co => h_2 i l co) ≍
        h_2 i l co

theorem Nat.chineseRemainderOfMultiset.congr_simp E1 #

∀ {ι : Type u_1} (a s : ι → ℕ) {m : Multiset ι} (a_1 : m.Nodup) (a_2 : ∀ i ∈ m, s i ≠ 0)
  (a_3 : {x | x ∈ m}.Pairwise (Function.onFun Nat.Coprime s)),
  Nat.chineseRemainderOfMultiset a s a_1 a_2 a_3 = Nat.chineseRemainderOfMultiset a s a_1 a_2 a_3

theorem Nat.chineseRemainderOfList.congr_simp E1 #

∀ {ι : Type u_1} (a s : ι → ℕ) (l : List ι) (a_1 : List.Pairwise (Function.onFun Nat.Coprime s) l),
  Nat.chineseRemainderOfList a s l a_1 = Nat.chineseRemainderOfList a s l a_1

theorem Nat.modEq_list_prod_iff E0 #

∀ {a b : ℕ} {l : List ℕ}, List.Pairwise Nat.Coprime l → (a ≡ b [MOD l.prod] ↔ ∀ (i : Fin l.length), a ≡ b [MOD l.get i])

theorem Nat.modEq_list_map_prod_iff E0 #

∀ {ι : Type u_1} {a b : ℕ} {s : ι → ℕ} {l : List ι},
  List.Pairwise (Function.onFun Nat.Coprime s) l → (a ≡ b [MOD (List.map s l).prod] ↔ ∀ i ∈ l, a ≡ b [MOD s i])

def Nat.chineseRemainderOfList E3 #

{ι : Type u_1} →
  (a s : ι → ℕ) → (l : List ι) → List.Pairwise (Function.onFun Nat.Coprime s) l → { k // ∀ i ∈ l, k ≡ a i [MOD s i] }

The natural number less than (l.map s).prod congruent to a i mod s i for all i ∈ l.

theorem Nat.chineseRemainderOfList_nil E0 #

∀ {ι : Type u_1} (a s : ι → ℕ), ↑(Nat.chineseRemainderOfList a s [] ⋯) = 0

theorem Nat.chineseRemainderOfList_lt_prod E1 #

∀ {ι : Type u_1} (a s : ι → ℕ) (l : List ι) (co : List.Pairwise (Function.onFun Nat.Coprime s) l),
  (∀ i ∈ l, s i ≠ 0) → ↑(Nat.chineseRemainderOfList a s l co) < (List.map s l).prod

theorem Nat.chineseRemainderOfList_modEq_unique E1 #

∀ {ι : Type u_1} (a s : ι → ℕ) (l : List ι) (co : List.Pairwise (Function.onFun Nat.Coprime s) l) {z : ℕ},
  (∀ i ∈ l, z ≡ a i [MOD s i]) → z ≡ ↑(Nat.chineseRemainderOfList a s l co) [MOD (List.map s l).prod]

theorem Nat.chineseRemainderOfList_perm E1 #

∀ {ι : Type u_1} (a s : ι → ℕ) {l l' : List ι} (hl : l.Perm l'),
  (∀ i ∈ l, s i ≠ 0) →
    ∀ (co : List.Pairwise (Function.onFun Nat.Coprime s) l),
      ↑(Nat.chineseRemainderOfList a s l co) = ↑(Nat.chineseRemainderOfList a s l' ⋯)

def Nat.chineseRemainderOfMultiset E1 #

{ι : Type u_1} →
  (a s : ι → ℕ) →
    {m : Multiset ι} →
      m.Nodup →
        (∀ i ∈ m, s i ≠ 0) → {x | x ∈ m}.Pairwise (Function.onFun Nat.Coprime s) → { k // ∀ i ∈ m, k ≡ a i [MOD s i] }

The natural number less than (m.map s).prod congruent to a i mod s i for all i ∈ m.

theorem Nat.chineseRemainderOfMultiset_lt_prod E1 #

∀ {ι : Type u_1} (a s : ι → ℕ) {m : Multiset ι} (nod : m.Nodup) (hs : ∀ i ∈ m, s i ≠ 0)
  (pp : {x | x ∈ m}.Pairwise (Function.onFun Nat.Coprime s)),
  ↑(Nat.chineseRemainderOfMultiset a s nod hs pp) < (Multiset.map s m).prod

def Nat.chineseRemainderOfFinset E1 #

{ι : Type u_1} →
  (a s : ι → ℕ) →
    (t : Finset ι) →
      (∀ i ∈ t, s i ≠ 0) → (↑t).Pairwise (Function.onFun Nat.Coprime s) → { k // ∀ i ∈ t, k ≡ a i [MOD s i] }

The natural number less than ∏ i ∈ t, s i congruent to a i mod s i for all i ∈ t.

theorem Nat.chineseRemainderOfFinset_lt_prod E1 #

∀ {ι : Type u_1} (a s : ι → ℕ) {t : Finset ι} (hs : ∀ i ∈ t, s i ≠ 0)
  (pp : (↑t).Pairwise (Function.onFun Nat.Coprime s)), ↑(Nat.chineseRemainderOfFinset a s t hs pp) < ∏ i ∈ t, s i