l3lab/ntp-mathlib huggingface dataset:
theorem toDual_apply (i j : ι) : b.toDual (b i) (b j) = if i = j then 1 else 0 := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
i j : ι
⊢ ((toDual b) (b i)) (b j) = if i = j then 1 else 0

Next tactic:
erw [constr_basis b, constr_basis b]
theorem toDual_apply (i j : ι) : b.toDual (b i) (b j) = if i = j then 1 else 0 := by
  erw [constr_basis b, constr_basis b]
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
i j : ι
⊢ (if j = i then 1 else 0) = if i = j then 1 else 0

Next tactic:
simp only [eq_comm]
@[simp]
theorem toDual_total_left (f : ι →₀ R) (i : ι) :
    b.toDual (Finsupp.total ι M R b f) (b i) = f i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
⊢ ((toDual b) ((Finsupp.total ι M R ⇑b) f)) (b i) = f i

Next tactic:
rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum, LinearMap.sum_apply]
@[simp]
theorem toDual_total_left (f : ι →₀ R) (i : ι) :
    b.toDual (Finsupp.total ι M R b f) (b i) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum, LinearMap.sum_apply]
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
⊢ ∑ d in f.support, ((toDual b) (f d • b d)) (b i) = f i

Next tactic:
simp_rw [LinearMap.map_smul, LinearMap.smul_apply, toDual_apply, smul_eq_mul, mul_boole,
    Finset.sum_ite_eq']
@[simp]
theorem toDual_total_left (f : ι →₀ R) (i : ι) :
    b.toDual (Finsupp.total ι M R b f) (b i) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum, LinearMap.sum_apply]
  simp_rw [LinearMap.map_smul, LinearMap.smul_apply, toDual_apply, smul_eq_mul, mul_boole,
    Finset.sum_ite_eq']
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
⊢ (if i ∈ f.support then f i else 0) = f i

Next tactic:
split_ifs with h
@[simp]
theorem toDual_total_left (f : ι →₀ R) (i : ι) :
    b.toDual (Finsupp.total ι M R b f) (b i) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum, LinearMap.sum_apply]
  simp_rw [LinearMap.map_smul, LinearMap.smul_apply, toDual_apply, smul_eq_mul, mul_boole,
    Finset.sum_ite_eq']
  split_ifs with h
  · 

Proof state:
case pos
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
h : i ∈ f.support
⊢ f i = f i

Next tactic:
rfl
@[simp]
theorem toDual_total_left (f : ι →₀ R) (i : ι) :
    b.toDual (Finsupp.total ι M R b f) (b i) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum, LinearMap.sum_apply]
  simp_rw [LinearMap.map_smul, LinearMap.smul_apply, toDual_apply, smul_eq_mul, mul_boole,
    Finset.sum_ite_eq']
  split_ifs with h
  · rfl
  · 

Proof state:
case neg
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
h : i ∉ f.support
⊢ 0 = f i

Next tactic:
rw [Finsupp.not_mem_support_iff.mp h]
@[simp]
theorem toDual_total_right (f : ι →₀ R) (i : ι) :
    b.toDual (b i) (Finsupp.total ι M R b f) = f i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
⊢ ((toDual b) (b i)) ((Finsupp.total ι M R ⇑b) f) = f i

Next tactic:
rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum]
@[simp]
theorem toDual_total_right (f : ι →₀ R) (i : ι) :
    b.toDual (b i) (Finsupp.total ι M R b f) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum]
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
⊢ ∑ x in f.support, ((toDual b) (b i)) (f x • b x) = f i

Next tactic:
simp_rw [LinearMap.map_smul, toDual_apply, smul_eq_mul, mul_boole, Finset.sum_ite_eq]
@[simp]
theorem toDual_total_right (f : ι →₀ R) (i : ι) :
    b.toDual (b i) (Finsupp.total ι M R b f) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum]
  simp_rw [LinearMap.map_smul, toDual_apply, smul_eq_mul, mul_boole, Finset.sum_ite_eq]
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
⊢ (if i ∈ f.support then f i else 0) = f i

Next tactic:
split_ifs with h
@[simp]
theorem toDual_total_right (f : ι →₀ R) (i : ι) :
    b.toDual (b i) (Finsupp.total ι M R b f) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum]
  simp_rw [LinearMap.map_smul, toDual_apply, smul_eq_mul, mul_boole, Finset.sum_ite_eq]
  split_ifs with h
  · 

Proof state:
case pos
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
h : i ∈ f.support
⊢ f i = f i

Next tactic:
rfl
@[simp]
theorem toDual_total_right (f : ι →₀ R) (i : ι) :
    b.toDual (b i) (Finsupp.total ι M R b f) = f i := by
  rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum]
  simp_rw [LinearMap.map_smul, toDual_apply, smul_eq_mul, mul_boole, Finset.sum_ite_eq]
  split_ifs with h
  · rfl
  · 

Proof state:
case neg
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
f : ι →₀ R
i : ι
h : i ∉ f.support
⊢ 0 = f i

Next tactic:
rw [Finsupp.not_mem_support_iff.mp h]
theorem toDual_apply_left (m : M) (i : ι) : b.toDual m (b i) = b.repr m i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
m : M
i : ι
⊢ ((toDual b) m) (b i) = (b.repr m) i

Next tactic:
rw [← b.toDual_total_left, b.total_repr]
theorem toDual_apply_right (i : ι) (m : M) : b.toDual (b i) m = b.repr m i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
i : ι
m : M
⊢ ((toDual b) (b i)) m = (b.repr m) i

Next tactic:
rw [← b.toDual_total_right, b.total_repr]
theorem coe_toDual_self (i : ι) : b.toDual (b i) = b.coord i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
i : ι
⊢ (toDual b) (b i) = coord b i

Next tactic:
ext
theorem coe_toDual_self (i : ι) : b.toDual (b i) = b.coord i := by
  ext
  

Proof state:
case h
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
i : ι
x✝ : M
⊢ ((toDual b) (b i)) x✝ = (coord b i) x✝

Next tactic:
apply toDual_apply_right
theorem toDual_eq_equivFun [Fintype ι] (m : M) (i : ι) : b.toDual m (b i) = b.equivFun m i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : Fintype ι
m : M
i : ι
⊢ ((toDual b) m) (b i) = (equivFun b) m i

Next tactic:
rw [b.equivFun_apply, toDual_eq_repr]
theorem toDual_injective : Injective b.toDual := fun x y h ↦ b.ext_elem_iff.mpr fun i ↦ by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
x y : M
h : (toDual b) x = (toDual b) y
i : ι
⊢ (b.repr x) i = (b.repr y) i

Next tactic:
simp_rw [← toDual_eq_repr]
theorem toDual_injective : Injective b.toDual := fun x y h ↦ b.ext_elem_iff.mpr fun i ↦ by
  simp_rw [← toDual_eq_repr]; 

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
x y : M
h : (toDual b) x = (toDual b) y
i : ι
⊢ ((toDual b) x) (b i) = ((toDual b) y) (b i)

Next tactic:
exact FunLike.congr_fun h _
theorem toDual_inj (m : M) (a : b.toDual m = 0) : m = 0 :=
  b.toDual_injective (by 

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : DecidableEq ι
b : Basis ι R M
m : M
a : (toDual b) m = 0
⊢ (toDual b) m = (toDual b) 0

Next tactic:
rwa [_root_.map_zero]
theorem toDual_range [Finite ι] : LinearMap.range b.toDual = ⊤ := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
⊢ range (toDual b) = ⊤

Next tactic:
refine' eq_top_iff'.2 fun f => _
theorem toDual_range [Finite ι] : LinearMap.range b.toDual = ⊤ := by
  refine' eq_top_iff'.2 fun f => _
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : Dual R M
⊢ f ∈ range (toDual b)

Next tactic:
let lin_comb : ι →₀ R := Finsupp.equivFunOnFinite.symm fun i => f (b i)
theorem toDual_range [Finite ι] : LinearMap.range b.toDual = ⊤ := by
  refine' eq_top_iff'.2 fun f => _
  let lin_comb : ι →₀ R := Finsupp.equivFunOnFinite.symm fun i => f (b i)
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : Dual R M
lin_comb : ι →₀ R := Finsupp.equivFunOnFinite.symm fun i => f (b i)
⊢ f ∈ range (toDual b)

Next tactic:
refine' ⟨Finsupp.total ι M R b lin_comb, b.ext fun i => _⟩
theorem toDual_range [Finite ι] : LinearMap.range b.toDual = ⊤ := by
  refine' eq_top_iff'.2 fun f => _
  let lin_comb : ι →₀ R := Finsupp.equivFunOnFinite.symm fun i => f (b i)
  refine' ⟨Finsupp.total ι M R b lin_comb, b.ext fun i => _⟩
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : Dual R M
lin_comb : ι →₀ R := Finsupp.equivFunOnFinite.symm fun i => f (b i)
i : ι
⊢ ((toDual b) ((Finsupp.total ι M R ⇑b) lin_comb)) (b i) = f (b i)

Next tactic:
rw [b.toDual_eq_repr _ i, repr_total b]
theorem toDual_range [Finite ι] : LinearMap.range b.toDual = ⊤ := by
  refine' eq_top_iff'.2 fun f => _
  let lin_comb : ι →₀ R := Finsupp.equivFunOnFinite.symm fun i => f (b i)
  refine' ⟨Finsupp.total ι M R b lin_comb, b.ext fun i => _⟩
  rw [b.toDual_eq_repr _ i, repr_total b]
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommSemiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : Dual R M
lin_comb : ι →₀ R := Finsupp.equivFunOnFinite.symm fun i => f (b i)
i : ι
⊢ lin_comb i = f (b i)

Next tactic:
rfl
@[simp]
theorem sum_dual_apply_smul_coord (f : Module.Dual R M) :
    (∑ x, f (b x) • b.coord x) = f := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : Fintype ι
b : Basis ι R M
f : Dual R M
⊢ ∑ x : ι, f (b x) • coord b x = f

Next tactic:
ext m
@[simp]
theorem sum_dual_apply_smul_coord (f : Module.Dual R M) :
    (∑ x, f (b x) • b.coord x) = f := by
  ext m
  

Proof state:
case h
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommSemiring R
inst✝² : AddCommMonoid M
inst✝¹ : Module R M
inst✝ : Fintype ι
b : Basis ι R M
f : Dual R M
m : M
⊢ (∑ x : ι, f (b x) • coord b x) m = f m

Next tactic:
simp_rw [LinearMap.sum_apply, LinearMap.smul_apply, smul_eq_mul, mul_comm (f _), ← smul_eq_mul, ←
    f.map_smul, ← _root_.map_sum, Basis.coord_apply, Basis.sum_repr]
theorem dualBasis_apply_self (i j : ι) : b.dualBasis i (b j) =
    if j = i then 1 else 0 := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
i j : ι
⊢ ((dualBasis b) i) (b j) = if j = i then 1 else 0

Next tactic:
convert b.toDual_apply i j using 2
theorem dualBasis_apply_self (i j : ι) : b.dualBasis i (b j) =
    if j = i then 1 else 0 := by
  convert b.toDual_apply i j using 2
  

Proof state:
case h.e'_3.h₁.a
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
i j : ι
⊢ j = i ↔ i = j

Next tactic:
rw [@eq_comm _ j i]
theorem total_dualBasis (f : ι →₀ R) (i : ι) :
    Finsupp.total ι (Dual R M) R b.dualBasis f (b i) = f i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : ι →₀ R
i : ι
⊢ ((Finsupp.total ι (Dual R M) R ⇑(dualBasis b)) f) (b i) = f i

Next tactic:
cases nonempty_fintype ι
theorem total_dualBasis (f : ι →₀ R) (i : ι) :
    Finsupp.total ι (Dual R M) R b.dualBasis f (b i) = f i := by
  cases nonempty_fintype ι
  

Proof state:
case intro
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : ι →₀ R
i : ι
val✝ : Fintype ι
⊢ ((Finsupp.total ι (Dual R M) R ⇑(dualBasis b)) f) (b i) = f i

Next tactic:
rw [Finsupp.total_apply, Finsupp.sum_fintype, LinearMap.sum_apply]
theorem total_dualBasis (f : ι →₀ R) (i : ι) :
    Finsupp.total ι (Dual R M) R b.dualBasis f (b i) = f i := by
  cases nonempty_fintype ι
  rw [Finsupp.total_apply, Finsupp.sum_fintype, LinearMap.sum_apply]
  · 

Proof state:
case intro
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : ι →₀ R
i : ι
val✝ : Fintype ι
⊢ ∑ d : ι, (f d • (dualBasis b) d) (b i) = f i

Next tactic:
simp_rw [LinearMap.smul_apply, smul_eq_mul, dualBasis_apply_self, mul_boole,
    Finset.sum_ite_eq, if_pos (Finset.mem_univ i)]
theorem total_dualBasis (f : ι →₀ R) (i : ι) :
    Finsupp.total ι (Dual R M) R b.dualBasis f (b i) = f i := by
  cases nonempty_fintype ι
  rw [Finsupp.total_apply, Finsupp.sum_fintype, LinearMap.sum_apply]
  · simp_rw [LinearMap.smul_apply, smul_eq_mul, dualBasis_apply_self, mul_boole,
    Finset.sum_ite_eq, if_pos (Finset.mem_univ i)]
  · 

Proof state:
case intro.h
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : ι →₀ R
i : ι
val✝ : Fintype ι
⊢ ∀ (i : ι), 0 • (dualBasis b) i = 0

Next tactic:
intro
theorem total_dualBasis (f : ι →₀ R) (i : ι) :
    Finsupp.total ι (Dual R M) R b.dualBasis f (b i) = f i := by
  cases nonempty_fintype ι
  rw [Finsupp.total_apply, Finsupp.sum_fintype, LinearMap.sum_apply]
  · simp_rw [LinearMap.smul_apply, smul_eq_mul, dualBasis_apply_self, mul_boole,
    Finset.sum_ite_eq, if_pos (Finset.mem_univ i)]
  · intro
    

Proof state:
case intro.h
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
f : ι →₀ R
i : ι
val✝ : Fintype ι
i✝ : ι
⊢ 0 • (dualBasis b) i✝ = 0

Next tactic:
rw [zero_smul]
theorem dualBasis_repr (l : Dual R M) (i : ι) : b.dualBasis.repr l i = l (b i) := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
l : Dual R M
i : ι
⊢ ((dualBasis b).repr l) i = l (b i)

Next tactic:
rw [← total_dualBasis b, Basis.total_repr b.dualBasis l]
@[simp]
theorem coe_dualBasis : ⇑b.dualBasis = b.coord := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
⊢ ⇑(dualBasis b) = coord b

Next tactic:
ext i x
@[simp]
theorem coe_dualBasis : ⇑b.dualBasis = b.coord := by
  ext i x
  

Proof state:
case h.h
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
i : ι
x : M
⊢ ((dualBasis b) i) x = (coord b i) x

Next tactic:
apply dualBasis_apply
@[simp]
theorem toDual_toDual : b.dualBasis.toDual.comp b.toDual = Dual.eval R M := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
⊢ toDual (dualBasis b) ∘ₗ toDual b = Dual.eval R M

Next tactic:
refine' b.ext fun i => b.dualBasis.ext fun j => _
@[simp]
theorem toDual_toDual : b.dualBasis.toDual.comp b.toDual = Dual.eval R M := by
  refine' b.ext fun i => b.dualBasis.ext fun j => _
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : _root_.Finite ι
i j : ι
⊢ ((toDual (dualBasis b) ∘ₗ toDual b) (b i)) ((dualBasis b) j) = ((Dual.eval R M) (b i)) ((dualBasis b) j)

Next tactic:
rw [LinearMap.comp_apply, toDual_apply_left, coe_toDual_self, ← coe_dualBasis,
    Dual.eval_apply, Basis.repr_self, Finsupp.single_apply, dualBasis_apply_self]
theorem dualBasis_equivFun [Fintype ι] (l : Dual R M) (i : ι) :
    b.dualBasis.equivFun l i = l (b i) := by 

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι
b : Basis ι R M
inst✝ : Fintype ι
l : Dual R M
i : ι
⊢ (equivFun (dualBasis b)) l i = l (b i)

Next tactic:
rw [Basis.equivFun_apply, dualBasis_repr]
theorem eval_ker {ι : Type*} (b : Basis ι R M) :
    LinearMap.ker (Dual.eval R M) = ⊥ := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι✝ : Type uι
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : DecidableEq ι✝
b✝ : Basis ι✝ R M
ι : Type u_1
b : Basis ι R M
⊢ ker (Dual.eval R M) = ⊥

Next tactic:
rw [ker_eq_bot']
theorem eval_ker {ι : Type*} (b : Basis ι R M) :
    LinearMap.ker (Dual.eval R M) = ⊥ := by
  rw [ker_eq_bot']
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι✝ : Type uι
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : DecidableEq ι✝
b✝ : Basis ι✝ R M
ι : Type u_1
b : Basis ι R M
⊢ ∀ (m : M), (Dual.eval R M) m = 0 → m = 0

Next tactic:
intro m hm
theorem eval_ker {ι : Type*} (b : Basis ι R M) :
    LinearMap.ker (Dual.eval R M) = ⊥ := by
  rw [ker_eq_bot']
  intro m hm
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι✝ : Type uι
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : DecidableEq ι✝
b✝ : Basis ι✝ R M
ι : Type u_1
b : Basis ι R M
m : M
hm : (Dual.eval R M) m = 0
⊢ m = 0

Next tactic:
simp_rw [LinearMap.ext_iff, Dual.eval_apply, zero_apply] at hm
theorem eval_ker {ι : Type*} (b : Basis ι R M) :
    LinearMap.ker (Dual.eval R M) = ⊥ := by
  rw [ker_eq_bot']
  intro m hm
  simp_rw [LinearMap.ext_iff, Dual.eval_apply, zero_apply] at hm
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι✝ : Type uι
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : DecidableEq ι✝
b✝ : Basis ι✝ R M
ι : Type u_1
b : Basis ι R M
m : M
hm : ∀ (x : Dual R M), x m = 0
⊢ m = 0

Next tactic:
exact (Basis.forall_coord_eq_zero_iff _).mp fun i => hm (b.coord i)
theorem eval_range {ι : Type*} [Finite ι] (b : Basis ι R M) :
    LinearMap.range (Dual.eval R M) = ⊤ := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι✝ : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι✝
b✝ : Basis ι✝ R M
ι : Type u_1
inst✝ : _root_.Finite ι
b : Basis ι R M
⊢ range (Dual.eval R M) = ⊤

Next tactic:
classical
    cases nonempty_fintype ι
    rw [← b.toDual_toDual, range_comp, b.toDual_range, Submodule.map_top, toDual_range _]
theorem eval_range {ι : Type*} [Finite ι] (b : Basis ι R M) :
    LinearMap.range (Dual.eval R M) = ⊤ := by
  classical
    

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι✝ : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι✝
b✝ : Basis ι✝ R M
ι : Type u_1
inst✝ : _root_.Finite ι
b : Basis ι R M
⊢ range (Dual.eval R M) = ⊤

Next tactic:
cases nonempty_fintype ι
theorem eval_range {ι : Type*} [Finite ι] (b : Basis ι R M) :
    LinearMap.range (Dual.eval R M) = ⊤ := by
  classical
    cases nonempty_fintype ι
    

Proof state:
case intro
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι✝ : Type uι
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : DecidableEq ι✝
b✝ : Basis ι✝ R M
ι : Type u_1
inst✝ : _root_.Finite ι
b : Basis ι R M
val✝ : Fintype ι
⊢ range (Dual.eval R M) = ⊤

Next tactic:
rw [← b.toDual_toDual, range_comp, b.toDual_range, Submodule.map_top, toDual_range _]
/-- `simp` normal form version of `total_dualBasis` -/
@[simp]
theorem total_coord [CommRing R] [AddCommGroup M] [Module R M] [Finite ι] (b : Basis ι R M)
    (f : ι →₀ R) (i : ι) : Finsupp.total ι (Dual R M) R b.coord f (b i) = f i := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : _root_.Finite ι
b : Basis ι R M
f : ι →₀ R
i : ι
⊢ ((Finsupp.total ι (Dual R M) R (coord b)) f) (b i) = f i

Next tactic:
haveI := Classical.decEq ι
/-- `simp` normal form version of `total_dualBasis` -/
@[simp]
theorem total_coord [CommRing R] [AddCommGroup M] [Module R M] [Finite ι] (b : Basis ι R M)
    (f : ι →₀ R) (i : ι) : Finsupp.total ι (Dual R M) R b.coord f (b i) = f i := by
  haveI := Classical.decEq ι
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommRing R
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : _root_.Finite ι
b : Basis ι R M
f : ι →₀ R
i : ι
this : DecidableEq ι
⊢ ((Finsupp.total ι (Dual R M) R (coord b)) f) (b i) = f i

Next tactic:
rw [← coe_dualBasis, total_dualBasis]
theorem dual_rank_eq [CommRing K] [AddCommGroup V] [Module K V] [Finite ι] (b : Basis ι K V) :
    Cardinal.lift.{uK,uV} (Module.rank K V) = Module.rank K (Dual K V) := by
  

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : _root_.Finite ι
b : Basis ι K V
⊢ lift.{uK, uV} (Module.rank K V) = Module.rank K (Dual K V)

Next tactic:
classical rw [← lift_umax.{uV,uK}, b.toDualEquiv.lift_rank_eq, lift_id'.{uV,uK}]
theorem dual_rank_eq [CommRing K] [AddCommGroup V] [Module K V] [Finite ι] (b : Basis ι K V) :
    Cardinal.lift.{uK,uV} (Module.rank K V) = Module.rank K (Dual K V) := by
  classical 

Proof state:
R : Type uR
M : Type uM
K : Type uK
V : Type uV
ι : Type uι
inst✝³ : CommRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : _root_.Finite ι
b : Basis ι K V
⊢ lift.{uK, uV} (Module.rank K V) = Module.rank K (Dual K V)

Next tactic:
rw [← lift_umax.{uV,uK}, b.toDualEquiv.lift_rank_eq, lift_id'.{uV,uK}]