Theorem: Nat.chineseRemainderOfList_lt_prod
File: Mathlib/Data/Nat/ChineseRemainder.lean

tactic: cases l with
| nil => simp
| cons i l =>
  simp only [chineseRemainderOfList, List.map_cons, List.prod_cons]
  have : Coprime (s i) (l.map s).prod := by
    simp only [coprime_list_prod_right_iff, List.mem_map, forall_exists_index, and_imp,
      forall_apply_eq_imp_iff₂]
    intro j hj
    exact (List.pairwise_cons.mp co).1 j hj
  refine chineseRemainder_lt_mul this (a i) (chineseRemainderOfList a s l co.of_cons)
    (hs i (List.mem_cons_self _ l)) ?_
  simp only [ne_eq, List.prod_eq_zero_iff, List.mem_map, not_exists, not_and]
  intro j hj
  exact hs j (List.mem_cons_of_mem _ hj)
state_before: ι : Type u_1
a s : ι → ℕ
l : List ι
co : List.Pairwise (Coprime on s) l
hs : ∀ i ∈ l, s i ≠ 0
⊢ ↑(chineseRemainderOfList a s l co) < (List.map s l).prod
state_after: no goals

tactic: simp
state_before: case nil
ι : Type u_1
a s : ι → ℕ
co : List.Pairwise (Coprime on s) []
hs : ∀ i ∈ [], s i ≠ 0
⊢ ↑(chineseRemainderOfList a s [] co) < (List.map s []).prod
state_after: no goals

tactic: simp only [chineseRemainderOfList, List.map_cons, List.prod_cons]
state_before: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
⊢ ↑(chineseRemainderOfList a s (i :: l) co) < (List.map s (i :: l)).prod
state_after: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
⊢ ↑(chineseRemainder ⋯ (a i) ↑(chineseRemainderOfList a s l ⋯)) < s i * (List.map s l).prod

tactic: have : Coprime (s i) (l.map s).prod := by
  simp only [coprime_list_prod_right_iff, List.mem_map, forall_exists_index, and_imp,
    forall_apply_eq_imp_iff₂]
  intro j hj
  exact (List.pairwise_cons.mp co).1 j hj
state_before: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
⊢ ↑(chineseRemainder ⋯ (a i) ↑(chineseRemainderOfList a s l ⋯)) < s i * (List.map s l).prod
state_after: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
⊢ ↑(chineseRemainder ⋯ (a i) ↑(chineseRemainderOfList a s l ⋯)) < s i * (List.map s l).prod

tactic: refine chineseRemainder_lt_mul this (a i) (chineseRemainderOfList a s l co.of_cons)
  (hs i (List.mem_cons_self _ l)) ?_
state_before: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
⊢ ↑(chineseRemainder ⋯ (a i) ↑(chineseRemainderOfList a s l ⋯)) < s i * (List.map s l).prod
state_after: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
⊢ (List.map s l).prod ≠ 0

tactic: simp only [ne_eq, List.prod_eq_zero_iff, List.mem_map, not_exists, not_and]
state_before: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
⊢ (List.map s l).prod ≠ 0
state_after: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
⊢ ∀ x ∈ l, ¬s x = 0

tactic: intro j hj
state_before: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
⊢ ∀ x ∈ l, ¬s x = 0
state_after: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
j : ι
hj : j ∈ l
⊢ ¬s j = 0

tactic: exact hs j (List.mem_cons_of_mem _ hj)
state_before: case cons
ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
this : (s i).Coprime (List.map s l).prod
j : ι
hj : j ∈ l
⊢ ¬s j = 0
state_after: no goals

tactic: simp only [coprime_list_prod_right_iff, List.mem_map, forall_exists_index, and_imp,
  forall_apply_eq_imp_iff₂]
state_before: ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
⊢ (s i).Coprime (List.map s l).prod
state_after: ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
⊢ ∀ a ∈ l, (s i).Coprime (s a)

tactic: intro j hj
state_before: ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
⊢ ∀ a ∈ l, (s i).Coprime (s a)
state_after: ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
j : ι
hj : j ∈ l
⊢ (s i).Coprime (s j)

tactic: exact (List.pairwise_cons.mp co).1 j hj
state_before: ι : Type u_1
a s : ι → ℕ
i : ι
l : List ι
co : List.Pairwise (Coprime on s) (i :: l)
hs : ∀ i_1 ∈ i :: l, s i_1 ≠ 0
j : ι
hj : j ∈ l
⊢ (s i).Coprime (s j)
state_after: no goals