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

tactic: induction' k with k ih
state_before: R : Type ?u.195275
inst✝ : CommRing R
n k : ℕ
h : k ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν

tactic: simp [Nat.zero_eq]
state_before: case zero
R : Type ?u.195275
inst✝ : CommRing R
n k : ℕ
h✝ : k ≤ n + 1
h : Nat.zero ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν

tactic: apply linearIndependent_empty_type
state_before: case zero
R : Type ?u.195275
inst✝ : CommRing R
n k : ℕ
h✝ : k ≤ n + 1
h : Nat.zero ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν

tactic: apply linearIndependent_fin_succ'.mpr
state_before: case succ
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : Nat.succ k ≤ n + 1
⊢ LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν

tactic: fconstructor
state_before: case succ
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : Nat.succ k ≤ n + 1
⊢ LinearIndependent ℚ (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν) ∧
    ¬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.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : Nat.succ k ≤ n + 1
⊢ LinearIndependent ℚ (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν)

tactic: clear ih
state_before: case succ.right
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
ih : k ≤ n + 1 → LinearIndependent ℚ fun ν => bernsteinPolynomial ℚ n ↑ν
h : Nat.succ k ≤ 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.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
h : Nat.succ k ≤ n + 1
⊢ ¬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.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
h : k ≤ n
⊢ ¬bernsteinPolynomial ℚ n ↑(Fin.last k) ∈ span ℚ (Set.range (Fin.init fun ν => bernsteinPolynomial ℚ n ↑ν))

tactic: dsimp
state_before: case succ.right
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
h : k ≤ n
⊢ ¬bernsteinPolynomial ℚ n k ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑(↑Fin.castSucc 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.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
h : k ≤ n
⊢ ¬bernsteinPolynomial ℚ n k ∈ span ℚ (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.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
h : k ≤ n
⊢ ¬↑(derivative ^ (n - k)) (bernsteinPolynomial ℚ n k) ∈
      span ℚ (↑(derivative ^ (n - k)) '' Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)

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

tactic: apply_fun Polynomial.eval (1 : ℚ)
state_before: case succ.right
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: simp only [LinearMap.pow_apply]
state_before: R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: refine span_induction m ?_ ?_ ?_ ?_
state_before: R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: rw [this]
state_before: R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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))

tactic: exact (iterate_derivative_at_1_ne_zero ℚ n k h).symm
state_before: R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: simp
state_before: case refine_1
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
k : ℕ
h : k ≤ n
p : ℚ[X]
m : p ∈ span ℚ (Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1)
⊢ ∀ (x : ℚ[X]), (x ∈ Set.range fun k_1 => bernsteinPolynomial ℚ n ↑k_1) → eval 1 ((↑derivative^[n - k]) x) = 0

tactic: rintro ⟨a, w⟩
state_before: case refine_1
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: simp only [Fin.val_mk]
state_before: case refine_1.mk
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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 ↑{ val := a, isLt := w })) = 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.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: simp
state_before: case refine_2
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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

tactic: intro x y hx hy
state_before: case refine_3
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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

tactic: simp [hx, hy]
state_before: case refine_3
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: intro a x h
state_before: case refine_4
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝ : k✝ ≤ n + 1
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: simp [h]
state_before: case refine_4
R : Type ?u.195275
inst✝ : CommRing R
n k✝ : ℕ
h✝¹ : k✝ ≤ n + 1
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