File: Mathlib/Data/Nat/ChineseRemainder.lean

full_name: Nat.modEq_list_prod_iff
code: lemma modEq_list_prod_iff {a b} {l : List ℕ} (co : l.Pairwise Coprime) :
    a ≡ b [MOD l.prod] ↔ ∀ i, a ≡ b [MOD l.get i] 
goal: a ≡ b [MOD l.prod] ↔ ∀ (i : Fin l.length), a ≡ b [MOD l.get i]

full_name: Nat.modEq_list_prod_iff'
code: lemma modEq_list_prod_iff' {a b} {s : ι → ℕ} {l : List ι} (co : l.Pairwise (Coprime on s)) :
    a ≡ b [MOD (l.map s).prod] ↔ ∀ i ∈ l, a ≡ b [MOD s i] 
goal: a ≡ b [MOD (List.map s l).prod] ↔ ∀ i ∈ l, a ≡ b [MOD s i]

full_name: Nat.chineseRemainderOfList
code: /-- The natural number less than `(l.map s).prod` congruent to
`a i` mod `s i` for all  `i ∈ l`. -/
def chineseRemainderOfList : (l : List ι) → l.Pairwise (Coprime on s) →
    { k // ∀ i ∈ l, k ≡ a i [MOD s i] }
  
goal: List.Pairwise (Nat.Coprime on s) l → { k // ∀ i ∈ l, k ≡ a i [MOD s i] }

full_name: Nat.chineseRemainderOfList_nil
code: @[simp] theorem chineseRemainderOfList_nil :
    (chineseRemainderOfList a s [] List.Pairwise.nil : ℕ) = 0 
goal: ↑(Nat.chineseRemainderOfList a s [] ⋯) = 0

full_name: Nat.chineseRemainderOfList_lt_prod
code: theorem chineseRemainderOfList_lt_prod (l : List ι)
    (co : l.Pairwise (Coprime on s)) (hs : ∀ i ∈ l, s i ≠ 0) :
    chineseRemainderOfList a s l co < (l.map s).prod 
goal: ↑(Nat.chineseRemainderOfList a s l co) < (List.map s l).prod

full_name: Nat.chineseRemainderOfList_modEq_unique
code: theorem chineseRemainderOfList_modEq_unique (l : List ι)
    (co : l.Pairwise (Coprime on s)) {z} (hz : ∀ i ∈ l, z ≡ a i [MOD s i]) :
    z ≡ chineseRemainderOfList a s l co [MOD (l.map s).prod] 
goal: z ≡ ↑(Nat.chineseRemainderOfList a s l co) [MOD (List.map s l).prod]

full_name: Nat.chineseRemainderOfList_perm
code: theorem chineseRemainderOfList_perm {l l' : List ι} (hl : l.Perm l')
    (hs : ∀ i ∈ l, s i ≠ 0) (co : l.Pairwise (Coprime on s)) :
    (chineseRemainderOfList a s l co : ℕ) =
    chineseRemainderOfList a s l' (co.perm hl coprime_comm.mpr) 
goal: ↑(Nat.chineseRemainderOfList a s l co) = ↑(Nat.chineseRemainderOfList a s l' ⋯)

full_name: Nat.chineseRemainderOfMultiset
code: /-- The natural number less than `(m.map s).prod` congruent to
`a i` mod `s i` for all  `i ∈ m`. -/
def chineseRemainderOfMultiset {m : Multiset ι} :
    m.Nodup → (∀ i ∈ m, s i ≠ 0) → Set.Pairwise {x | x ∈ m} (Coprime on s) →
    { k // ∀ i ∈ m, k ≡ a i [MOD s i] } 
goal: m.Nodup → (∀ i ∈ m, s i ≠ 0) → {x | x ∈ m}.Pairwise (Nat.Coprime on s) → { k // ∀ i ∈ m, k ≡ a i [MOD s i] }

full_name: Nat.chineseRemainderOfMultiset_lt_prod
code: theorem chineseRemainderOfMultiset_lt_prod {m : Multiset ι}
    (nod : m.Nodup) (hs : ∀ i ∈ m, s i ≠ 0) (pp : Set.Pairwise {x | x ∈ m} (Coprime on s)) :
    chineseRemainderOfMultiset a s nod hs pp < (m.map s).prod 
goal: ↑(Nat.chineseRemainderOfMultiset a s nod hs pp) < (Multiset.map s m).prod

full_name: Nat.chineseRemainderOfFinset
code: /-- The natural number less than `∏ i ∈ t, s i` congruent to
`a i` mod `s i` for all  `i ∈ t`. -/
def chineseRemainderOfFinset (t : Finset ι)
    (hs : ∀ i ∈ t, s i ≠ 0) (pp : Set.Pairwise t (Coprime on s)) :
    { k // ∀ i ∈ t, k ≡ a i [MOD s i] } 
goal: { k // ∀ i ∈ t, k ≡ a i [MOD s i] }

full_name: Nat.chineseRemainderOfFinset_lt_prod
code: theorem chineseRemainderOfFinset_lt_prod {t : Finset ι}
    (hs : ∀ i ∈ t, s i ≠ 0) (pp : Set.Pairwise t (Coprime on s)) :
    chineseRemainderOfFinset a s t hs pp < ∏ i ∈ t, s i 
goal: ↑(Nat.chineseRemainderOfFinset a s t hs pp) < ∏ i ∈ t, s i