ring_theory.normMathlib.RingTheory.Norm

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -193,7 +193,7 @@ theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Fin
     rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
     rintro ⟨v, v_ne, hv⟩
     rw [← b.equiv_fun.apply_symm_apply v, b.equiv_fun_symm_apply, b.equiv_fun_apply,
-      left_mul_matrix_mul_vec_repr] at hv 
+      left_mul_matrix_mul_vec_repr] at hv
     refine' (mul_eq_zero.mp (b.ext_elem fun i => _)).resolve_right (show ∑ i, v i • b i ≠ 0 from _)
     · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i
     · contrapose! v_ne with sum_eq
@@ -396,7 +396,7 @@ theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSep
   rw [← isIntegral_algebraMap_iff (algebraMap K (AlgebraicClosureAux L)).Injective,
     norm_eq_prod_roots]
   · refine' (IsIntegral.multiset_prod fun y hy => _).pow _
-    rw [mem_roots_map (minpoly.ne_zero hx')] at hy 
+    rw [mem_roots_map (minpoly.ne_zero hx')] at hy
     use minpoly R x, minpoly.monic hx
     rw [← aeval_def] at hy ⊢
     exact minpoly.aeval_of_isScalarTower R x y hy
Diff
@@ -271,7 +271,7 @@ theorem IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegra
   rw [norm_eq_one_of_not_exists_basis]
   contrapose! hx
   obtain ⟨s, ⟨b⟩⟩ := hx
-  refine' isIntegral_of_mem_of_FG K⟮⟯.toSubalgebra _ x _
+  refine' IsIntegral.of_mem_of_fg K⟮⟯.toSubalgebra _ x _
   · exact (Submodule.fg_iff_finiteDimensional _).mpr (of_fintype_basis b)
   · exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x)
 #align intermediate_field.adjoin_simple.norm_gen_eq_one IntermediateField.AdjoinSimple.norm_gen_eq_one
@@ -392,7 +392,7 @@ theorem norm_eq_prod_automorphisms [FiniteDimensional K L] [IsGalois K L] (x : L
 theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSeparable K L]
     [FiniteDimensional K L] {x : L} (hx : IsIntegral R x) : IsIntegral R (norm K x) :=
   by
-  have hx' : IsIntegral K x := isIntegral_of_isScalarTower hx
+  have hx' : IsIntegral K x := IsIntegral.tower_top hx
   rw [← isIntegral_algebraMap_iff (algebraMap K (AlgebraicClosureAux L)).Injective,
     norm_eq_prod_roots]
   · refine' (IsIntegral.multiset_prod fun y hy => _).pow _
Diff
@@ -3,13 +3,13 @@ Copyright (c) 2021 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen
 -/
-import Mathbin.FieldTheory.PrimitiveElement
-import Mathbin.LinearAlgebra.Determinant
-import Mathbin.LinearAlgebra.FiniteDimensional
-import Mathbin.LinearAlgebra.Matrix.Charpoly.Minpoly
-import Mathbin.LinearAlgebra.Matrix.ToLinearEquiv
-import Mathbin.FieldTheory.IsAlgClosed.AlgebraicClosure
-import Mathbin.FieldTheory.Galois
+import FieldTheory.PrimitiveElement
+import LinearAlgebra.Determinant
+import LinearAlgebra.FiniteDimensional
+import LinearAlgebra.Matrix.Charpoly.Minpoly
+import LinearAlgebra.Matrix.ToLinearEquiv
+import FieldTheory.IsAlgClosed.AlgebraicClosure
+import FieldTheory.Galois
 
 #align_import ring_theory.norm from "leanprover-community/mathlib"@"e8e130de9dba4ed6897183c3193c752ffadbcc77"
 
Diff
@@ -377,9 +377,9 @@ theorem norm_eq_prod_embeddings [FiniteDimensional K L] [IsSeparable K L] [IsAlg
 theorem norm_eq_prod_automorphisms [FiniteDimensional K L] [IsGalois K L] (x : L) :
     algebraMap K L (norm K x) = ∏ σ : L ≃ₐ[K] L, σ x :=
   by
-  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
-  rw [map_prod (algebraMap L (AlgebraicClosure L))]
-  rw [← Fintype.prod_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
+  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosureAux L)
+  rw [map_prod (algebraMap L (AlgebraicClosureAux L))]
+  rw [← Fintype.prod_equiv (Normal.algHomEquivAut K (AlgebraicClosureAux L) L)]
   · rw [← norm_eq_prod_embeddings]
     simp only [algebra_map_eq_smul_one, smul_one_smul]
   · intro σ
@@ -393,7 +393,8 @@ theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSep
     [FiniteDimensional K L] {x : L} (hx : IsIntegral R x) : IsIntegral R (norm K x) :=
   by
   have hx' : IsIntegral K x := isIntegral_of_isScalarTower hx
-  rw [← isIntegral_algebraMap_iff (algebraMap K (AlgebraicClosure L)).Injective, norm_eq_prod_roots]
+  rw [← isIntegral_algebraMap_iff (algebraMap K (AlgebraicClosureAux L)).Injective,
+    norm_eq_prod_roots]
   · refine' (IsIntegral.multiset_prod fun y hy => _).pow _
     rw [mem_roots_map (minpoly.ne_zero hx')] at hy 
     use minpoly R x, minpoly.monic hx
@@ -413,7 +414,7 @@ theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F)
   by
   by_cases hKF : FiniteDimensional K F
   · haveI := hKF
-    let A := AlgebraicClosure K
+    let A := AlgebraicClosureAux K
     apply (algebraMap K A).Injective
     haveI : FiniteDimensional L F := FiniteDimensional.right K L F
     haveI : FiniteDimensional K L := FiniteDimensional.left K L F
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen
-
-! This file was ported from Lean 3 source module ring_theory.norm
-! leanprover-community/mathlib commit e8e130de9dba4ed6897183c3193c752ffadbcc77
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.FieldTheory.PrimitiveElement
 import Mathbin.LinearAlgebra.Determinant
@@ -16,6 +11,8 @@ import Mathbin.LinearAlgebra.Matrix.ToLinearEquiv
 import Mathbin.FieldTheory.IsAlgClosed.AlgebraicClosure
 import Mathbin.FieldTheory.Galois
 
+#align_import ring_theory.norm from "leanprover-community/mathlib"@"e8e130de9dba4ed6897183c3193c752ffadbcc77"
+
 /-!
 # Norm for (finite) ring extensions
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen
 
 ! This file was ported from Lean 3 source module ring_theory.norm
-! leanprover-community/mathlib commit fecd3520d2a236856f254f27714b80dcfe28ea57
+! leanprover-community/mathlib commit e8e130de9dba4ed6897183c3193c752ffadbcc77
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -19,6 +19,9 @@ import Mathbin.FieldTheory.Galois
 /-!
 # Norm for (finite) ring extensions
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Suppose we have an `R`-algebra `S` with a finite basis. For each `s : S`,
 the determinant of the linear map given by multiplying by `s` gives information
 about the roots of the minimal polynomial of `s` over `R`.
Diff
@@ -70,34 +70,45 @@ namespace Algebra
 
 variable (R)
 
+#print Algebra.norm /-
 /-- The norm of an element `s` of an `R`-algebra is the determinant of `(*) s`. -/
 noncomputable def norm : S →* R :=
   LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom
 #align algebra.norm Algebra.norm
+-/
 
+#print Algebra.norm_apply /-
 theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) :=
   rfl
 #align algebra.norm_apply Algebra.norm_apply
+-/
 
+#print Algebra.norm_eq_one_of_not_exists_basis /-
 theorem norm_eq_one_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) (x : S) :
     norm R x = 1 := by rw [norm_apply, LinearMap.det]; split_ifs with h; rfl
 #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_basis
+-/
 
 variable {R}
 
+#print Algebra.norm_eq_one_of_not_module_finite /-
 theorem norm_eq_one_of_not_module_finite (h : ¬Module.Finite R S) (x : S) : norm R x = 1 :=
   by
   refine' norm_eq_one_of_not_exists_basis _ (mt _ h) _
   rintro ⟨s, ⟨b⟩⟩
   exact Module.Finite.of_basis b
 #align algebra.norm_eq_one_of_not_module_finite Algebra.norm_eq_one_of_not_module_finite
+-/
 
+#print Algebra.norm_eq_matrix_det /-
 -- Can't be a `simp` lemma because it depends on a choice of basis
 theorem norm_eq_matrix_det [Fintype ι] [DecidableEq ι] (b : Basis ι R S) (s : S) :
     norm R s = Matrix.det (Algebra.leftMulMatrix b s) := by
   rwa [norm_apply, ← LinearMap.det_toMatrix b, ← to_matrix_lmul_eq]; rfl
 #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det
+-/
 
+#print Algebra.norm_algebraMap_of_basis /-
 /-- 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 ι :=
@@ -108,7 +119,9 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
   · ext i j; rw [to_matrix_lsmul, Matrix.diagonal]
   · rw [Finset.prod_const, Finset.card_univ]
 #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis
+-/
 
+#print Algebra.norm_algebraMap /-
 /-- 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)`.)
@@ -123,9 +136,11 @@ protected theorem norm_algebraMap {L : Type _} [Ring L] [Algebra K L] (x : K) :
     rintro ⟨s, ⟨b⟩⟩
     exact H ⟨s, ⟨b⟩⟩
 #align algebra.norm_algebra_map Algebra.norm_algebraMap
+-/
 
 section EqProdRoots
 
+#print Algebra.PowerBasis.norm_gen_eq_coeff_zero_minpoly /-
 /-- Given `pb : power_basis 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) :
@@ -133,7 +148,9 @@ theorem PowerBasis.norm_gen_eq_coeff_zero_minpoly (pb : PowerBasis R S) :
   rw [norm_eq_matrix_det pb.basis, det_eq_sign_charpoly_coeff, charpoly_leftMulMatrix,
     Fintype.card_fin]
 #align algebra.power_basis.norm_gen_eq_coeff_zero_minpoly Algebra.PowerBasis.norm_gen_eq_coeff_zero_minpoly
+-/
 
+#print Algebra.PowerBasis.norm_gen_eq_prod_roots /-
 /-- Given `pb : power_basis R S`, then the norm of `pb.gen` is
 `((minpoly R pb.gen).map (algebra_map R F)).roots.prod`. -/
 theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
@@ -148,6 +165,7 @@ theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
     this.nat_degree_map, map_pow, ← mul_assoc, ← mul_pow]
   · simp only [map_neg, _root_.map_one, neg_mul, neg_neg, one_pow, one_mul]; infer_instance
 #align algebra.power_basis.norm_gen_eq_prod_roots Algebra.PowerBasis.norm_gen_eq_prod_roots
+-/
 
 end EqProdRoots
 
@@ -155,13 +173,16 @@ section EqZeroIff
 
 variable [Finite ι]
 
+#print Algebra.norm_zero /-
 @[simp]
 theorem norm_zero [Nontrivial S] [Module.Free R S] [Module.Finite R S] : norm R (0 : S) = 0 :=
   by
   nontriviality
   rw [norm_apply, coe_lmul_eq_mul, map_zero, LinearMap.det_zero' (Module.Free.chooseBasis R S)]
 #align algebra.norm_zero Algebra.norm_zero
+-/
 
+#print Algebra.norm_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
@@ -179,19 +200,25 @@ theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Fin
       apply b.equiv_fun.symm.injective
       rw [b.equiv_fun_symm_apply, sum_eq, LinearEquiv.map_zero]
 #align algebra.norm_eq_zero_iff Algebra.norm_eq_zero_iff
+-/
 
+#print Algebra.norm_ne_zero_iff /-
 theorem norm_ne_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
     norm R x ≠ 0 ↔ x ≠ 0 :=
   not_iff_not.mpr norm_eq_zero_iff
 #align algebra.norm_ne_zero_iff Algebra.norm_ne_zero_iff
+-/
 
+#print Algebra.norm_eq_zero_iff' /-
 /-- This is `algebra.norm_eq_zero_iff` composed with `algebra.norm_apply`. -/
 @[simp]
 theorem norm_eq_zero_iff' [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
     LinearMap.det (LinearMap.mul R S x) = 0 ↔ x = 0 :=
   norm_eq_zero_iff
 #align algebra.norm_eq_zero_iff' Algebra.norm_eq_zero_iff'
+-/
 
+#print Algebra.norm_eq_zero_iff_of_basis /-
 theorem norm_eq_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} :
     Algebra.norm R x = 0 ↔ x = 0 :=
   by
@@ -199,11 +226,14 @@ theorem norm_eq_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {
   haveI : Module.Finite R S := Module.Finite.of_basis b
   exact norm_eq_zero_iff
 #align algebra.norm_eq_zero_iff_of_basis Algebra.norm_eq_zero_iff_of_basis
+-/
 
+#print Algebra.norm_ne_zero_iff_of_basis /-
 theorem norm_ne_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} :
     Algebra.norm R x ≠ 0 ↔ x ≠ 0 :=
   not_iff_not.mpr (norm_eq_zero_iff_of_basis b)
 #align algebra.norm_ne_zero_iff_of_basis Algebra.norm_ne_zero_iff_of_basis
+-/
 
 end EqZeroIff
 
@@ -214,6 +244,7 @@ variable (K)
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
+#print Algebra.norm_eq_norm_adjoin /-
 theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
     norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮⟯ L :=
   by
@@ -226,12 +257,14 @@ theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
   congr
   rw [← PowerBasis.finrank, adjoin_simple.algebra_map_gen K x]
 #align algebra.norm_eq_norm_adjoin Algebra.norm_eq_norm_adjoin
+-/
 
 variable {K}
 
 section IntermediateField
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
+#print IntermediateField.AdjoinSimple.norm_gen_eq_one /-
 theorem IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
     norm K (AdjoinSimple.gen K x) = 1 :=
   by
@@ -242,8 +275,10 @@ theorem IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegra
   · exact (Submodule.fg_iff_finiteDimensional _).mpr (of_fintype_basis b)
   · exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x)
 #align intermediate_field.adjoin_simple.norm_gen_eq_one IntermediateField.AdjoinSimple.norm_gen_eq_one
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
+#print IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots /-
 theorem IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
     (hf : (minpoly K x).Splits (algebraMap K F)) :
     (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
@@ -261,6 +296,7 @@ theorem IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
     try simp only [adjoin_simple.algebra_map_gen _ _]
   exact hf
 #align intermediate_field.adjoin_simple.norm_gen_eq_prod_roots IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots
+-/
 
 end IntermediateField
 
@@ -270,6 +306,7 @@ open IntermediateField IntermediateField.AdjoinSimple Polynomial
 
 variable (F) (E : Type _) [Field E] [Algebra K E]
 
+#print Algebra.norm_eq_prod_embeddings_gen /-
 theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S)
     (hE : (minpoly R pb.gen).Splits (algebraMap R F)) (hfx : (minpoly R pb.gen).Separable) :
     algebraMap R F (norm R pb.gen) = (@Finset.univ pb.AlgHom.Fintype).Prod fun σ => σ pb.gen :=
@@ -282,15 +319,19 @@ theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S)
   · intro x; rfl
   · intro σ; rw [pb.lift_equiv'_apply_coe, id.def]
 #align algebra.norm_eq_prod_embeddings_gen Algebra.norm_eq_prod_embeddings_gen
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
+#print Algebra.norm_eq_prod_roots /-
 theorem norm_eq_prod_roots [IsSeparable K L] [FiniteDimensional K L] {x : L}
     (hF : (minpoly K x).Splits (algebraMap K F)) :
     algebraMap K F (norm K x) = ((minpoly K x).map (algebraMap K F)).roots.Prod ^ finrank K⟮⟯ L :=
   by
   rw [norm_eq_norm_adjoin K x, map_pow, IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots _ hF]
 #align algebra.norm_eq_prod_roots Algebra.norm_eq_prod_roots
+-/
 
+#print Algebra.prod_embeddings_eq_finrank_pow /-
 theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAlgClosed E]
     [IsSeparable K F] [FiniteDimensional K F] (pb : PowerBasis K L) :
     ∏ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
@@ -311,10 +352,12 @@ theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAl
     simp only [algHomEquivSigma, Equiv.coe_fn_mk, AlgHom.restrictDomain, AlgHom.comp_apply,
       IsScalarTower.coe_toAlgHom']
 #align algebra.prod_embeddings_eq_finrank_pow Algebra.prod_embeddings_eq_finrank_pow
+-/
 
 variable (K)
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
+#print Algebra.norm_eq_prod_embeddings /-
 /-- For `L/K` a finite separable extension of fields and `E` an algebraically closed extension
 of `K`, the norm (down to `K`) of an element `x` of `L` is equal to the product of the images
 of `x` over all the `K`-embeddings `σ`  of `L` into `E`. -/
@@ -328,7 +371,9 @@ theorem norm_eq_prod_embeddings [FiniteDimensional K L] [IsSeparable K L] [IsAlg
   · haveI := isSeparable_tower_bot_of_isSeparable K K⟮⟯ L
     exact IsSeparable.separable K _
 #align algebra.norm_eq_prod_embeddings Algebra.norm_eq_prod_embeddings
+-/
 
+#print Algebra.norm_eq_prod_automorphisms /-
 theorem norm_eq_prod_automorphisms [FiniteDimensional K L] [IsGalois K L] (x : L) :
     algebraMap K L (norm K x) = ∏ σ : L ≃ₐ[K] L, σ x :=
   by
@@ -341,7 +386,9 @@ theorem norm_eq_prod_automorphisms [FiniteDimensional K L] [IsGalois K L] (x : L
     simp only [Normal.algHomEquivAut, AlgHom.restrictNormal', Equiv.coe_fn_mk,
       AlgEquiv.coe_ofBijective, AlgHom.restrictNormal_commutes, id.map_eq_id, RingHom.id_apply]
 #align algebra.norm_eq_prod_automorphisms Algebra.norm_eq_prod_automorphisms
+-/
 
+#print Algebra.isIntegral_norm /-
 theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSeparable K L]
     [FiniteDimensional K L] {x : L} (hx : IsIntegral R x) : IsIntegral R (norm K x) :=
   by
@@ -355,9 +402,11 @@ theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSep
   · apply IsAlgClosed.splits_codomain
   · infer_instance
 #align algebra.is_integral_norm Algebra.isIntegral_norm
+-/
 
 variable {F} (L)
 
+#print Algebra.norm_norm /-
 -- TODO. Generalize this proof to rings
 theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
     norm K (norm L x) = norm K x :=
@@ -396,6 +445,7 @@ theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F)
       rw [norm_eq_one_of_not_module_finite hLF, _root_.map_one]
     · rw [norm_eq_one_of_not_module_finite hKL]
 #align algebra.norm_norm Algebra.norm_norm
+-/
 
 end EqProdEmbeddings
 
Diff
@@ -105,7 +105,7 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
   haveI := Classical.decEq ι
   rw [norm_apply, ← det_to_matrix b, lmul_algebra_map]
   convert @det_diagonal _ _ _ _ _ fun i : ι => x
-  · ext (i j); rw [to_matrix_lsmul, Matrix.diagonal]
+  · ext i j; rw [to_matrix_lsmul, Matrix.diagonal]
   · rw [Finset.prod_const, Finset.card_univ]
 #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis
 
Diff
@@ -173,8 +173,7 @@ theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Fin
     rintro ⟨v, v_ne, hv⟩
     rw [← b.equiv_fun.apply_symm_apply v, b.equiv_fun_symm_apply, b.equiv_fun_apply,
       left_mul_matrix_mul_vec_repr] at hv 
-    refine'
-      (mul_eq_zero.mp (b.ext_elem fun i => _)).resolve_right (show (∑ i, v i • b i) ≠ 0 from _)
+    refine' (mul_eq_zero.mp (b.ext_elem fun i => _)).resolve_right (show ∑ i, v i • b i ≠ 0 from _)
     · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i
     · contrapose! v_ne with sum_eq
       apply b.equiv_fun.symm.injective
@@ -294,7 +293,7 @@ theorem norm_eq_prod_roots [IsSeparable K L] [FiniteDimensional K L] {x : L}
 
 theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAlgClosed E]
     [IsSeparable K F] [FiniteDimensional K F] (pb : PowerBasis K L) :
-    (∏ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen)) =
+    ∏ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
       ((@Finset.univ pb.AlgHom.Fintype).Prod fun σ : L →ₐ[K] E => σ pb.gen) ^ finrank L F :=
   by
   haveI : FiniteDimensional L F := FiniteDimensional.right K L F
@@ -382,7 +381,7 @@ theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F)
     suffices
       ∀ σ : L →ₐ[K] A,
         haveI := σ.to_ring_hom.to_algebra
-        (∏ π : F →ₐ[L] A, π x) = σ (norm L x)
+        ∏ π : F →ₐ[L] A, π x = σ (norm L x)
       by simp_rw [← Finset.univ_sigma_univ, Finset.prod_sigma, this, norm_eq_prod_embeddings]
     · intro σ
       letI : Algebra L A := σ.to_ring_hom.to_algebra
Diff
@@ -104,7 +104,7 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
   by
   haveI := Classical.decEq ι
   rw [norm_apply, ← det_to_matrix b, lmul_algebra_map]
-  convert@det_diagonal _ _ _ _ _ fun i : ι => x
+  convert @det_diagonal _ _ _ _ _ fun i : ι => x
   · ext (i j); rw [to_matrix_lsmul, Matrix.diagonal]
   · rw [Finset.prod_const, Finset.card_univ]
 #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis
Diff
@@ -172,7 +172,7 @@ theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Fin
     rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
     rintro ⟨v, v_ne, hv⟩
     rw [← b.equiv_fun.apply_symm_apply v, b.equiv_fun_symm_apply, b.equiv_fun_apply,
-      left_mul_matrix_mul_vec_repr] at hv
+      left_mul_matrix_mul_vec_repr] at hv 
     refine'
       (mul_eq_zero.mp (b.ext_elem fun i => _)).resolve_right (show (∑ i, v i • b i) ≠ 0 from _)
     · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i
@@ -349,9 +349,9 @@ theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSep
   have hx' : IsIntegral K x := isIntegral_of_isScalarTower hx
   rw [← isIntegral_algebraMap_iff (algebraMap K (AlgebraicClosure L)).Injective, norm_eq_prod_roots]
   · refine' (IsIntegral.multiset_prod fun y hy => _).pow _
-    rw [mem_roots_map (minpoly.ne_zero hx')] at hy
+    rw [mem_roots_map (minpoly.ne_zero hx')] at hy 
     use minpoly R x, minpoly.monic hx
-    rw [← aeval_def] at hy⊢
+    rw [← aeval_def] at hy ⊢
     exact minpoly.aeval_of_isScalarTower R x y hy
   · apply IsAlgClosed.splits_codomain
   · infer_instance
@@ -378,7 +378,7 @@ theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F)
       fun _ => inferInstance
     rw [norm_eq_prod_embeddings K A (_ : F),
       Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] A => σ x)
-        (fun π : Σf : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
+        (fun π : Σ f : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
     suffices
       ∀ σ : L →ₐ[K] A,
         haveI := σ.to_ring_hom.to_algebra
Diff
@@ -62,9 +62,9 @@ open LinearMap
 
 open Matrix Polynomial
 
-open BigOperators
+open scoped BigOperators
 
-open Matrix
+open scoped Matrix
 
 namespace Algebra
 
Diff
@@ -80,10 +80,7 @@ theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) :=
 #align algebra.norm_apply Algebra.norm_apply
 
 theorem norm_eq_one_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) (x : S) :
-    norm R x = 1 := by
-  rw [norm_apply, LinearMap.det]
-  split_ifs with h
-  rfl
+    norm R x = 1 := by rw [norm_apply, LinearMap.det]; split_ifs with h; rfl
 #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_basis
 
 variable {R}
@@ -97,10 +94,8 @@ theorem norm_eq_one_of_not_module_finite (h : ¬Module.Finite R S) (x : S) : nor
 
 -- Can't be a `simp` lemma because it depends on a choice of basis
 theorem norm_eq_matrix_det [Fintype ι] [DecidableEq ι] (b : Basis ι R S) (s : S) :
-    norm R s = Matrix.det (Algebra.leftMulMatrix b s) :=
-  by
-  rwa [norm_apply, ← LinearMap.det_toMatrix b, ← to_matrix_lmul_eq]
-  rfl
+    norm R s = Matrix.det (Algebra.leftMulMatrix b s) := by
+  rwa [norm_apply, ← LinearMap.det_toMatrix b, ← to_matrix_lmul_eq]; rfl
 #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det
 
 /-- If `x` is in the base ring `K`, then the norm is `x ^ [L : K]`. -/
@@ -110,8 +105,7 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
   haveI := Classical.decEq ι
   rw [norm_apply, ← det_to_matrix b, lmul_algebra_map]
   convert@det_diagonal _ _ _ _ _ fun i : ι => x
-  · ext (i j)
-    rw [to_matrix_lsmul, Matrix.diagonal]
+  · ext (i j); rw [to_matrix_lsmul, Matrix.diagonal]
   · rw [Finset.prod_const, Finset.card_univ]
 #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis
 
@@ -173,9 +167,7 @@ theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Fin
     norm R x = 0 ↔ x = 0 := by
   constructor
   let b := Module.Free.chooseBasis R S
-  swap;
-  · rintro rfl
-    exact norm_zero
+  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⟩
@@ -259,8 +251,7 @@ theorem IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
       ((minpoly K x).map (algebraMap K F)).roots.Prod :=
   by
   have injKxL := (algebraMap K⟮⟯ L).Injective
-  by_cases hx : IsIntegral K x
-  swap
+  by_cases hx : IsIntegral K x; swap
   · simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx]
   have hx' : IsIntegral K (adjoin_simple.gen K x) :=
     by
@@ -289,10 +280,8 @@ theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S)
     Finset.prod_eq_multiset_prod, Multiset.toFinset_val, multiset.dedup_eq_self.mpr,
     Multiset.map_id]
   · exact nodup_roots hfx.map
-  · intro x
-    rfl
-  · intro σ
-    rw [pb.lift_equiv'_apply_coe, id.def]
+  · intro x; rfl
+  · intro σ; rw [pb.lift_equiv'_apply_coe, id.def]
 #align algebra.norm_eq_prod_embeddings_gen Algebra.norm_eq_prod_embeddings_gen
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
Diff
@@ -247,7 +247,7 @@ theorem IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegra
   rw [norm_eq_one_of_not_exists_basis]
   contrapose! hx
   obtain ⟨s, ⟨b⟩⟩ := hx
-  refine' isIntegral_of_mem_of_fG K⟮⟯.toSubalgebra _ x _
+  refine' isIntegral_of_mem_of_FG K⟮⟯.toSubalgebra _ x _
   · exact (Submodule.fg_iff_finiteDimensional _).mpr (of_fintype_basis b)
   · exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x)
 #align intermediate_field.adjoin_simple.norm_gen_eq_one IntermediateField.AdjoinSimple.norm_gen_eq_one
Diff
@@ -247,7 +247,7 @@ theorem IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegra
   rw [norm_eq_one_of_not_exists_basis]
   contrapose! hx
   obtain ⟨s, ⟨b⟩⟩ := hx
-  refine' isIntegral_of_mem_of_fg K⟮⟯.toSubalgebra _ x _
+  refine' isIntegral_of_mem_of_fG K⟮⟯.toSubalgebra _ x _
   · exact (Submodule.fg_iff_finiteDimensional _).mpr (of_fintype_basis b)
   · exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x)
 #align intermediate_field.adjoin_simple.norm_gen_eq_one IntermediateField.AdjoinSimple.norm_gen_eq_one
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen
 
 ! This file was ported from Lean 3 source module ring_theory.norm
-! leanprover-community/mathlib commit 5fe298160aa02b0f3cf95690a1265232cdd9563c
+! leanprover-community/mathlib commit fecd3520d2a236856f254f27714b80dcfe28ea57
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -88,6 +88,13 @@ theorem norm_eq_one_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis
 
 variable {R}
 
+theorem norm_eq_one_of_not_module_finite (h : ¬Module.Finite R S) (x : S) : norm R x = 1 :=
+  by
+  refine' norm_eq_one_of_not_exists_basis _ (mt _ h) _
+  rintro ⟨s, ⟨b⟩⟩
+  exact Module.Finite.of_basis b
+#align algebra.norm_eq_one_of_not_module_finite Algebra.norm_eq_one_of_not_module_finite
+
 -- Can't be a `simp` lemma because it depends on a choice of basis
 theorem norm_eq_matrix_det [Fintype ι] [DecidableEq ι] (b : Basis ι R S) (s : S) :
     norm R s = Matrix.det (Algebra.leftMulMatrix b s) :=
@@ -323,7 +330,7 @@ variable (K)
 /-- For `L/K` a finite separable extension of fields and `E` an algebraically closed extension
 of `K`, the norm (down to `K`) of an element `x` of `L` is equal to the product of the images
 of `x` over all the `K`-embeddings `σ`  of `L` into `E`. -/
-theorem norm_eq_prod_embeddings [FiniteDimensional K L] [IsSeparable K L] [IsAlgClosed E] {x : L} :
+theorem norm_eq_prod_embeddings [FiniteDimensional K L] [IsSeparable K L] [IsAlgClosed E] (x : L) :
     algebraMap K E (norm K x) = ∏ σ : L →ₐ[K] E, σ x :=
   by
   have hx := IsSeparable.isIntegral K x
@@ -361,6 +368,47 @@ theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSep
   · infer_instance
 #align algebra.is_integral_norm Algebra.isIntegral_norm
 
+variable {F} (L)
+
+-- TODO. Generalize this proof to rings
+theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
+    norm K (norm L x) = norm K x :=
+  by
+  by_cases hKF : FiniteDimensional K F
+  · haveI := hKF
+    let A := AlgebraicClosure K
+    apply (algebraMap K A).Injective
+    haveI : FiniteDimensional L F := FiniteDimensional.right K L F
+    haveI : FiniteDimensional K L := FiniteDimensional.left K L F
+    haveI : IsSeparable K L := isSeparable_tower_bot_of_isSeparable K L F
+    haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
+    letI :
+      ∀ σ : L →ₐ[K] A,
+        haveI := σ.to_ring_hom.to_algebra
+        Fintype (F →ₐ[L] A) :=
+      fun _ => inferInstance
+    rw [norm_eq_prod_embeddings K A (_ : F),
+      Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] A => σ x)
+        (fun π : Σf : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
+    suffices
+      ∀ σ : L →ₐ[K] A,
+        haveI := σ.to_ring_hom.to_algebra
+        (∏ π : F →ₐ[L] A, π x) = σ (norm L x)
+      by simp_rw [← Finset.univ_sigma_univ, Finset.prod_sigma, this, norm_eq_prod_embeddings]
+    · intro σ
+      letI : Algebra L A := σ.to_ring_hom.to_algebra
+      rw [← norm_eq_prod_embeddings L A (_ : F)]
+      rfl
+  · rw [norm_eq_one_of_not_module_finite hKF]
+    by_cases hKL : FiniteDimensional K L
+    · have hLF : ¬FiniteDimensional L F := by
+        refine' (mt _) hKF
+        intro hKF
+        exact FiniteDimensional.trans K L F
+      rw [norm_eq_one_of_not_module_finite hLF, _root_.map_one]
+    · rw [norm_eq_one_of_not_module_finite hKL]
+#align algebra.norm_norm Algebra.norm_norm
+
 end EqProdEmbeddings
 
 end Algebra
Diff
@@ -72,10 +72,10 @@ variable (R)
 
 /-- The norm of an element `s` of an `R`-algebra is the determinant of `(*) s`. -/
 noncomputable def norm : S →* R :=
-  LinearMap.det.comp (LinearMap.Algebra.lmul R S).toRingHom.toMonoidHom
+  LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom
 #align algebra.norm Algebra.norm
 
-theorem norm_apply (x : S) : norm R x = LinearMap.det (LinearMap.Algebra.lmul R S x) :=
+theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) :=
   rfl
 #align algebra.norm_apply Algebra.norm_apply
 
Diff
@@ -314,7 +314,7 @@ theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAl
     rw [AlgHom.card L F E]
   · intro σ
     simp only [algHomEquivSigma, Equiv.coe_fn_mk, AlgHom.restrictDomain, AlgHom.comp_apply,
-      IsScalarTower.coe_to_alg_hom']
+      IsScalarTower.coe_toAlgHom']
 #align algebra.prod_embeddings_eq_finrank_pow Algebra.prod_embeddings_eq_finrank_pow
 
 variable (K)
Diff
@@ -102,7 +102,7 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
   by
   haveI := Classical.decEq ι
   rw [norm_apply, ← det_to_matrix b, lmul_algebra_map]
-  convert @det_diagonal _ _ _ _ _ fun i : ι => x
+  convert@det_diagonal _ _ _ _ _ fun i : ι => x
   · ext (i j)
     rw [to_matrix_lsmul, Matrix.diagonal]
   · rw [Finset.prod_const, Finset.card_univ]
Diff
@@ -72,10 +72,10 @@ variable (R)
 
 /-- The norm of an element `s` of an `R`-algebra is the determinant of `(*) s`. -/
 noncomputable def norm : S →* R :=
-  LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom
+  LinearMap.det.comp (LinearMap.Algebra.lmul R S).toRingHom.toMonoidHom
 #align algebra.norm Algebra.norm
 
-theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) :=
+theorem norm_apply (x : S) : norm R x = LinearMap.det (LinearMap.Algebra.lmul R S x) :=
   rfl
 #align algebra.norm_apply Algebra.norm_apply
 
Diff
@@ -197,7 +197,7 @@ theorem norm_eq_zero_iff' [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Fi
 theorem norm_eq_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} :
     Algebra.norm R x = 0 ↔ x = 0 :=
   by
-  haveI : Module.Free R S := Module.Free.ofBasis b
+  haveI : Module.Free R S := Module.Free.of_basis b
   haveI : Module.Finite R S := Module.Finite.of_basis b
   exact norm_eq_zero_iff
 #align algebra.norm_eq_zero_iff_of_basis Algebra.norm_eq_zero_iff_of_basis

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -153,7 +153,7 @@ theorem norm_zero [Nontrivial S] [Module.Free R S] [Module.Finite R S] : norm R
 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
+  on_goal 1 => let b := Module.Free.chooseBasis R S
   swap
   · rintro rfl; exact norm_zero
   · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
@@ -252,10 +252,10 @@ theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S)
   rw [PowerBasis.norm_gen_eq_prod_roots pb hE]
   rw [@Fintype.prod_equiv (S →ₐ[R] F) _ _ (PowerBasis.AlgHom.fintype pb) _ _ pb.liftEquiv'
     (fun σ => σ pb.gen) (fun x => x) ?_]
-  rw [Finset.prod_mem_multiset, Finset.prod_eq_multiset_prod, Multiset.toFinset_val,
-    Multiset.dedup_eq_self.mpr, Multiset.map_id]
-  · exact nodup_roots hfx.map
-  · intro x; rfl
+  · rw [Finset.prod_mem_multiset, Finset.prod_eq_multiset_prod, Multiset.toFinset_val,
+      Multiset.dedup_eq_self.mpr, Multiset.map_id]
+    · exact nodup_roots hfx.map
+    · intro x; rfl
   · intro σ; simp only [PowerBasis.liftEquiv'_apply_coe]
 #align algebra.norm_eq_prod_embeddings_gen Algebra.norm_eq_prod_embeddings_gen
 
@@ -274,11 +274,10 @@ theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAl
   haveI : FiniteDimensional L F := FiniteDimensional.right K L F
   haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
   letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
-  letI : ∀ f : L →ₐ[K] E, Fintype (@AlgHom L F E _ _ _ _ f.toRingHom.toAlgebra) := ?_
   rw [Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen,
     ← Finset.univ_sigma_univ, Finset.prod_sigma, ← Finset.prod_pow]
-  refine Finset.prod_congr rfl fun σ _ => ?_
-  · letI : Algebra L E := σ.toRingHom.toAlgebra
+  · refine Finset.prod_congr rfl fun σ _ => ?_
+    letI : Algebra L E := σ.toRingHom.toAlgebra
     simp_rw [Finset.prod_const]
     congr
     exact AlgHom.card L F E
@@ -308,8 +307,8 @@ theorem norm_eq_prod_automorphisms [FiniteDimensional K L] [IsGalois K L] (x : L
   rw [map_prod (algebraMap L (AlgebraicClosure L))]
   rw [← Fintype.prod_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
   · rw [← norm_eq_prod_embeddings]
-    simp only [algebraMap_eq_smul_one, smul_one_smul]
-    rfl
+    · simp only [algebraMap_eq_smul_one, smul_one_smul]
+      rfl
   · intro σ
     simp only [Normal.algHomEquivAut, AlgHom.restrictNormal', Equiv.coe_fn_mk,
       AlgEquiv.coe_ofBijective, AlgHom.restrictNormal_commutes, id.map_eq_id, RingHom.id_apply]
@@ -355,10 +354,10 @@ lemma norm_eq_of_equiv_equiv {A₁ B₁ A₂ B₂ : Type*} [CommRing A₁] [Ring
     (he : RingHom.comp (algebraMap A₂ B₂) ↑e₁ = RingHom.comp ↑e₂ (algebraMap A₁ B₁)) (x) :
     Algebra.norm A₁ x = e₁.symm (Algebra.norm A₂ (e₂ x)) := by
   letI := (RingHom.comp (e₂ : B₁ →+* B₂) (algebraMap A₁ B₁)).toAlgebra' ?_
-  let e' : B₁ ≃ₐ[A₁] B₂ := { e₂ with commutes' := fun _ ↦ rfl }
-  rw [← Algebra.norm_eq_of_ringEquiv e₁ he, ← Algebra.norm_eq_of_algEquiv e',
-    RingEquiv.symm_apply_apply]
-  rfl
+  · let e' : B₁ ≃ₐ[A₁] B₂ := { e₂ with commutes' := fun _ ↦ rfl }
+    rw [← Algebra.norm_eq_of_ringEquiv e₁ he, ← Algebra.norm_eq_of_algEquiv e',
+      RingEquiv.symm_apply_apply]
+    rfl
   intros c x
   apply e₂.symm.injective
   simp only [RingHom.coe_comp, RingHom.coe_coe, Function.comp_apply, _root_.map_mul,
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -44,13 +44,9 @@ See also `Algebra.trace`, which is defined similarly as the trace of
 universe u v w
 
 variable {R S T : Type*} [CommRing R] [Ring S]
-
 variable [Algebra R S]
-
 variable {K L F : Type*} [Field K] [Field L] [Field F]
-
 variable [Algebra K L] [Algebra K F]
-
 variable {ι : Type w}
 
 open FiniteDimensional
chore: Remove unnecessary "rw"s (#10704)

Remove unnecessary "rw"s.

Diff
@@ -99,7 +99,7 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
   haveI := Classical.decEq ι
   rw [norm_apply, ← det_toMatrix b, lmul_algebraMap]
   convert @det_diagonal _ _ _ _ _ fun _ : ι => x
-  · ext (i j); rw [toMatrix_lsmul, Matrix.diagonal]
+  · ext (i j); rw [toMatrix_lsmul]
   · rw [Finset.prod_const, Finset.card_univ]
 #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis
 
feat: Norm and trace under isomorphisms. (#8682)

Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>

Diff
@@ -331,6 +331,43 @@ theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSep
   · apply IsAlgClosed.splits_codomain
 #align algebra.is_integral_norm Algebra.isIntegral_norm
 
+lemma norm_eq_of_algEquiv [Ring T] [Algebra R T] (e : S ≃ₐ[R] T) (x) :
+    Algebra.norm R (e x) = Algebra.norm R x := by
+  simp_rw [Algebra.norm_apply, ← LinearMap.det_conj _ e.toLinearEquiv]; congr; ext; simp
+
+lemma norm_eq_of_ringEquiv {A B C : Type*} [CommRing A] [CommRing B] [Ring C]
+    [Algebra A C] [Algebra B C] (e : A ≃+* B) (he : (algebraMap B C).comp e = algebraMap A C)
+    (x : C) :
+    e (Algebra.norm A x) = Algebra.norm B x := by
+  classical
+  by_cases h : ∃ s : Finset C, Nonempty (Basis s B C)
+  · obtain ⟨s, ⟨b⟩⟩ := h
+    letI : Algebra A B := RingHom.toAlgebra e
+    letI : IsScalarTower A B C := IsScalarTower.of_algebraMap_eq' he.symm
+    rw [Algebra.norm_eq_matrix_det b,
+      Algebra.norm_eq_matrix_det (b.mapCoeffs e.symm (by simp [Algebra.smul_def, ← he])),
+      e.map_det]
+    congr
+    ext i j
+    simp [leftMulMatrix_apply, LinearMap.toMatrix_apply]
+  rw [norm_eq_one_of_not_exists_basis _ h, norm_eq_one_of_not_exists_basis, _root_.map_one]
+  intro ⟨s, ⟨b⟩⟩
+  exact h ⟨s, ⟨b.mapCoeffs e (by simp [Algebra.smul_def, ← he])⟩⟩
+
+lemma norm_eq_of_equiv_equiv {A₁ B₁ A₂ B₂ : Type*} [CommRing A₁] [Ring B₁]
+    [CommRing A₂] [Ring B₂] [Algebra A₁ B₁] [Algebra A₂ B₂] (e₁ : A₁ ≃+* A₂) (e₂ : B₁ ≃+* B₂)
+    (he : RingHom.comp (algebraMap A₂ B₂) ↑e₁ = RingHom.comp ↑e₂ (algebraMap A₁ B₁)) (x) :
+    Algebra.norm A₁ x = e₁.symm (Algebra.norm A₂ (e₂ x)) := by
+  letI := (RingHom.comp (e₂ : B₁ →+* B₂) (algebraMap A₁ B₁)).toAlgebra' ?_
+  let e' : B₁ ≃ₐ[A₁] B₂ := { e₂ with commutes' := fun _ ↦ rfl }
+  rw [← Algebra.norm_eq_of_ringEquiv e₁ he, ← Algebra.norm_eq_of_algEquiv e',
+    RingEquiv.symm_apply_apply]
+  rfl
+  intros c x
+  apply e₂.symm.injective
+  simp only [RingHom.coe_comp, RingHom.coe_coe, Function.comp_apply, _root_.map_mul,
+    RingEquiv.symm_apply_apply, commutes]
+
 variable {F} (L)
 
 -- TODO. Generalize this proof to rings
chore(IntegralClosure): noncommutative generalizations and golfs (#8406)

Zulip

Initially I just wanted to add more dot notations for IsIntegral and IsAlgebraic (done in #8437); then I noticed near-duplicates Algebra.isIntegral_of_finite [Field R] [Ring A] and RingHom.IsIntegral.of_finite [CommRing R] [CommRing A] so I went on to generalize the latter to cover the former, and generalized everything in the IntegralClosure file to the noncommutative case whenever possible.

In the process I noticed more golfs, which result in this PR. Most notably, isIntegral_of_mem_of_FG is now proven using Cayley-Hamilton and doesn't depend on the Noetherian case isIntegral_of_noetherian; the latter is now proven using the former. In total the golfs makes mathlib 227 lines leaner (+487 -714).

The main changes are in the single file RingTheory/IntegralClosure:

  • Change the definition of Algebra.IsIntegral which makes it unfold to IsIntegral rather than RingHom.IsIntegralElem because the former has much more APIs.

  • Fix lemma names involving is_integral which are actually about IsIntegralElem: RingHom.is_integral_mapRingHom.isIntegralElem_map RingHom.is_integral_of_mem_closureRingHom.IsIntegralElem.of_mem_closure RingHom.is_integral_zero/oneRingHom.isIntegralElem_zero/one RingHom.is_integral_add/neg/sub/mul/of_mul_unitRingHom.IsIntegralElem.add/neg/sub/mul/of_mul_unit

  • Add a lemma Algebra.IsIntegral.of_injective.

  • Move isIntegral_of_(submodule_)noetherian down and golf them.

  • Remove (Algebra.)isIntegral_of_finite that work only over fields, in favor of the more general (Algebra.)isIntegral.of_finite.

  • Merge duplicate lemmas isIntegral_of_isScalarTower and isIntegral_tower_top_of_isIntegral into IsIntegral.tower_top.

  • Golf IsIntegral.of_mem_of_fg by first proving IsIntegral.of_finite using Cayley-Hamilton.

  • Add a docstring mentioning the Kurosh problem at Algebra.IsIntegral.finite. The negative solution to the problem means the theorem doesn't generalize to noncommutative algebras.

  • Golf IsIntegral.tmul and isField_of_isIntegral_of_isField(').

  • Combine isIntegral_trans_aux into isIntegral_trans and golf.

  • Add Algebra namespace to isIntegral_sup.

  • rename lemmas for dot notation: RingHom.isIntegral_transRingHom.IsIntegral.trans RingHom.isIntegral_quotient/tower_bot/top_of_isIntegralRingHom.IsIntegral.quotient/tower_bot/top isIntegral_of_mem_closure'IsIntegral.of_mem_closure' (and the '' version) isIntegral_of_surjectiveAlgebra.isIntegral_of_surjective

The next changed file is RingTheory/Algebraic:

  • Rename: of_larger_basetower_top (for consistency with IsIntegral) Algebra.isAlgebraic_of_finiteAlgebra.IsAlgebraic.of_finite Algebra.isAlgebraic_transAlgebra.IsAlgebraic.trans

  • Add new lemmasAlgebra.IsIntegral.isAlgebraic, isAlgebraic_algHom_iff, and Algebra.IsAlgebraic.of_injective to streamline some proofs.

The generalization from CommRing to Ring requires an additional lemma scaleRoots_eval₂_mul_of_commute in Polynomial/ScaleRoots.

A lemma Algebra.lmul_injective is added to Algebra/Bilinear (in order to golf the proof of IsIntegral.of_mem_of_fg).

In all other files, I merely fix the changed names, or use newly available dot notations.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -222,7 +222,7 @@ theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬Is
   rw [norm_eq_one_of_not_exists_basis]
   contrapose! hx
   obtain ⟨s, ⟨b⟩⟩ := hx
-  refine IsIntegral.of_mem_of_fg K⟮x⟯.toSubalgebra ?_ x ?_
+  refine .of_mem_of_fg K⟮x⟯.toSubalgebra ?_ x ?_
   · exact (Submodule.fg_iff_finiteDimensional _).mpr (of_fintype_basis b)
   · exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x)
 #align intermediate_field.adjoin_simple.norm_gen_eq_one IntermediateField.AdjoinSimple.norm_gen_eq_one
@@ -321,7 +321,7 @@ theorem norm_eq_prod_automorphisms [FiniteDimensional K L] [IsGalois K L] (x : L
 
 theorem isIntegral_norm [Algebra R L] [Algebra R K] [IsScalarTower R K L] [IsSeparable K L]
     [FiniteDimensional K L] {x : L} (hx : IsIntegral R x) : IsIntegral R (norm K x) := by
-  have hx' : IsIntegral K x := isIntegral_of_isScalarTower hx
+  have hx' : IsIntegral K x := hx.tower_top
   rw [← isIntegral_algebraMap_iff (algebraMap K (AlgebraicClosure L)).injective, norm_eq_prod_roots]
   · refine' (IsIntegral.multiset_prod fun y hy => _).pow _
     rw [mem_roots_map (minpoly.ne_zero hx')] at hy
chore(RingTheory/{Algebraic, Localization/Integral}): rename decls to use dot notation (#8437)

This PR tests a string-based tool for renaming declarations.

Inspired by this Zulip thread, I am trying to reduce the diff of #8406.

This PR makes the following renames:

| From | To |

Diff
@@ -222,7 +222,7 @@ theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬Is
   rw [norm_eq_one_of_not_exists_basis]
   contrapose! hx
   obtain ⟨s, ⟨b⟩⟩ := hx
-  refine isIntegral_of_mem_of_FG K⟮x⟯.toSubalgebra ?_ x ?_
+  refine IsIntegral.of_mem_of_fg K⟮x⟯.toSubalgebra ?_ x ?_
   · exact (Submodule.fg_iff_finiteDimensional _).mpr (of_fintype_basis b)
   · exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x)
 #align intermediate_field.adjoin_simple.norm_gen_eq_one IntermediateField.AdjoinSimple.norm_gen_eq_one
Revert "chore: revert #7703 (#7710)"

This reverts commit f3695eb2.

Diff
@@ -205,7 +205,8 @@ theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
   letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
   let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
   let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
-  rw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
+  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+  erw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
     smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis]
   simp only [Finset.card_fin, Finset.prod_const]
   congr
chore: revert #7703 (#7710)

This reverts commit 26eb2b0a.

Diff
@@ -205,8 +205,7 @@ theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
   letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
   let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
   let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
-  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-  erw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
+  rw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
     smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis]
   simp only [Finset.card_fin, Finset.prod_const]
   congr
chore: bump toolchain to v4.2.0-rc2 (#7703)

This includes all the changes from #7606.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -205,7 +205,8 @@ theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
   letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
   let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
   let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
-  rw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
+  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+  erw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
     smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis]
   simp only [Finset.card_fin, Finset.prod_const]
   congr
chore: cleanup some spaces (#7490)

Purely cosmetic PR

Diff
@@ -300,7 +300,7 @@ theorem norm_eq_prod_embeddings [FiniteDimensional K L] [IsSeparable K L] [IsAlg
   have hx := IsSeparable.isIntegral K x
   rw [norm_eq_norm_adjoin K x, RingHom.map_pow, ← adjoin.powerBasis_gen hx,
     norm_eq_prod_embeddings_gen E (adjoin.powerBasis hx) (IsAlgClosed.splits_codomain _)]
-  · exact (prod_embeddings_eq_finrank_pow L (L:= K⟮x⟯) E (adjoin.powerBasis hx)).symm
+  · exact (prod_embeddings_eq_finrank_pow L (L := K⟮x⟯) E (adjoin.powerBasis hx)).symm
   · haveI := isSeparable_tower_bot_of_isSeparable K K⟮x⟯ L
     exact IsSeparable.separable K _
 #align algebra.norm_eq_prod_embeddings Algebra.norm_eq_prod_embeddings
chore: replace minpoly.eq_of_algebraMap_eq by algebraMap_eq (#7228)

Also changes the repetitive names minpoly.minpoly_algHom/Equiv to minpoly.algHom/Equiv_eq

Diff
@@ -233,13 +233,10 @@ theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
   have injKxL := (algebraMap K⟮x⟯ L).injective
   by_cases hx : IsIntegral K x; swap
   · simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx, aroots_def]
-  have hx' : IsIntegral K (AdjoinSimple.gen K x) := by
-    rwa [← isIntegral_algebraMap_iff injKxL, AdjoinSimple.algebraMap_gen]
   rw [← adjoin.powerBasis_gen hx, PowerBasis.norm_gen_eq_prod_roots] <;>
-  rw [adjoin.powerBasis_gen hx, minpoly.eq_of_algebraMap_eq injKxL hx'] <;>
-  try simp only [AdjoinSimple.algebraMap_gen _ _]
-  try exact hf
-  rfl
+    rw [adjoin.powerBasis_gen hx, ← minpoly.algebraMap_eq injKxL] <;>
+    try simp only [AdjoinSimple.algebraMap_gen _ _]
+  exact hf
 #align intermediate_field.adjoin_simple.norm_gen_eq_prod_roots IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots
 
 end IntermediateField
feat: roots in an algebra (#6740)

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Diff
@@ -128,10 +128,10 @@ theorem PowerBasis.norm_gen_eq_coeff_zero_minpoly (pb : PowerBasis R S) :
 #align algebra.power_basis.norm_gen_eq_coeff_zero_minpoly Algebra.PowerBasis.norm_gen_eq_coeff_zero_minpoly
 
 /-- Given `pb : PowerBasis R S`, then the norm of `pb.gen` is
-`((minpoly R pb.gen).map (algebraMap R F)).roots.prod`. -/
+`((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).map (algebraMap R F)).roots.prod := by
+    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,
@@ -229,10 +229,10 @@ theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬Is
 theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
     (hf : (minpoly K x).Splits (algebraMap K F)) :
     (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
-      ((minpoly K x).map (algebraMap K F)).roots.prod := by
+      ((minpoly K x).aroots F).prod := by
   have injKxL := (algebraMap K⟮x⟯ L).injective
   by_cases hx : IsIntegral K x; swap
-  · simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx]
+  · simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx, aroots_def]
   have hx' : IsIntegral K (AdjoinSimple.gen K x) := by
     rwa [← isIntegral_algebraMap_iff injKxL, AdjoinSimple.algebraMap_gen]
   rw [← adjoin.powerBasis_gen hx, PowerBasis.norm_gen_eq_prod_roots] <;>
@@ -268,7 +268,7 @@ theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S)
 theorem norm_eq_prod_roots [IsSeparable K L] [FiniteDimensional K L] {x : L}
     (hF : (minpoly K x).Splits (algebraMap K F)) :
     algebraMap K F (norm K x) =
-      ((minpoly K x).map (algebraMap K F)).roots.prod ^ finrank K⟮x⟯ L := by
+      ((minpoly K x).aroots F).prod ^ finrank K⟮x⟯ L := by
   rw [norm_eq_norm_adjoin K x, map_pow, IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots _ hF]
 #align algebra.norm_eq_prod_roots Algebra.norm_eq_prod_roots
 
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -285,7 +285,7 @@ theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAl
     ← Finset.univ_sigma_univ, Finset.prod_sigma, ← Finset.prod_pow]
   refine Finset.prod_congr rfl fun σ _ => ?_
   · letI : Algebra L E := σ.toRingHom.toAlgebra
-    simp_rw [Finset.prod_const, Finset.card_univ]
+    simp_rw [Finset.prod_const]
     congr
     exact AlgHom.card L F E
   · intro σ
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -43,11 +43,11 @@ See also `Algebra.trace`, which is defined similarly as the trace of
 
 universe u v w
 
-variable {R S T : Type _} [CommRing R] [Ring S]
+variable {R S T : Type*} [CommRing R] [Ring S]
 
 variable [Algebra R S]
 
-variable {K L F : Type _} [Field K] [Field L] [Field F]
+variable {K L F : Type*} [Field K] [Field L] [Field F]
 
 variable [Algebra K L] [Algebra K F]
 
@@ -108,7 +108,7 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
 (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) :
+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]
@@ -248,7 +248,7 @@ section EqProdEmbeddings
 
 open IntermediateField IntermediateField.AdjoinSimple Polynomial
 
-variable (F) (E : Type _) [Field E] [Algebra K E]
+variable (F) (E : Type*) [Field E] [Algebra K E]
 
 theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S)
     (hE : (minpoly R pb.gen).Splits (algebraMap R F)) (hfx : (minpoly R pb.gen).Separable) :
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen
-
-! This file was ported from Lean 3 source module ring_theory.norm
-! leanprover-community/mathlib commit fecd3520d2a236856f254f27714b80dcfe28ea57
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.FieldTheory.PrimitiveElement
 import Mathlib.LinearAlgebra.Determinant
@@ -16,6 +11,8 @@ import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv
 import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure
 import Mathlib.FieldTheory.Galois
 
+#align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57"
+
 /-!
 # Norm for (finite) ring extensions
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -300,7 +300,7 @@ variable (K)
 
 /-- For `L/K` a finite separable extension of fields and `E` an algebraically closed extension
 of `K`, the norm (down to `K`) of an element `x` of `L` is equal to the product of the images
-of `x` over all the `K`-embeddings `σ`  of `L` into `E`. -/
+of `x` over all the `K`-embeddings `σ` of `L` into `E`. -/
 theorem norm_eq_prod_embeddings [FiniteDimensional K L] [IsSeparable K L] [IsAlgClosed E] (x : L) :
     algebraMap K E (norm K x) = ∏ σ : L →ₐ[K] E, σ x := by
   have hx := IsSeparable.isIntegral K x
chore: tidy various files (#5449)
Diff
@@ -34,7 +34,7 @@ i.e. `LinearMap.mulLeft`).
 For now, the definitions assume `S` is commutative, so the choice doesn't
 matter anyway.
 
-See also `algebra.trace`, which is defined similarly as the trace of
+See also `Algebra.trace`, which is defined similarly as the trace of
 `Algebra.leftMulMatrix`.
 
 ## References
@@ -342,8 +342,7 @@ variable {F} (L)
 theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
     norm K (norm L x) = norm K x := by
   by_cases hKF : FiniteDimensional K F
-  · haveI := hKF
-    let A := AlgebraicClosure K
+  · let A := AlgebraicClosure K
     apply (algebraMap K A).injective
     haveI : FiniteDimensional L F := FiniteDimensional.right K L F
     haveI : FiniteDimensional K L := FiniteDimensional.left K L F
feat: port RingTheory.Norm (#5262)

Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Dependencies 10 + 710

711 files ported (98.6%)
290634 lines ported (98.8%)
Show graph

The unported dependencies are