l3lab/ntp-mathlib huggingface dataset:
/-- If `x` is in the base ring `K`, then the norm is `x ^ [L : K]`. -/
theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
    norm R (algebraMap R S x) = x ^ Fintype.card ι := by
  haveI := Classical.decEq ι
  rw [norm_apply, ← det_toMatrix b, lmul_algebraMap]
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Fintype ι
b : Basis ι R S
x : R
this : DecidableEq ι
⊢ det ((toMatrix b b) ((lsmul R R S) x)) = x ^ Fintype.card ι

Next tactic:
convert @det_diagonal _ _ _ _ _ fun _ : ι => x
/-- If `x` is in the base ring `K`, then the norm is `x ^ [L : K]`. -/
theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
    norm R (algebraMap R S x) = x ^ Fintype.card ι := by
  haveI := Classical.decEq ι
  rw [norm_apply, ← det_toMatrix b, lmul_algebraMap]
  convert @det_diagonal _ _ _ _ _ fun _ : ι => x
  · 

Proof state:
case h.e'_2.h.e'_6
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Fintype ι
b : Basis ι R S
x : R
this : DecidableEq ι
⊢ (toMatrix b b) ((lsmul R R S) x) = diagonal fun x_1 => x

Next tactic:
ext (i j)
/-- If `x` is in the base ring `K`, then the norm is `x ^ [L : K]`. -/
theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
    norm R (algebraMap R S x) = x ^ Fintype.card ι := by
  haveI := Classical.decEq ι
  rw [norm_apply, ← det_toMatrix b, lmul_algebraMap]
  convert @det_diagonal _ _ _ _ _ fun _ : ι => x
  · ext (i j); 

Proof state:
case h.e'_2.h.e'_6.a.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Fintype ι
b : Basis ι R S
x : R
this : DecidableEq ι
i j : ι
⊢ (toMatrix b b) ((lsmul R R S) x) i j = diagonal (fun x_1 => x) i j

Next tactic:
rw [toMatrix_lsmul, Matrix.diagonal]
/-- If `x` is in the base ring `K`, then the norm is `x ^ [L : K]`. -/
theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
    norm R (algebraMap R S x) = x ^ Fintype.card ι := by
  haveI := Classical.decEq ι
  rw [norm_apply, ← det_toMatrix b, lmul_algebraMap]
  convert @det_diagonal _ _ _ _ _ fun _ : ι => x
  · ext (i j); rw [toMatrix_lsmul, Matrix.diagonal]
  · 

Proof state:
case h.e'_3
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Fintype ι
b : Basis ι R S
x : R
this : DecidableEq ι
⊢ x ^ Fintype.card ι = ∏ i : ι, x

Next tactic:
rw [Finset.prod_const, Finset.card_univ]
/-- If `x` is in the base field `K`, then the norm is `x ^ [L : K]`.

(If `L` is not finite-dimensional over `K`, then `norm = 1 = x ^ 0 = x ^ (finrank L K)`.)
-/
@[simp]
protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) :
    norm K (algebraMap K L x) = x ^ finrank K L := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L✝ : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L✝
inst✝⁴ : Field F
inst✝³ : Algebra K L✝
inst✝² : Algebra K F
ι : Type w
L : Type u_7
inst✝¹ : Ring L
inst✝ : Algebra K L
x : K
⊢ (norm K) ((algebraMap K L) x) = x ^ finrank K L

Next tactic:
by_cases H : ∃ s : Finset L, Nonempty (Basis s K L)
/-- If `x` is in the base field `K`, then the norm is `x ^ [L : K]`.

(If `L` is not finite-dimensional over `K`, then `norm = 1 = x ^ 0 = x ^ (finrank L K)`.)
-/
@[simp]
protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) :
    norm K (algebraMap K L x) = x ^ finrank K L := by
  by_cases H : ∃ s : Finset L, Nonempty (Basis s K L)
  · 

Proof state:
case pos
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L✝ : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L✝
inst✝⁴ : Field F
inst✝³ : Algebra K L✝
inst✝² : Algebra K F
ι : Type w
L : Type u_7
inst✝¹ : Ring L
inst✝ : Algebra K L
x : K
H : ∃ s, Nonempty (Basis { x // x ∈ s } K L)
⊢ (norm K) ((algebraMap K L) x) = x ^ finrank K L

Next tactic:
rw [norm_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some]
/-- If `x` is in the base field `K`, then the norm is `x ^ [L : K]`.

(If `L` is not finite-dimensional over `K`, then `norm = 1 = x ^ 0 = x ^ (finrank L K)`.)
-/
@[simp]
protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) :
    norm K (algebraMap K L x) = x ^ finrank K L := by
  by_cases H : ∃ s : Finset L, Nonempty (Basis s K L)
  · rw [norm_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some]
  · 

Proof state:
case neg
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L✝ : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L✝
inst✝⁴ : Field F
inst✝³ : Algebra K L✝
inst✝² : Algebra K F
ι : Type w
L : Type u_7
inst✝¹ : Ring L
inst✝ : Algebra K L
x : K
H : ¬∃ s, Nonempty (Basis { x // x ∈ s } K L)
⊢ (norm K) ((algebraMap K L) x) = x ^ finrank K L

Next tactic:
rw [norm_eq_one_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis, pow_zero]
/-- If `x` is in the base field `K`, then the norm is `x ^ [L : K]`.

(If `L` is not finite-dimensional over `K`, then `norm = 1 = x ^ 0 = x ^ (finrank L K)`.)
-/
@[simp]
protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) :
    norm K (algebraMap K L x) = x ^ finrank K L := by
  by_cases H : ∃ s : Finset L, Nonempty (Basis s K L)
  · rw [norm_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some]
  · rw [norm_eq_one_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis, pow_zero]
    

Proof state:
case neg
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L✝ : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L✝
inst✝⁴ : Field F
inst✝³ : Algebra K L✝
inst✝² : Algebra K F
ι : Type w
L : Type u_7
inst✝¹ : Ring L
inst✝ : Algebra K L
x : K
H : ¬∃ s, Nonempty (Basis { x // x ∈ s } K L)
⊢ ¬∃ s, Nonempty (Basis (↑↑s) K L)

Next tactic:
rintro ⟨s, ⟨b⟩⟩
/-- If `x` is in the base field `K`, then the norm is `x ^ [L : K]`.

(If `L` is not finite-dimensional over `K`, then `norm = 1 = x ^ 0 = x ^ (finrank L K)`.)
-/
@[simp]
protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) :
    norm K (algebraMap K L x) = x ^ finrank K L := by
  by_cases H : ∃ s : Finset L, Nonempty (Basis s K L)
  · rw [norm_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some]
  · rw [norm_eq_one_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis, pow_zero]
    rintro ⟨s, ⟨b⟩⟩
    

Proof state:
case neg.intro.intro
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L✝ : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L✝
inst✝⁴ : Field F
inst✝³ : Algebra K L✝
inst✝² : Algebra K F
ι : Type w
L : Type u_7
inst✝¹ : Ring L
inst✝ : Algebra K L
x : K
H : ¬∃ s, Nonempty (Basis { x // x ∈ s } K L)
s : Finset L
b : Basis (↑↑s) K L
⊢ False

Next tactic:
exact H ⟨s, ⟨b⟩⟩
/-- Given `pb : PowerBasis K S`, then the norm of `pb.gen` is
`(-1) ^ pb.dim * coeff (minpoly K pb.gen) 0`. -/
theorem PowerBasis.norm_gen_eq_coeff_zero_minpoly (pb : PowerBasis R S) :
    norm R pb.gen = (-1) ^ pb.dim * coeff (minpoly R pb.gen) 0 := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
pb : PowerBasis R S
⊢ (norm R) pb.gen = (-1) ^ pb.dim * coeff (minpoly R pb.gen) 0

Next tactic:
rw [norm_eq_matrix_det pb.basis, det_eq_sign_charpoly_coeff, charpoly_leftMulMatrix,
    Fintype.card_fin]
/-- Given `pb : PowerBasis R S`, then the norm of `pb.gen` is
`((minpoly R pb.gen).aroots F).prod`. -/
theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
    (hf : (minpoly R pb.gen).Splits (algebraMap R F)) :
    algebraMap R F (norm R pb.gen) = ((minpoly R pb.gen).aroots F).prod := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Algebra R F
pb : PowerBasis R S
hf : Splits (algebraMap R F) (minpoly R pb.gen)
⊢ (algebraMap R F) ((norm R) pb.gen) = Multiset.prod (aroots (minpoly R pb.gen) F)

Next tactic:
haveI := Module.nontrivial R F
/-- Given `pb : PowerBasis R S`, then the norm of `pb.gen` is
`((minpoly R pb.gen).aroots F).prod`. -/
theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
    (hf : (minpoly R pb.gen).Splits (algebraMap R F)) :
    algebraMap R F (norm R pb.gen) = ((minpoly R pb.gen).aroots F).prod := by
  haveI := Module.nontrivial R F
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Algebra R F
pb : PowerBasis R S
hf : Splits (algebraMap R F) (minpoly R pb.gen)
this : Nontrivial R
⊢ (algebraMap R F) ((norm R) pb.gen) = Multiset.prod (aroots (minpoly R pb.gen) F)

Next tactic:
have := minpoly.monic pb.isIntegral_gen
/-- Given `pb : PowerBasis R S`, then the norm of `pb.gen` is
`((minpoly R pb.gen).aroots F).prod`. -/
theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
    (hf : (minpoly R pb.gen).Splits (algebraMap R F)) :
    algebraMap R F (norm R pb.gen) = ((minpoly R pb.gen).aroots F).prod := by
  haveI := Module.nontrivial R F
  have := minpoly.monic pb.isIntegral_gen
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Algebra R F
pb : PowerBasis R S
hf : Splits (algebraMap R F) (minpoly R pb.gen)
this✝ : Nontrivial R
this : Monic (minpoly R pb.gen)
⊢ (algebraMap R F) ((norm R) pb.gen) = Multiset.prod (aroots (minpoly R pb.gen) F)

Next tactic:
rw [PowerBasis.norm_gen_eq_coeff_zero_minpoly, ← pb.natDegree_minpoly, RingHom.map_mul,
    ← coeff_map,
    prod_roots_eq_coeff_zero_of_monic_of_split (this.map _) ((splits_id_iff_splits _).2 hf),
    this.natDegree_map, map_pow, ← mul_assoc, ← mul_pow]
/-- Given `pb : PowerBasis R S`, then the norm of `pb.gen` is
`((minpoly R pb.gen).aroots F).prod`. -/
theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
    (hf : (minpoly R pb.gen).Splits (algebraMap R F)) :
    algebraMap R F (norm R pb.gen) = ((minpoly R pb.gen).aroots F).prod := by
  haveI := Module.nontrivial R F
  have := minpoly.monic pb.isIntegral_gen
  rw [PowerBasis.norm_gen_eq_coeff_zero_minpoly, ← pb.natDegree_minpoly, RingHom.map_mul,
    ← coeff_map,
    prod_roots_eq_coeff_zero_of_monic_of_split (this.map _) ((splits_id_iff_splits _).2 hf),
    this.natDegree_map, map_pow, ← mul_assoc, ← mul_pow]
  · 

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : Ring S
inst✝⁶ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Field F
inst✝² : Algebra K L
inst✝¹ : Algebra K F
ι : Type w
inst✝ : Algebra R F
pb : PowerBasis R S
hf : Splits (algebraMap R F) (minpoly R pb.gen)
this✝ : Nontrivial R
this : Monic (minpoly R pb.gen)
⊢ ((algebraMap R F) (-1) * -1) ^ natDegree (minpoly R pb.gen) *
      Multiset.prod (roots (Polynomial.map (algebraMap R F) (minpoly R pb.gen))) =
    Multiset.prod (aroots (minpoly R pb.gen) F)

Next tactic:
simp only [map_neg, _root_.map_one, neg_mul, neg_neg, one_pow, one_mul]
@[simp]
theorem norm_zero [Nontrivial S] [Module.Free R S] [Module.Finite R S] : norm R (0 : S) = 0 := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Ring S
inst✝⁹ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁸ : Field K
inst✝⁷ : Field L
inst✝⁶ : Field F
inst✝⁵ : Algebra K L
inst✝⁴ : Algebra K F
ι : Type w
inst✝³ : Finite ι
inst✝² : Nontrivial S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
⊢ (norm R) 0 = 0

Next tactic:
nontriviality
@[simp]
theorem norm_zero [Nontrivial S] [Module.Free R S] [Module.Finite R S] : norm R (0 : S) = 0 := by
  nontriviality
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Ring S
inst✝⁹ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁸ : Field K
inst✝⁷ : Field L
inst✝⁶ : Field F
inst✝⁵ : Algebra K L
inst✝⁴ : Algebra K F
ι : Type w
inst✝³ : Finite ι
inst✝² : Nontrivial S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
✝ : Nontrivial R
⊢ (norm R) 0 = 0

Next tactic:
rw [norm_apply, coe_lmul_eq_mul, map_zero, LinearMap.det_zero' (Module.Free.chooseBasis R S)]
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
⊢ (norm R) x = 0 ↔ x = 0

Next tactic:
constructor
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  

Proof state:
case mp
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
⊢ (norm R) x = 0 → x = 0
case mpr
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
⊢ x = 0 → (norm R) x = 0

Next tactic:
let b := Module.Free.chooseBasis R S
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  

Proof state:
case mp
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
⊢ (norm R) x = 0 → x = 0
case mpr
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
⊢ x = 0 → (norm R) x = 0

Next tactic:
swap
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · 

Proof state:
case mpr
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
⊢ x = 0 → (norm R) x = 0

Next tactic:
rintro rfl
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; 

Proof state:
case mpr
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
⊢ (norm R) 0 = 0

Next tactic:
exact norm_zero
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · 

Proof state:
case mp
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
⊢ (norm R) x = 0 → x = 0

Next tactic:
letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    

Proof state:
case mp
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
⊢ (norm R) x = 0 → x = 0

Next tactic:
rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
    

Proof state:
case mp
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
⊢ (∃ v, v ≠ 0 ∧ mulVec ((leftMulMatrix b) x) v = 0) → x = 0

Next tactic:
rintro ⟨v, v_ne, hv⟩
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
    rintro ⟨v, v_ne, hv⟩
    

Proof state:
case mp.intro.intro
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
v : Module.Free.ChooseBasisIndex R S → R
v_ne : v ≠ 0
hv : mulVec ((leftMulMatrix b) x) v = 0
⊢ x = 0

Next tactic:
rw [← b.equivFun.apply_symm_apply v, b.equivFun_symm_apply, b.equivFun_apply,
      leftMulMatrix_mulVec_repr] at hv
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
    rintro ⟨v, v_ne, hv⟩
    rw [← b.equivFun.apply_symm_apply v, b.equivFun_symm_apply, b.equivFun_apply,
      leftMulMatrix_mulVec_repr] at hv
    

Proof state:
case mp.intro.intro
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
v : Module.Free.ChooseBasisIndex R S → R
v_ne : v ≠ 0
hv : ⇑(b.repr (x * ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i)) = 0
⊢ x = 0

Next tactic:
refine (mul_eq_zero.mp (b.ext_elem fun i => ?_)).resolve_right (show ∑ i, v i • b i ≠ 0 from ?_)
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
    rintro ⟨v, v_ne, hv⟩
    rw [← b.equivFun.apply_symm_apply v, b.equivFun_symm_apply, b.equivFun_apply,
      leftMulMatrix_mulVec_repr] at hv
    refine (mul_eq_zero.mp (b.ext_elem fun i => ?_)).resolve_right (show ∑ i, v i • b i ≠ 0 from ?_)
    · 

Proof state:
case mp.intro.intro.refine_1
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
v : Module.Free.ChooseBasisIndex R S → R
v_ne : v ≠ 0
hv : ⇑(b.repr (x * ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i)) = 0
i : Module.Free.ChooseBasisIndex R S
⊢ (b.repr (x * ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i)) i = (b.repr 0) i

Next tactic:
simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i