Theorem: bernsteinPolynomial.linearIndependent_aux
File: Mathlib/RingTheory/Polynomial/Bernstein.lean

tactic: induction' k with k ih
state_before: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
state_after: case zero
R : Type u_1
inst✝ : CommRing R
n : ℕ
h : 0 ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν

case succ
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν

tactic: apply linearIndependent_empty_type
state_before: case zero
R : Type u_1
inst✝ : CommRing R
n : ℕ
h : 0 ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
state_after: no goals

tactic: apply linearIndependent_fin_succ'.mpr
state_before: case succ
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
state_after: case succ
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ LinearIndependent ℚ (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν) ∧
    bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))

tactic: fconstructor
state_before: case succ
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ LinearIndependent ℚ (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν) ∧
    bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))
state_after: case succ.left
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ LinearIndependent ℚ (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν)

case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))

tactic: exact ih (le_of_lt h)
state_before: case succ.left
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ LinearIndependent ℚ (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν)
state_after: no goals

tactic: clear ih
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : k + 1 ≤ n + 1
⊢ bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))
state_after: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k + 1 ≤ n + 1
⊢ bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))

tactic: simp only [Nat.succ_eq_add_one, add_le_add_iff_right] at h
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k + 1 ≤ n + 1
⊢ bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))
state_after: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))

tactic: simp only [Fin.val_last, Fin.init_def]
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ bernsteinPolynomial ℚ n ↑(Fin.last k) ∉ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))
state_after: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ bernsteinPolynomial ℚ n k ∉ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1.castSucc)

tactic: dsimp
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ bernsteinPolynomial ℚ n k ∉ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1.castSucc)
state_after: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ bernsteinPolynomial ℚ n k ∉ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)

tactic: apply not_mem_span_of_apply_not_mem_span_image (@Polynomial.derivative ℚ _ ^ (n - k))
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ bernsteinPolynomial ℚ n k ∉ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
state_after: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ (derivative ^ (n - k)) (bernsteinPolynomial ℚ n k) ∉
    span ℚ (⇑(derivative ^ (n - k)) '' Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)

tactic: simp only [not_exists, not_and, Submodule.mem_map, Submodule.span_image _]
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ (derivative ^ (n - k)) (bernsteinPolynomial ℚ n k) ∉
    span ℚ (⇑(derivative ^ (n - k)) '' Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
state_after: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ ∀ x ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1),
    ¬(derivative ^ (n - k)) x = (derivative ^ (n - k)) (bernsteinPolynomial ℚ n k)

tactic: intro p m
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
⊢ ∀ x ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1),
    ¬(derivative ^ (n - k)) x = (derivative ^ (n - k)) (bernsteinPolynomial ℚ n k)
state_after: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ¬(derivative ^ (n - k)) p = (derivative ^ (n - k)) (bernsteinPolynomial ℚ n k)

tactic: apply_fun Polynomial.eval (1 : ℚ)
state_before: case succ.right
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ¬(derivative ^ (n - k)) p = (derivative ^ (n - k)) (bernsteinPolynomial ℚ n k)
state_after: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((derivative ^ (n - k)) p) ≠ eval 1 ((derivative ^ (n - k)) (bernsteinPolynomial ℚ n k))

tactic: simp only [LinearMap.pow_apply]
state_before: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((derivative ^ (n - k)) p) ≠ eval 1 ((derivative ^ (n - k)) (bernsteinPolynomial ℚ n k))
state_after: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((⇑derivative)^[n - k] p) ≠ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n k))

tactic: suffices (Polynomial.derivative^[n - k] p).eval 1 = 0 by
  rw [this]
  exact (iterate_derivative_at_1_ne_zero ℚ n k h).symm
state_before: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((⇑derivative)^[n - k] p) ≠ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n k))
state_after: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((⇑derivative)^[n - k] p) = 0

tactic: refine span_induction m ?_ ?_ ?_ ?_
state_before: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((⇑derivative)^[n - k] p) = 0
state_after: case refine_1
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ x ∈ Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1, eval 1 ((⇑derivative)^[n - k] x) = 0

case refine_2
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((⇑derivative)^[n - k] 0) = 0

case refine_3
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ (x y : ℚ[X]),
    eval 1 ((⇑derivative)^[n - k] x) = 0 →
      eval 1 ((⇑derivative)^[n - k] y) = 0 → eval 1 ((⇑derivative)^[n - k] (x + y)) = 0

case refine_4
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ (a : ℚ) (x : ℚ[X]), eval 1 ((⇑derivative)^[n - k] x) = 0 → eval 1 ((⇑derivative)^[n - k] (a • x)) = 0

tactic: rw [this]
state_before: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
this : eval 1 ((⇑derivative)^[n - k] p) = 0
⊢ eval 1 ((⇑derivative)^[n - k] p) ≠ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n k))
state_after: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
this : eval 1 ((⇑derivative)^[n - k] p) = 0
⊢ 0 ≠ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n k))

tactic: exact (iterate_derivative_at_1_ne_zero ℚ n k h).symm
state_before: R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
this : eval 1 ((⇑derivative)^[n - k] p) = 0
⊢ 0 ≠ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n k))
state_after: no goals

tactic: simp
state_before: case refine_1
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ x ∈ Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1, eval 1 ((⇑derivative)^[n - k] x) = 0
state_after: case refine_1
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ (a : Fin k), eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n ↑a)) = 0

tactic: rintro ⟨a, w⟩
state_before: case refine_1
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ (a : Fin k), eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n ↑a)) = 0
state_after: case refine_1.mk
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
a : ℕ
w : a < k
⊢ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n ↑⟨a, w⟩)) = 0

tactic: simp only [Fin.val_mk]
state_before: case refine_1.mk
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
a : ℕ
w : a < k
⊢ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n ↑⟨a, w⟩)) = 0
state_after: case refine_1.mk
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
a : ℕ
w : a < k
⊢ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n a)) = 0

tactic: rw [iterate_derivative_at_1_eq_zero_of_lt ℚ n ((tsub_lt_tsub_iff_left_of_le h).mpr w)]
state_before: case refine_1.mk
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
a : ℕ
w : a < k
⊢ eval 1 ((⇑derivative)^[n - k] (bernsteinPolynomial ℚ n a)) = 0
state_after: no goals

tactic: simp
state_before: case refine_2
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ eval 1 ((⇑derivative)^[n - k] 0) = 0
state_after: no goals

tactic: intro x y hx hy
state_before: case refine_3
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ (x y : ℚ[X]),
    eval 1 ((⇑derivative)^[n - k] x) = 0 →
      eval 1 ((⇑derivative)^[n - k] y) = 0 → eval 1 ((⇑derivative)^[n - k] (x + y)) = 0
state_after: case refine_3
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
x y : ℚ[X]
hx : eval 1 ((⇑derivative)^[n - k] x) = 0
hy : eval 1 ((⇑derivative)^[n - k] y) = 0
⊢ eval 1 ((⇑derivative)^[n - k] (x + y)) = 0

tactic: simp [hx, hy]
state_before: case refine_3
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
x y : ℚ[X]
hx : eval 1 ((⇑derivative)^[n - k] x) = 0
hy : eval 1 ((⇑derivative)^[n - k] y) = 0
⊢ eval 1 ((⇑derivative)^[n - k] (x + y)) = 0
state_after: no goals

tactic: intro a x h
state_before: case refine_4
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ (a : ℚ) (x : ℚ[X]), eval 1 ((⇑derivative)^[n - k] x) = 0 → eval 1 ((⇑derivative)^[n - k] (a • x)) = 0
state_after: case refine_4
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h✝ : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
a : ℚ
x : ℚ[X]
h : eval 1 ((⇑derivative)^[n - k] x) = 0
⊢ eval 1 ((⇑derivative)^[n - k] (a • x)) = 0

tactic: simp [h]
state_before: case refine_4
R : Type u_1
inst✝ : CommRing R
n k : ℕ
h✝ : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
a : ℚ
x : ℚ[X]
h : eval 1 ((⇑derivative)^[n - k] x) = 0
⊢ eval 1 ((⇑derivative)^[n - k] (a • x)) = 0
state_after: no goals