Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
rank
int64
0
2.4k
import Mathlib.RingTheory.RootsOfUnity.Basic import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed import Mathlib.Algebra.GCDMonoid.IntegrallyClosed import Mathlib.FieldTheory.Finite.Basic #align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" open minpoly Polynomial open scoped Polynomial namespace IsPrimitiveRoot section CommRing variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n) -- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this -- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below, -- even if it is not used in the proof. theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by use X ^ n - 1 constructor · exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm · simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub, sub_self] #align is_primitive_root.is_integral IsPrimitiveRoot.isIntegral section IsDomain variable [IsDomain K] [CharZero K] theorem minpoly_dvd_x_pow_sub_one : minpoly ℤ μ ∣ X ^ n - 1 := by rcases n.eq_zero_or_pos with (rfl | h0) · simp apply minpoly.isIntegrallyClosed_dvd (isIntegral h h0) simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, aeval_X_pow, eq_intCast, Int.cast_one, aeval_one, AlgHom.map_sub, sub_self] set_option linter.uppercaseLean3 false in #align is_primitive_root.minpoly_dvd_X_pow_sub_one IsPrimitiveRoot.minpoly_dvd_x_pow_sub_one theorem separable_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) : Separable (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := by have hdvd : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ X ^ n - 1 := by convert RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p))) (minpoly_dvd_x_pow_sub_one h) simp only [map_sub, map_pow, coe_mapRingHom, map_X, map_one] refine Separable.of_dvd (separable_X_pow_sub_C 1 ?_ one_ne_zero) hdvd by_contra hzero exact hdiv ((ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 hzero) #align is_primitive_root.separable_minpoly_mod IsPrimitiveRoot.separable_minpoly_mod theorem squarefree_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) : Squarefree (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := (separable_minpoly_mod h hdiv).squarefree #align is_primitive_root.squarefree_minpoly_mod IsPrimitiveRoot.squarefree_minpoly_mod theorem minpoly_dvd_expand {p : ℕ} (hdiv : ¬p ∣ n) : minpoly ℤ μ ∣ expand ℤ p (minpoly ℤ (μ ^ p)) := by rcases n.eq_zero_or_pos with (rfl | hpos) · simp_all letI : IsIntegrallyClosed ℤ := GCDMonoid.toIsIntegrallyClosed refine minpoly.isIntegrallyClosed_dvd (h.isIntegral hpos) ?_ rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, Polynomial.map_pow, map_X, eval_comp, eval_pow, eval_X, ← eval₂_eq_eval_map, ← aeval_def] exact minpoly.aeval _ _ #align is_primitive_root.minpoly_dvd_expand IsPrimitiveRoot.minpoly_dvd_expand
Mathlib/RingTheory/RootsOfUnity/Minpoly.lean
95
104
theorem minpoly_dvd_pow_mod {p : ℕ} [hprime : Fact p.Prime] (hdiv : ¬p ∣ n) : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p)) ^ p := by
set Q := minpoly ℤ (μ ^ p) have hfrob : map (Int.castRingHom (ZMod p)) Q ^ p = map (Int.castRingHom (ZMod p)) (expand ℤ p Q) := by rw [← ZMod.expand_card, map_expand] rw [hfrob] apply RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p))) exact minpoly_dvd_expand h hdiv
2,025
import Mathlib.RingTheory.RootsOfUnity.Basic import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed import Mathlib.Algebra.GCDMonoid.IntegrallyClosed import Mathlib.FieldTheory.Finite.Basic #align_import ring_theory.roots_of_unity.minpoly from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" open minpoly Polynomial open scoped Polynomial namespace IsPrimitiveRoot section CommRing variable {n : ℕ} {K : Type*} [CommRing K] {μ : K} (h : IsPrimitiveRoot μ n) -- Porting note: `hpos` was in the `variable` line, with an `omit` in mathlib3 just after this -- declaration. For some reason, in Lean4, `hpos` gets included also in the declarations below, -- even if it is not used in the proof. theorem isIntegral (hpos : 0 < n) : IsIntegral ℤ μ := by use X ^ n - 1 constructor · exact monic_X_pow_sub_C 1 (ne_of_lt hpos).symm · simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, eval₂_one, eval₂_X_pow, eval₂_sub, sub_self] #align is_primitive_root.is_integral IsPrimitiveRoot.isIntegral section IsDomain variable [IsDomain K] [CharZero K] theorem minpoly_dvd_x_pow_sub_one : minpoly ℤ μ ∣ X ^ n - 1 := by rcases n.eq_zero_or_pos with (rfl | h0) · simp apply minpoly.isIntegrallyClosed_dvd (isIntegral h h0) simp only [((IsPrimitiveRoot.iff_def μ n).mp h).left, aeval_X_pow, eq_intCast, Int.cast_one, aeval_one, AlgHom.map_sub, sub_self] set_option linter.uppercaseLean3 false in #align is_primitive_root.minpoly_dvd_X_pow_sub_one IsPrimitiveRoot.minpoly_dvd_x_pow_sub_one theorem separable_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) : Separable (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := by have hdvd : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ X ^ n - 1 := by convert RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p))) (minpoly_dvd_x_pow_sub_one h) simp only [map_sub, map_pow, coe_mapRingHom, map_X, map_one] refine Separable.of_dvd (separable_X_pow_sub_C 1 ?_ one_ne_zero) hdvd by_contra hzero exact hdiv ((ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 hzero) #align is_primitive_root.separable_minpoly_mod IsPrimitiveRoot.separable_minpoly_mod theorem squarefree_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) : Squarefree (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)) := (separable_minpoly_mod h hdiv).squarefree #align is_primitive_root.squarefree_minpoly_mod IsPrimitiveRoot.squarefree_minpoly_mod theorem minpoly_dvd_expand {p : ℕ} (hdiv : ¬p ∣ n) : minpoly ℤ μ ∣ expand ℤ p (minpoly ℤ (μ ^ p)) := by rcases n.eq_zero_or_pos with (rfl | hpos) · simp_all letI : IsIntegrallyClosed ℤ := GCDMonoid.toIsIntegrallyClosed refine minpoly.isIntegrallyClosed_dvd (h.isIntegral hpos) ?_ rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, Polynomial.map_pow, map_X, eval_comp, eval_pow, eval_X, ← eval₂_eq_eval_map, ← aeval_def] exact minpoly.aeval _ _ #align is_primitive_root.minpoly_dvd_expand IsPrimitiveRoot.minpoly_dvd_expand theorem minpoly_dvd_pow_mod {p : ℕ} [hprime : Fact p.Prime] (hdiv : ¬p ∣ n) : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p)) ^ p := by set Q := minpoly ℤ (μ ^ p) have hfrob : map (Int.castRingHom (ZMod p)) Q ^ p = map (Int.castRingHom (ZMod p)) (expand ℤ p Q) := by rw [← ZMod.expand_card, map_expand] rw [hfrob] apply RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p))) exact minpoly_dvd_expand h hdiv #align is_primitive_root.minpoly_dvd_pow_mod IsPrimitiveRoot.minpoly_dvd_pow_mod theorem minpoly_dvd_mod_p {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) : map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p)) := (squarefree_minpoly_mod h hdiv).isRadical _ _ (minpoly_dvd_pow_mod h hdiv) #align is_primitive_root.minpoly_dvd_mod_p IsPrimitiveRoot.minpoly_dvd_mod_p
Mathlib/RingTheory/RootsOfUnity/Minpoly.lean
118
169
theorem minpoly_eq_pow {p : ℕ} [hprime : Fact p.Prime] (hdiv : ¬p ∣ n) : minpoly ℤ μ = minpoly ℤ (μ ^ p) := by
classical by_cases hn : n = 0 · simp_all have hpos := Nat.pos_of_ne_zero hn by_contra hdiff set P := minpoly ℤ μ set Q := minpoly ℤ (μ ^ p) have Pmonic : P.Monic := minpoly.monic (h.isIntegral hpos) have Qmonic : Q.Monic := minpoly.monic ((h.pow_of_prime hprime.1 hdiv).isIntegral hpos) have Pirr : Irreducible P := minpoly.irreducible (h.isIntegral hpos) have Qirr : Irreducible Q := minpoly.irreducible ((h.pow_of_prime hprime.1 hdiv).isIntegral hpos) have PQprim : IsPrimitive (P * Q) := Pmonic.isPrimitive.mul Qmonic.isPrimitive have prod : P * Q ∣ X ^ n - 1 := by rw [IsPrimitive.Int.dvd_iff_map_cast_dvd_map_cast (P * Q) (X ^ n - 1) PQprim (monic_X_pow_sub_C (1 : ℤ) (ne_of_gt hpos)).isPrimitive, Polynomial.map_mul] refine IsCoprime.mul_dvd ?_ ?_ ?_ · have aux := IsPrimitive.Int.irreducible_iff_irreducible_map_cast Pmonic.isPrimitive refine (dvd_or_coprime _ _ (aux.1 Pirr)).resolve_left ?_ rw [map_dvd_map (Int.castRingHom ℚ) Int.cast_injective Pmonic] intro hdiv refine hdiff (eq_of_monic_of_associated Pmonic Qmonic ?_) exact associated_of_dvd_dvd hdiv (Pirr.dvd_symm Qirr hdiv) · apply (map_dvd_map (Int.castRingHom ℚ) Int.cast_injective Pmonic).2 exact minpoly_dvd_x_pow_sub_one h · apply (map_dvd_map (Int.castRingHom ℚ) Int.cast_injective Qmonic).2 exact minpoly_dvd_x_pow_sub_one (pow_of_prime h hprime.1 hdiv) replace prod := RingHom.map_dvd (mapRingHom (Int.castRingHom (ZMod p))) prod rw [coe_mapRingHom, Polynomial.map_mul, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, map_X] at prod obtain ⟨R, hR⟩ := minpoly_dvd_mod_p h hdiv rw [hR, ← mul_assoc, ← Polynomial.map_mul, ← sq, Polynomial.map_pow] at prod have habs : map (Int.castRingHom (ZMod p)) P ^ 2 ∣ map (Int.castRingHom (ZMod p)) P ^ 2 * R := by use R replace habs := lt_of_lt_of_le (PartENat.coe_lt_coe.2 one_lt_two) (multiplicity.le_multiplicity_of_pow_dvd (dvd_trans habs prod)) have hfree : Squarefree (X ^ n - 1 : (ZMod p)[X]) := (separable_X_pow_sub_C 1 (fun h => hdiv <| (ZMod.natCast_zmod_eq_zero_iff_dvd n p).1 h) one_ne_zero).squarefree cases' (multiplicity.squarefree_iff_multiplicity_le_one (X ^ n - 1)).1 hfree (map (Int.castRingHom (ZMod p)) P) with hle hunit · rw [Nat.cast_one] at habs; exact hle.not_lt habs · replace hunit := degree_eq_zero_of_isUnit hunit rw [degree_map_eq_of_leadingCoeff_ne_zero (Int.castRingHom (ZMod p)) _] at hunit · exact (minpoly.degree_pos (isIntegral h hpos)).ne' hunit simp only [Pmonic, eq_intCast, Monic.leadingCoeff, Int.cast_one, Ne, not_false_iff, one_ne_zero]
2,025
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Localization.NumDen import Mathlib.RingTheory.Polynomial.ScaleRoots #align_import ring_theory.polynomial.rational_root from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" open scoped Polynomial section ScaleRoots variable {A K R S : Type*} [CommRing A] [Field K] [CommRing R] [CommRing S] variable {M : Submonoid A} [Algebra A S] [IsLocalization M S] [Algebra A K] [IsFractionRing A K] open Finsupp IsFractionRing IsLocalization Polynomial
Mathlib/RingTheory/Polynomial/RationalRoot.lean
39
44
theorem scaleRoots_aeval_eq_zero_of_aeval_mk'_eq_zero {p : A[X]} {r : A} {s : M} (hr : aeval (mk' S r s) p = 0) : aeval (algebraMap A S r) (scaleRoots p s) = 0 := by
convert scaleRoots_eval₂_eq_zero (algebraMap A S) hr -- Porting note: added funext rw [aeval_def, mk'_spec' _ r s]
2,026
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Localization.NumDen import Mathlib.RingTheory.Polynomial.ScaleRoots #align_import ring_theory.polynomial.rational_root from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" open scoped Polynomial section ScaleRoots variable {A K R S : Type*} [CommRing A] [Field K] [CommRing R] [CommRing S] variable {M : Submonoid A} [Algebra A S] [IsLocalization M S] [Algebra A K] [IsFractionRing A K] open Finsupp IsFractionRing IsLocalization Polynomial theorem scaleRoots_aeval_eq_zero_of_aeval_mk'_eq_zero {p : A[X]} {r : A} {s : M} (hr : aeval (mk' S r s) p = 0) : aeval (algebraMap A S r) (scaleRoots p s) = 0 := by convert scaleRoots_eval₂_eq_zero (algebraMap A S) hr -- Porting note: added funext rw [aeval_def, mk'_spec' _ r s] #align scale_roots_aeval_eq_zero_of_aeval_mk'_eq_zero scaleRoots_aeval_eq_zero_of_aeval_mk'_eq_zero variable [IsDomain A]
Mathlib/RingTheory/Polynomial/RationalRoot.lean
49
54
theorem num_isRoot_scaleRoots_of_aeval_eq_zero [UniqueFactorizationMonoid A] {p : A[X]} {x : K} (hr : aeval x p = 0) : IsRoot (scaleRoots p (den A x)) (num A x) := by
apply isRoot_of_eval₂_map_eq_zero (IsFractionRing.injective A K) refine scaleRoots_aeval_eq_zero_of_aeval_mk'_eq_zero ?_ rw [mk'_num_den] exact hr
2,026
import Mathlib.FieldTheory.Normal import Mathlib.FieldTheory.Perfect import Mathlib.RingTheory.Localization.Integral #align_import field_theory.is_alg_closed.basic from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] class IsAlgClosed : Prop where splits : ∀ p : k[X], p.Splits <| RingHom.id k #align is_alg_closed IsAlgClosed
Mathlib/FieldTheory/IsAlgClosed/Basic.lean
68
69
theorem IsAlgClosed.splits_codomain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : K →+* k} (p : K[X]) : p.Splits f := by
convert IsAlgClosed.splits (p.map f); simp [splits_map_iff]
2,027
import Mathlib.FieldTheory.Normal import Mathlib.FieldTheory.Perfect import Mathlib.RingTheory.Localization.Integral #align_import field_theory.is_alg_closed.basic from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] class IsAlgClosed : Prop where splits : ∀ p : k[X], p.Splits <| RingHom.id k #align is_alg_closed IsAlgClosed theorem IsAlgClosed.splits_codomain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : K →+* k} (p : K[X]) : p.Splits f := by convert IsAlgClosed.splits (p.map f); simp [splits_map_iff] #align is_alg_closed.splits_codomain IsAlgClosed.splits_codomain theorem IsAlgClosed.splits_domain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : k →+* K} (p : k[X]) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsAlgClosed.splits _ #align is_alg_closed.splits_domain IsAlgClosed.splits_domain namespace IsAlgClosed variable {k} theorem exists_root [IsAlgClosed k] (p : k[X]) (hp : p.degree ≠ 0) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsAlgClosed.splits p) hp #align is_alg_closed.exists_root IsAlgClosed.exists_root
Mathlib/FieldTheory/IsAlgClosed/Basic.lean
89
96
theorem exists_pow_nat_eq [IsAlgClosed k] (x : k) {n : ℕ} (hn : 0 < n) : ∃ z, z ^ n = x := by
have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn x] exact ne_of_gt (WithBot.coe_lt_coe.2 hn) obtain ⟨z, hz⟩ := exists_root (X ^ n - C x) this use z simp only [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def] at hz exact sub_eq_zero.1 hz
2,027
import Mathlib.FieldTheory.Normal import Mathlib.FieldTheory.Perfect import Mathlib.RingTheory.Localization.Integral #align_import field_theory.is_alg_closed.basic from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] class IsAlgClosed : Prop where splits : ∀ p : k[X], p.Splits <| RingHom.id k #align is_alg_closed IsAlgClosed theorem IsAlgClosed.splits_codomain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : K →+* k} (p : K[X]) : p.Splits f := by convert IsAlgClosed.splits (p.map f); simp [splits_map_iff] #align is_alg_closed.splits_codomain IsAlgClosed.splits_codomain theorem IsAlgClosed.splits_domain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : k →+* K} (p : k[X]) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsAlgClosed.splits _ #align is_alg_closed.splits_domain IsAlgClosed.splits_domain namespace IsAlgClosed variable {k} theorem exists_root [IsAlgClosed k] (p : k[X]) (hp : p.degree ≠ 0) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsAlgClosed.splits p) hp #align is_alg_closed.exists_root IsAlgClosed.exists_root theorem exists_pow_nat_eq [IsAlgClosed k] (x : k) {n : ℕ} (hn : 0 < n) : ∃ z, z ^ n = x := by have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn x] exact ne_of_gt (WithBot.coe_lt_coe.2 hn) obtain ⟨z, hz⟩ := exists_root (X ^ n - C x) this use z simp only [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def] at hz exact sub_eq_zero.1 hz #align is_alg_closed.exists_pow_nat_eq IsAlgClosed.exists_pow_nat_eq
Mathlib/FieldTheory/IsAlgClosed/Basic.lean
99
101
theorem exists_eq_mul_self [IsAlgClosed k] (x : k) : ∃ z, x = z * z := by
rcases exists_pow_nat_eq x zero_lt_two with ⟨z, rfl⟩ exact ⟨z, sq z⟩
2,027
import Mathlib.FieldTheory.Normal import Mathlib.FieldTheory.Perfect import Mathlib.RingTheory.Localization.Integral #align_import field_theory.is_alg_closed.basic from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] class IsAlgClosed : Prop where splits : ∀ p : k[X], p.Splits <| RingHom.id k #align is_alg_closed IsAlgClosed theorem IsAlgClosed.splits_codomain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : K →+* k} (p : K[X]) : p.Splits f := by convert IsAlgClosed.splits (p.map f); simp [splits_map_iff] #align is_alg_closed.splits_codomain IsAlgClosed.splits_codomain theorem IsAlgClosed.splits_domain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : k →+* K} (p : k[X]) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsAlgClosed.splits _ #align is_alg_closed.splits_domain IsAlgClosed.splits_domain namespace IsAlgClosed variable {k} theorem exists_root [IsAlgClosed k] (p : k[X]) (hp : p.degree ≠ 0) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsAlgClosed.splits p) hp #align is_alg_closed.exists_root IsAlgClosed.exists_root theorem exists_pow_nat_eq [IsAlgClosed k] (x : k) {n : ℕ} (hn : 0 < n) : ∃ z, z ^ n = x := by have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn x] exact ne_of_gt (WithBot.coe_lt_coe.2 hn) obtain ⟨z, hz⟩ := exists_root (X ^ n - C x) this use z simp only [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def] at hz exact sub_eq_zero.1 hz #align is_alg_closed.exists_pow_nat_eq IsAlgClosed.exists_pow_nat_eq theorem exists_eq_mul_self [IsAlgClosed k] (x : k) : ∃ z, x = z * z := by rcases exists_pow_nat_eq x zero_lt_two with ⟨z, rfl⟩ exact ⟨z, sq z⟩ #align is_alg_closed.exists_eq_mul_self IsAlgClosed.exists_eq_mul_self
Mathlib/FieldTheory/IsAlgClosed/Basic.lean
104
111
theorem roots_eq_zero_iff [IsAlgClosed k] {p : k[X]} : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by
refine ⟨fun h => ?_, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd · exact eq_C_of_degree_le_zero hd · obtain ⟨z, hz⟩ := IsAlgClosed.exists_root p hd.ne' rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz
2,027
import Mathlib.FieldTheory.Normal import Mathlib.FieldTheory.Perfect import Mathlib.RingTheory.Localization.Integral #align_import field_theory.is_alg_closed.basic from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] class IsAlgClosed : Prop where splits : ∀ p : k[X], p.Splits <| RingHom.id k #align is_alg_closed IsAlgClosed theorem IsAlgClosed.splits_codomain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : K →+* k} (p : K[X]) : p.Splits f := by convert IsAlgClosed.splits (p.map f); simp [splits_map_iff] #align is_alg_closed.splits_codomain IsAlgClosed.splits_codomain theorem IsAlgClosed.splits_domain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : k →+* K} (p : k[X]) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsAlgClosed.splits _ #align is_alg_closed.splits_domain IsAlgClosed.splits_domain namespace IsAlgClosed variable {k} theorem exists_root [IsAlgClosed k] (p : k[X]) (hp : p.degree ≠ 0) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsAlgClosed.splits p) hp #align is_alg_closed.exists_root IsAlgClosed.exists_root theorem exists_pow_nat_eq [IsAlgClosed k] (x : k) {n : ℕ} (hn : 0 < n) : ∃ z, z ^ n = x := by have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn x] exact ne_of_gt (WithBot.coe_lt_coe.2 hn) obtain ⟨z, hz⟩ := exists_root (X ^ n - C x) this use z simp only [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def] at hz exact sub_eq_zero.1 hz #align is_alg_closed.exists_pow_nat_eq IsAlgClosed.exists_pow_nat_eq theorem exists_eq_mul_self [IsAlgClosed k] (x : k) : ∃ z, x = z * z := by rcases exists_pow_nat_eq x zero_lt_two with ⟨z, rfl⟩ exact ⟨z, sq z⟩ #align is_alg_closed.exists_eq_mul_self IsAlgClosed.exists_eq_mul_self theorem roots_eq_zero_iff [IsAlgClosed k] {p : k[X]} : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine ⟨fun h => ?_, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd · exact eq_C_of_degree_le_zero hd · obtain ⟨z, hz⟩ := IsAlgClosed.exists_root p hd.ne' rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz #align is_alg_closed.roots_eq_zero_iff IsAlgClosed.roots_eq_zero_iff theorem exists_eval₂_eq_zero_of_injective {R : Type*} [Ring R] [IsAlgClosed k] (f : R →+* k) (hf : Function.Injective f) (p : R[X]) (hp : p.degree ≠ 0) : ∃ x, p.eval₂ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective hf]) ⟨x, by rwa [eval₂_eq_eval_map, ← IsRoot]⟩ #align is_alg_closed.exists_eval₂_eq_zero_of_injective IsAlgClosed.exists_eval₂_eq_zero_of_injective theorem exists_eval₂_eq_zero {R : Type*} [Field R] [IsAlgClosed k] (f : R →+* k) (p : R[X]) (hp : p.degree ≠ 0) : ∃ x, p.eval₂ f x = 0 := exists_eval₂_eq_zero_of_injective f f.injective p hp #align is_alg_closed.exists_eval₂_eq_zero IsAlgClosed.exists_eval₂_eq_zero variable (k) theorem exists_aeval_eq_zero_of_injective {R : Type*} [CommRing R] [IsAlgClosed k] [Algebra R k] (hinj : Function.Injective (algebraMap R k)) (p : R[X]) (hp : p.degree ≠ 0) : ∃ x : k, aeval x p = 0 := exists_eval₂_eq_zero_of_injective (algebraMap R k) hinj p hp #align is_alg_closed.exists_aeval_eq_zero_of_injective IsAlgClosed.exists_aeval_eq_zero_of_injective theorem exists_aeval_eq_zero {R : Type*} [Field R] [IsAlgClosed k] [Algebra R k] (p : R[X]) (hp : p.degree ≠ 0) : ∃ x : k, aeval x p = 0 := exists_eval₂_eq_zero (algebraMap R k) p hp #align is_alg_closed.exists_aeval_eq_zero IsAlgClosed.exists_aeval_eq_zero
Mathlib/FieldTheory/IsAlgClosed/Basic.lean
138
146
theorem of_exists_root (H : ∀ p : k[X], p.Monic → Irreducible p → ∃ x, p.eval x = 0) : IsAlgClosed k := by
refine ⟨fun p ↦ Or.inr ?_⟩ intro q hq _ have : Irreducible (q * C (leadingCoeff q)⁻¹) := by rw [← coe_normUnit_of_ne_zero hq.ne_zero] exact (associated_normalize _).irreducible hq obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) this exact degree_mul_leadingCoeff_inv q hq.ne_zero ▸ degree_eq_one_of_irreducible_of_root this hx
2,027
import Mathlib.FieldTheory.Normal import Mathlib.FieldTheory.Perfect import Mathlib.RingTheory.Localization.Integral #align_import field_theory.is_alg_closed.basic from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] class IsAlgClosed : Prop where splits : ∀ p : k[X], p.Splits <| RingHom.id k #align is_alg_closed IsAlgClosed theorem IsAlgClosed.splits_codomain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : K →+* k} (p : K[X]) : p.Splits f := by convert IsAlgClosed.splits (p.map f); simp [splits_map_iff] #align is_alg_closed.splits_codomain IsAlgClosed.splits_codomain theorem IsAlgClosed.splits_domain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : k →+* K} (p : k[X]) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsAlgClosed.splits _ #align is_alg_closed.splits_domain IsAlgClosed.splits_domain namespace IsAlgClosed variable {k} theorem exists_root [IsAlgClosed k] (p : k[X]) (hp : p.degree ≠ 0) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsAlgClosed.splits p) hp #align is_alg_closed.exists_root IsAlgClosed.exists_root theorem exists_pow_nat_eq [IsAlgClosed k] (x : k) {n : ℕ} (hn : 0 < n) : ∃ z, z ^ n = x := by have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn x] exact ne_of_gt (WithBot.coe_lt_coe.2 hn) obtain ⟨z, hz⟩ := exists_root (X ^ n - C x) this use z simp only [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def] at hz exact sub_eq_zero.1 hz #align is_alg_closed.exists_pow_nat_eq IsAlgClosed.exists_pow_nat_eq theorem exists_eq_mul_self [IsAlgClosed k] (x : k) : ∃ z, x = z * z := by rcases exists_pow_nat_eq x zero_lt_two with ⟨z, rfl⟩ exact ⟨z, sq z⟩ #align is_alg_closed.exists_eq_mul_self IsAlgClosed.exists_eq_mul_self theorem roots_eq_zero_iff [IsAlgClosed k] {p : k[X]} : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine ⟨fun h => ?_, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd · exact eq_C_of_degree_le_zero hd · obtain ⟨z, hz⟩ := IsAlgClosed.exists_root p hd.ne' rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz #align is_alg_closed.roots_eq_zero_iff IsAlgClosed.roots_eq_zero_iff theorem exists_eval₂_eq_zero_of_injective {R : Type*} [Ring R] [IsAlgClosed k] (f : R →+* k) (hf : Function.Injective f) (p : R[X]) (hp : p.degree ≠ 0) : ∃ x, p.eval₂ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective hf]) ⟨x, by rwa [eval₂_eq_eval_map, ← IsRoot]⟩ #align is_alg_closed.exists_eval₂_eq_zero_of_injective IsAlgClosed.exists_eval₂_eq_zero_of_injective theorem exists_eval₂_eq_zero {R : Type*} [Field R] [IsAlgClosed k] (f : R →+* k) (p : R[X]) (hp : p.degree ≠ 0) : ∃ x, p.eval₂ f x = 0 := exists_eval₂_eq_zero_of_injective f f.injective p hp #align is_alg_closed.exists_eval₂_eq_zero IsAlgClosed.exists_eval₂_eq_zero variable (k) theorem exists_aeval_eq_zero_of_injective {R : Type*} [CommRing R] [IsAlgClosed k] [Algebra R k] (hinj : Function.Injective (algebraMap R k)) (p : R[X]) (hp : p.degree ≠ 0) : ∃ x : k, aeval x p = 0 := exists_eval₂_eq_zero_of_injective (algebraMap R k) hinj p hp #align is_alg_closed.exists_aeval_eq_zero_of_injective IsAlgClosed.exists_aeval_eq_zero_of_injective theorem exists_aeval_eq_zero {R : Type*} [Field R] [IsAlgClosed k] [Algebra R k] (p : R[X]) (hp : p.degree ≠ 0) : ∃ x : k, aeval x p = 0 := exists_eval₂_eq_zero (algebraMap R k) p hp #align is_alg_closed.exists_aeval_eq_zero IsAlgClosed.exists_aeval_eq_zero theorem of_exists_root (H : ∀ p : k[X], p.Monic → Irreducible p → ∃ x, p.eval x = 0) : IsAlgClosed k := by refine ⟨fun p ↦ Or.inr ?_⟩ intro q hq _ have : Irreducible (q * C (leadingCoeff q)⁻¹) := by rw [← coe_normUnit_of_ne_zero hq.ne_zero] exact (associated_normalize _).irreducible hq obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) this exact degree_mul_leadingCoeff_inv q hq.ne_zero ▸ degree_eq_one_of_irreducible_of_root this hx #align is_alg_closed.of_exists_root IsAlgClosed.of_exists_root
Mathlib/FieldTheory/IsAlgClosed/Basic.lean
149
162
theorem of_ringEquiv (k' : Type u) [Field k'] (e : k ≃+* k') [IsAlgClosed k] : IsAlgClosed k' := by
apply IsAlgClosed.of_exists_root intro p hmp hp have hpe : degree (p.map e.symm.toRingHom) ≠ 0 := by rw [degree_map] exact ne_of_gt (degree_pos_of_irreducible hp) rcases IsAlgClosed.exists_root (k := k) (p.map e.symm) hpe with ⟨x, hx⟩ use e x rw [IsRoot] at hx apply e.symm.injective rw [map_zero, ← hx] clear hx hpe hp hmp induction p using Polynomial.induction_on <;> simp_all
2,027
import Mathlib.Data.Nat.Cast.WithTop import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.RingTheory.WittVector.DiscreteValuationRing #align_import ring_theory.witt_vector.frobenius_fraction_field from "leanprover-community/mathlib"@"cead93130da7100f8a9fe22ee210f7636a91168f" noncomputable section namespace WittVector variable (p : ℕ) [hp : Fact p.Prime] local notation "𝕎" => WittVector p namespace RecursionMain section CommRing variable {k : Type*} [CommRing k] [CharP k p] open Polynomial def succNthDefiningPoly (n : ℕ) (a₁ a₂ : 𝕎 k) (bs : Fin (n + 1) → k) : Polynomial k := X ^ p * C (a₁.coeff 0 ^ p ^ (n + 1)) - X * C (a₂.coeff 0 ^ p ^ (n + 1)) + C (a₁.coeff (n + 1) * (bs 0 ^ p) ^ p ^ (n + 1) + nthRemainder p n (fun v => bs v ^ p) (truncateFun (n + 1) a₁) - a₂.coeff (n + 1) * bs 0 ^ p ^ (n + 1) - nthRemainder p n bs (truncateFun (n + 1) a₂)) #align witt_vector.recursion_main.succ_nth_defining_poly WittVector.RecursionMain.succNthDefiningPoly
Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean
79
95
theorem succNthDefiningPoly_degree [IsDomain k] (n : ℕ) (a₁ a₂ : 𝕎 k) (bs : Fin (n + 1) → k) (ha₁ : a₁.coeff 0 ≠ 0) (ha₂ : a₂.coeff 0 ≠ 0) : (succNthDefiningPoly p n a₁ a₂ bs).degree = p := by
have : (X ^ p * C (a₁.coeff 0 ^ p ^ (n + 1))).degree = (p : WithBot ℕ) := by rw [degree_mul, degree_C] · simp only [Nat.cast_withBot, add_zero, degree_X, degree_pow, Nat.smul_one_eq_cast] · exact pow_ne_zero _ ha₁ have : (X ^ p * C (a₁.coeff 0 ^ p ^ (n + 1)) - X * C (a₂.coeff 0 ^ p ^ (n + 1))).degree = (p : WithBot ℕ) := by rw [degree_sub_eq_left_of_degree_lt, this] rw [this, degree_mul, degree_C, degree_X, add_zero] · exact mod_cast hp.out.one_lt · exact pow_ne_zero _ ha₂ rw [succNthDefiningPoly, degree_add_eq_left_of_degree_lt, this] apply lt_of_le_of_lt degree_C_le rw [this] exact mod_cast hp.out.pos
2,028
import Mathlib.Algebra.DirectLimit import Mathlib.Algebra.CharP.Algebra import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.FieldTheory.SplittingField.Construction #align_import field_theory.is_alg_closed.algebraic_closure from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" universe u v w noncomputable section open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] namespace AlgebraicClosure open MvPolynomial abbrev MonicIrreducible : Type u := { f : k[X] // Monic f ∧ Irreducible f } #align algebraic_closure.monic_irreducible AlgebraicClosure.MonicIrreducible def evalXSelf (f : MonicIrreducible k) : MvPolynomial (MonicIrreducible k) k := Polynomial.eval₂ MvPolynomial.C (X f) f set_option linter.uppercaseLean3 false in #align algebraic_closure.eval_X_self AlgebraicClosure.evalXSelf def spanEval : Ideal (MvPolynomial (MonicIrreducible k) k) := Ideal.span <| Set.range <| evalXSelf k #align algebraic_closure.span_eval AlgebraicClosure.spanEval def toSplittingField (s : Finset (MonicIrreducible k)) : MvPolynomial (MonicIrreducible k) k →ₐ[k] SplittingField (∏ x ∈ s, x : k[X]) := MvPolynomial.aeval fun f => if hf : f ∈ s then rootOfSplits _ ((splits_prod_iff _ fun (j : MonicIrreducible k) _ => j.2.2.ne_zero).1 (SplittingField.splits _) f hf) (mt isUnit_iff_degree_eq_zero.2 f.2.2.not_unit) else 37 #align algebraic_closure.to_splitting_field AlgebraicClosure.toSplittingField
Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean
77
81
theorem toSplittingField_evalXSelf {s : Finset (MonicIrreducible k)} {f} (hf : f ∈ s) : toSplittingField k s (evalXSelf k f) = 0 := by
rw [toSplittingField, evalXSelf, ← AlgHom.coe_toRingHom, hom_eval₂, AlgHom.coe_toRingHom, MvPolynomial.aeval_X, dif_pos hf, ← MvPolynomial.algebraMap_eq, AlgHom.comp_algebraMap] exact map_rootOfSplits _ _ _
2,029
import Mathlib.Algebra.DirectLimit import Mathlib.Algebra.CharP.Algebra import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.FieldTheory.SplittingField.Construction #align_import field_theory.is_alg_closed.algebraic_closure from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" universe u v w noncomputable section open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] namespace AlgebraicClosure open MvPolynomial abbrev MonicIrreducible : Type u := { f : k[X] // Monic f ∧ Irreducible f } #align algebraic_closure.monic_irreducible AlgebraicClosure.MonicIrreducible def evalXSelf (f : MonicIrreducible k) : MvPolynomial (MonicIrreducible k) k := Polynomial.eval₂ MvPolynomial.C (X f) f set_option linter.uppercaseLean3 false in #align algebraic_closure.eval_X_self AlgebraicClosure.evalXSelf def spanEval : Ideal (MvPolynomial (MonicIrreducible k) k) := Ideal.span <| Set.range <| evalXSelf k #align algebraic_closure.span_eval AlgebraicClosure.spanEval def toSplittingField (s : Finset (MonicIrreducible k)) : MvPolynomial (MonicIrreducible k) k →ₐ[k] SplittingField (∏ x ∈ s, x : k[X]) := MvPolynomial.aeval fun f => if hf : f ∈ s then rootOfSplits _ ((splits_prod_iff _ fun (j : MonicIrreducible k) _ => j.2.2.ne_zero).1 (SplittingField.splits _) f hf) (mt isUnit_iff_degree_eq_zero.2 f.2.2.not_unit) else 37 #align algebraic_closure.to_splitting_field AlgebraicClosure.toSplittingField theorem toSplittingField_evalXSelf {s : Finset (MonicIrreducible k)} {f} (hf : f ∈ s) : toSplittingField k s (evalXSelf k f) = 0 := by rw [toSplittingField, evalXSelf, ← AlgHom.coe_toRingHom, hom_eval₂, AlgHom.coe_toRingHom, MvPolynomial.aeval_X, dif_pos hf, ← MvPolynomial.algebraMap_eq, AlgHom.comp_algebraMap] exact map_rootOfSplits _ _ _ set_option linter.uppercaseLean3 false in #align algebraic_closure.to_splitting_field_eval_X_self AlgebraicClosure.toSplittingField_evalXSelf
Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean
85
94
theorem spanEval_ne_top : spanEval k ≠ ⊤ := by
rw [Ideal.ne_top_iff_one, spanEval, Ideal.span, ← Set.image_univ, Finsupp.mem_span_image_iff_total] rintro ⟨v, _, hv⟩ replace hv := congr_arg (toSplittingField k v.support) hv rw [AlgHom.map_one, Finsupp.total_apply, Finsupp.sum, AlgHom.map_sum, Finset.sum_eq_zero] at hv · exact zero_ne_one hv intro j hj rw [smul_eq_mul, AlgHom.map_mul, toSplittingField_evalXSelf (s := v.support) hj, mul_zero]
2,029
import Mathlib.Algebra.DirectLimit import Mathlib.Algebra.CharP.Algebra import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.FieldTheory.SplittingField.Construction #align_import field_theory.is_alg_closed.algebraic_closure from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" universe u v w noncomputable section open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] namespace AlgebraicClosure open MvPolynomial abbrev MonicIrreducible : Type u := { f : k[X] // Monic f ∧ Irreducible f } #align algebraic_closure.monic_irreducible AlgebraicClosure.MonicIrreducible def evalXSelf (f : MonicIrreducible k) : MvPolynomial (MonicIrreducible k) k := Polynomial.eval₂ MvPolynomial.C (X f) f set_option linter.uppercaseLean3 false in #align algebraic_closure.eval_X_self AlgebraicClosure.evalXSelf def spanEval : Ideal (MvPolynomial (MonicIrreducible k) k) := Ideal.span <| Set.range <| evalXSelf k #align algebraic_closure.span_eval AlgebraicClosure.spanEval def toSplittingField (s : Finset (MonicIrreducible k)) : MvPolynomial (MonicIrreducible k) k →ₐ[k] SplittingField (∏ x ∈ s, x : k[X]) := MvPolynomial.aeval fun f => if hf : f ∈ s then rootOfSplits _ ((splits_prod_iff _ fun (j : MonicIrreducible k) _ => j.2.2.ne_zero).1 (SplittingField.splits _) f hf) (mt isUnit_iff_degree_eq_zero.2 f.2.2.not_unit) else 37 #align algebraic_closure.to_splitting_field AlgebraicClosure.toSplittingField theorem toSplittingField_evalXSelf {s : Finset (MonicIrreducible k)} {f} (hf : f ∈ s) : toSplittingField k s (evalXSelf k f) = 0 := by rw [toSplittingField, evalXSelf, ← AlgHom.coe_toRingHom, hom_eval₂, AlgHom.coe_toRingHom, MvPolynomial.aeval_X, dif_pos hf, ← MvPolynomial.algebraMap_eq, AlgHom.comp_algebraMap] exact map_rootOfSplits _ _ _ set_option linter.uppercaseLean3 false in #align algebraic_closure.to_splitting_field_eval_X_self AlgebraicClosure.toSplittingField_evalXSelf theorem spanEval_ne_top : spanEval k ≠ ⊤ := by rw [Ideal.ne_top_iff_one, spanEval, Ideal.span, ← Set.image_univ, Finsupp.mem_span_image_iff_total] rintro ⟨v, _, hv⟩ replace hv := congr_arg (toSplittingField k v.support) hv rw [AlgHom.map_one, Finsupp.total_apply, Finsupp.sum, AlgHom.map_sum, Finset.sum_eq_zero] at hv · exact zero_ne_one hv intro j hj rw [smul_eq_mul, AlgHom.map_mul, toSplittingField_evalXSelf (s := v.support) hj, mul_zero] #align algebraic_closure.span_eval_ne_top AlgebraicClosure.spanEval_ne_top def maxIdeal : Ideal (MvPolynomial (MonicIrreducible k) k) := Classical.choose <| Ideal.exists_le_maximal _ <| spanEval_ne_top k #align algebraic_closure.max_ideal AlgebraicClosure.maxIdeal instance maxIdeal.isMaximal : (maxIdeal k).IsMaximal := (Classical.choose_spec <| Ideal.exists_le_maximal _ <| spanEval_ne_top k).1 #align algebraic_closure.max_ideal.is_maximal AlgebraicClosure.maxIdeal.isMaximal theorem le_maxIdeal : spanEval k ≤ maxIdeal k := (Classical.choose_spec <| Ideal.exists_le_maximal _ <| spanEval_ne_top k).2 #align algebraic_closure.le_max_ideal AlgebraicClosure.le_maxIdeal def AdjoinMonic : Type u := MvPolynomial (MonicIrreducible k) k ⧸ maxIdeal k #align algebraic_closure.adjoin_monic AlgebraicClosure.AdjoinMonic instance AdjoinMonic.field : Field (AdjoinMonic k) := Ideal.Quotient.field _ #align algebraic_closure.adjoin_monic.field AlgebraicClosure.AdjoinMonic.field instance AdjoinMonic.inhabited : Inhabited (AdjoinMonic k) := ⟨37⟩ #align algebraic_closure.adjoin_monic.inhabited AlgebraicClosure.AdjoinMonic.inhabited def toAdjoinMonic : k →+* AdjoinMonic k := (Ideal.Quotient.mk _).comp C #align algebraic_closure.to_adjoin_monic AlgebraicClosure.toAdjoinMonic instance AdjoinMonic.algebra : Algebra k (AdjoinMonic k) := (toAdjoinMonic k).toAlgebra #align algebraic_closure.adjoin_monic.algebra AlgebraicClosure.AdjoinMonic.algebra set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534 -- Porting note: In the statement, the type of `C` had to be made explicit. theorem AdjoinMonic.algebraMap : algebraMap k (AdjoinMonic k) = (Ideal.Quotient.mk _).comp (C : k →+* MvPolynomial (MonicIrreducible k) k) := rfl #align algebraic_closure.adjoin_monic.algebra_map AlgebraicClosure.AdjoinMonic.algebraMap
Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean
138
148
theorem AdjoinMonic.isIntegral (z : AdjoinMonic k) : IsIntegral k z := by
let ⟨p, hp⟩ := Ideal.Quotient.mk_surjective z rw [← hp] induction p using MvPolynomial.induction_on generalizing z with | h_C => exact isIntegral_algebraMap | h_add _ _ ha hb => exact (ha _ rfl).add (hb _ rfl) | h_X p f ih => refine @IsIntegral.mul k _ _ _ _ _ (Ideal.Quotient.mk (maxIdeal k) _) (ih _ rfl) ?_ refine ⟨f, f.2.1, ?_⟩ erw [AdjoinMonic.algebraMap, ← hom_eval₂, Ideal.Quotient.eq_zero_iff_mem] exact le_maxIdeal k (Ideal.subset_span ⟨f, rfl⟩)
2,029
import Mathlib.FieldTheory.SplittingField.Construction import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Separable import Mathlib.FieldTheory.NormalClosure import Mathlib.RingTheory.Polynomial.SeparableDegree open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] namespace Field def Emb := E →ₐ[F] AlgebraicClosure E def finSepDegree : ℕ := Nat.card (Emb F E) instance instInhabitedEmb : Inhabited (Emb F E) := ⟨IsScalarTower.toAlgHom F E _⟩ instance instNeZeroFinSepDegree [FiniteDimensional F E] : NeZero (finSepDegree F E) := ⟨Nat.card_ne_zero.2 ⟨inferInstance, Fintype.finite <| minpoly.AlgHom.fintype _ _ _⟩⟩ def embEquivOfEquiv (i : E ≃ₐ[F] K) : Emb F E ≃ Emb F K := AlgEquiv.arrowCongr i <| AlgEquiv.symm <| by let _ : Algebra E K := i.toAlgHom.toRingHom.toAlgebra have : Algebra.IsAlgebraic E K := by constructor intro x have h := isAlgebraic_algebraMap (R := E) (A := K) (i.symm.toAlgHom x) rw [show ∀ y : E, (algebraMap E K) y = i.toAlgHom y from fun y ↦ rfl] at h simpa only [AlgEquiv.toAlgHom_eq_coe, AlgHom.coe_coe, AlgEquiv.apply_symm_apply] using h apply AlgEquiv.restrictScalars (R := F) (S := E) exact IsAlgClosure.equivOfAlgebraic E K (AlgebraicClosure K) (AlgebraicClosure E) theorem finSepDegree_eq_of_equiv (i : E ≃ₐ[F] K) : finSepDegree F E = finSepDegree F K := Nat.card_congr (embEquivOfEquiv F E K i) @[simp]
Mathlib/FieldTheory/SeparableDegree.lean
168
172
theorem finSepDegree_self : finSepDegree F F = 1 := by
have : Cardinal.mk (Emb F F) = 1 := le_antisymm (Cardinal.le_one_iff_subsingleton.2 AlgHom.subsingleton) (Cardinal.one_le_iff_ne_zero.2 <| Cardinal.mk_ne_zero _) rw [finSepDegree, Nat.card, this, Cardinal.one_toNat]
2,030
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.RingTheory.IntegralDomain #align_import field_theory.primitive_element from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" noncomputable section open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField namespace Field section PrimitiveElementFinite variable (F : Type*) [Field F] (E : Type*) [Field E] [Algebra F E]
Mathlib/FieldTheory/PrimitiveElement.lean
56
67
theorem exists_primitive_element_of_finite_top [Finite E] : ∃ α : E, F⟮α⟯ = ⊤ := by
obtain ⟨α, hα⟩ := @IsCyclic.exists_generator Eˣ _ _ use α rw [eq_top_iff] rintro x - by_cases hx : x = 0 · rw [hx] exact F⟮α.val⟯.zero_mem · obtain ⟨n, hn⟩ := Set.mem_range.mp (hα (Units.mk0 x hx)) simp only at hn rw [show x = α ^ n by norm_cast; rw [hn, Units.val_mk0]] exact zpow_mem (mem_adjoin_simple_self F (E := E) ↑α) n
2,031
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.RingTheory.IntegralDomain #align_import field_theory.primitive_element from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" noncomputable section open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField namespace Field section PrimitiveElementInf variable {F : Type*} [Field F] [Infinite F] {E : Type*} [Field E] (ϕ : F →+* E) (α β : E)
Mathlib/FieldTheory/PrimitiveElement.lean
86
96
theorem primitive_element_inf_aux_exists_c (f g : F[X]) : ∃ c : F, ∀ α' ∈ (f.map ϕ).roots, ∀ β' ∈ (g.map ϕ).roots, -(α' - α) / (β' - β) ≠ ϕ c := by
let sf := (f.map ϕ).roots let sg := (g.map ϕ).roots let s := (sf.bind fun α' => sg.map fun β' => -(α' - α) / (β' - β)).toFinset let s' := s.preimage ϕ fun x _ y _ h => ϕ.injective h obtain ⟨c, hc⟩ := Infinite.exists_not_mem_finset s' simp_rw [s', s, Finset.mem_preimage, Multiset.mem_toFinset, Multiset.mem_bind, Multiset.mem_map] at hc push_neg at hc exact ⟨c, hc⟩
2,031
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.RingTheory.IntegralDomain #align_import field_theory.primitive_element from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" noncomputable section open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField namespace Field section PrimitiveElementInf variable {F : Type*} [Field F] [Infinite F] {E : Type*} [Field E] (ϕ : F →+* E) (α β : E) theorem primitive_element_inf_aux_exists_c (f g : F[X]) : ∃ c : F, ∀ α' ∈ (f.map ϕ).roots, ∀ β' ∈ (g.map ϕ).roots, -(α' - α) / (β' - β) ≠ ϕ c := by let sf := (f.map ϕ).roots let sg := (g.map ϕ).roots let s := (sf.bind fun α' => sg.map fun β' => -(α' - α) / (β' - β)).toFinset let s' := s.preimage ϕ fun x _ y _ h => ϕ.injective h obtain ⟨c, hc⟩ := Infinite.exists_not_mem_finset s' simp_rw [s', s, Finset.mem_preimage, Multiset.mem_toFinset, Multiset.mem_bind, Multiset.mem_map] at hc push_neg at hc exact ⟨c, hc⟩ #align field.primitive_element_inf_aux_exists_c Field.primitive_element_inf_aux_exists_c variable (F) variable [Algebra F E]
Mathlib/FieldTheory/PrimitiveElement.lean
104
173
theorem primitive_element_inf_aux [IsSeparable F E] : ∃ γ : E, F⟮α, β⟯ = F⟮γ⟯ := by
have hα := IsSeparable.isIntegral F α have hβ := IsSeparable.isIntegral F β let f := minpoly F α let g := minpoly F β let ιFE := algebraMap F E let ιEE' := algebraMap E (SplittingField (g.map ιFE)) obtain ⟨c, hc⟩ := primitive_element_inf_aux_exists_c (ιEE'.comp ιFE) (ιEE' α) (ιEE' β) f g let γ := α + c • β suffices β_in_Fγ : β ∈ F⟮γ⟯ by use γ apply le_antisymm · rw [adjoin_le_iff] have α_in_Fγ : α ∈ F⟮γ⟯ := by rw [← add_sub_cancel_right α (c • β)] exact F⟮γ⟯.sub_mem (mem_adjoin_simple_self F γ) (F⟮γ⟯.toSubalgebra.smul_mem β_in_Fγ c) rintro x (rfl | rfl) <;> assumption · rw [adjoin_simple_le_iff] have α_in_Fαβ : α ∈ F⟮α, β⟯ := subset_adjoin F {α, β} (Set.mem_insert α {β}) have β_in_Fαβ : β ∈ F⟮α, β⟯ := subset_adjoin F {α, β} (Set.mem_insert_of_mem α rfl) exact F⟮α, β⟯.add_mem α_in_Fαβ (F⟮α, β⟯.smul_mem β_in_Fαβ) let p := EuclideanDomain.gcd ((f.map (algebraMap F F⟮γ⟯)).comp (C (AdjoinSimple.gen F γ) - (C ↑c : F⟮γ⟯[X]) * X)) (g.map (algebraMap F F⟮γ⟯)) let h := EuclideanDomain.gcd ((f.map ιFE).comp (C γ - C (ιFE c) * X)) (g.map ιFE) have map_g_ne_zero : g.map ιFE ≠ 0 := map_ne_zero (minpoly.ne_zero hβ) have h_ne_zero : h ≠ 0 := mt EuclideanDomain.gcd_eq_zero_iff.mp (not_and.mpr fun _ => map_g_ne_zero) suffices p_linear : p.map (algebraMap F⟮γ⟯ E) = C h.leadingCoeff * (X - C β) by have finale : β = algebraMap F⟮γ⟯ E (-p.coeff 0 / p.coeff 1) := by rw [map_div₀, RingHom.map_neg, ← coeff_map, ← coeff_map, p_linear] -- Porting note: had to add `-map_add` to avoid going in the wrong direction. simp [mul_sub, coeff_C, mul_div_cancel_left₀ β (mt leadingCoeff_eq_zero.mp h_ne_zero), -map_add] -- Porting note: an alternative solution is: -- simp_rw [Polynomial.coeff_C_mul, Polynomial.coeff_sub, mul_sub, -- Polynomial.coeff_X_zero, Polynomial.coeff_X_one, mul_zero, mul_one, zero_sub, neg_neg, -- Polynomial.coeff_C, eq_self_iff_true, Nat.one_ne_zero, if_true, if_false, mul_zero, -- sub_zero, mul_div_cancel_left β (mt leadingCoeff_eq_zero.mp h_ne_zero)] rw [finale] exact Subtype.mem (-p.coeff 0 / p.coeff 1) have h_sep : h.Separable := separable_gcd_right _ (IsSeparable.separable F β).map have h_root : h.eval β = 0 := by apply eval_gcd_eq_zero · rw [eval_comp, eval_sub, eval_mul, eval_C, eval_C, eval_X, eval_map, ← aeval_def, ← Algebra.smul_def, add_sub_cancel_right, minpoly.aeval] · rw [eval_map, ← aeval_def, minpoly.aeval] have h_splits : Splits ιEE' h := splits_of_splits_gcd_right ιEE' map_g_ne_zero (SplittingField.splits _) have h_roots : ∀ x ∈ (h.map ιEE').roots, x = ιEE' β := by intro x hx rw [mem_roots_map h_ne_zero] at hx specialize hc (ιEE' γ - ιEE' (ιFE c) * x) (by have f_root := root_left_of_root_gcd hx rw [eval₂_comp, eval₂_sub, eval₂_mul, eval₂_C, eval₂_C, eval₂_X, eval₂_map] at f_root exact (mem_roots_map (minpoly.ne_zero hα)).mpr f_root) specialize hc x (by rw [mem_roots_map (minpoly.ne_zero hβ), ← eval₂_map] exact root_right_of_root_gcd hx) by_contra a apply hc apply (div_eq_iff (sub_ne_zero.mpr a)).mpr simp only [γ, Algebra.smul_def, RingHom.map_add, RingHom.map_mul, RingHom.comp_apply] ring rw [← eq_X_sub_C_of_separable_of_root_eq h_sep h_root h_splits h_roots] trans EuclideanDomain.gcd (?_ : E[X]) (?_ : E[X]) · dsimp only [γ] convert (gcd_map (algebraMap F⟮γ⟯ E)).symm · simp only [map_comp, Polynomial.map_map, ← IsScalarTower.algebraMap_eq, Polynomial.map_sub, map_C, AdjoinSimple.algebraMap_gen, map_add, Polynomial.map_mul, map_X] congr
2,031
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.RingTheory.IntegralDomain #align_import field_theory.primitive_element from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" noncomputable section open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField namespace Field variable (F E : Type*) [Field F] [Field E] variable [Algebra F E] section FiniteIntermediateField -- TODO: show a more generalized result: [F⟮α⟯ : F⟮α ^ m⟯] = m if m > 0 and α transcendental.
Mathlib/FieldTheory/PrimitiveElement.lean
246
275
theorem isAlgebraic_of_adjoin_eq_adjoin {α : E} {m n : ℕ} (hneq : m ≠ n) (heq : F⟮α ^ m⟯ = F⟮α ^ n⟯) : IsAlgebraic F α := by
wlog hmn : m < n · exact this F E hneq.symm heq.symm (hneq.lt_or_lt.resolve_left hmn) by_cases hm : m = 0 · rw [hm] at heq hmn simp only [pow_zero, adjoin_one] at heq obtain ⟨y, h⟩ := mem_bot.1 (heq.symm ▸ mem_adjoin_simple_self F (α ^ n)) refine ⟨X ^ n - C y, X_pow_sub_C_ne_zero hmn y, ?_⟩ simp only [map_sub, map_pow, aeval_X, aeval_C, h, sub_self] obtain ⟨r, s, h⟩ := (mem_adjoin_simple_iff F _).1 (heq ▸ mem_adjoin_simple_self F (α ^ m)) by_cases hzero : aeval (α ^ n) s = 0 · simp only [hzero, div_zero, pow_eq_zero_iff hm] at h exact h.symm ▸ isAlgebraic_zero replace hm : 0 < m := Nat.pos_of_ne_zero hm rw [eq_div_iff hzero, ← sub_eq_zero] at h replace hzero : s ≠ 0 := by rintro rfl; simp only [map_zero, not_true_eq_false] at hzero let f : F[X] := X ^ m * expand F n s - expand F n r refine ⟨f, ?_, ?_⟩ · have : f.coeff (n * s.natDegree + m) ≠ 0 := by have hn : 0 < n := by linarith only [hm, hmn] have hndvd : ¬ n ∣ n * s.natDegree + m := by rw [← Nat.dvd_add_iff_right (n.dvd_mul_right s.natDegree)] exact Nat.not_dvd_of_pos_of_lt hm hmn simp only [f, coeff_sub, coeff_X_pow_mul, s.coeff_expand_mul' hn, coeff_natDegree, coeff_expand hn r, hndvd, ite_false, sub_zero] exact leadingCoeff_ne_zero.2 hzero intro h simp only [h, coeff_zero, ne_eq, not_true_eq_false] at this · simp only [f, map_sub, map_mul, map_pow, aeval_X, expand_aeval, h]
2,031
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.RingTheory.IntegralDomain #align_import field_theory.primitive_element from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" noncomputable section open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField namespace Field variable (F E : Type*) [Field F] [Field E] variable [Algebra F E] section FiniteIntermediateField -- TODO: show a more generalized result: [F⟮α⟯ : F⟮α ^ m⟯] = m if m > 0 and α transcendental. theorem isAlgebraic_of_adjoin_eq_adjoin {α : E} {m n : ℕ} (hneq : m ≠ n) (heq : F⟮α ^ m⟯ = F⟮α ^ n⟯) : IsAlgebraic F α := by wlog hmn : m < n · exact this F E hneq.symm heq.symm (hneq.lt_or_lt.resolve_left hmn) by_cases hm : m = 0 · rw [hm] at heq hmn simp only [pow_zero, adjoin_one] at heq obtain ⟨y, h⟩ := mem_bot.1 (heq.symm ▸ mem_adjoin_simple_self F (α ^ n)) refine ⟨X ^ n - C y, X_pow_sub_C_ne_zero hmn y, ?_⟩ simp only [map_sub, map_pow, aeval_X, aeval_C, h, sub_self] obtain ⟨r, s, h⟩ := (mem_adjoin_simple_iff F _).1 (heq ▸ mem_adjoin_simple_self F (α ^ m)) by_cases hzero : aeval (α ^ n) s = 0 · simp only [hzero, div_zero, pow_eq_zero_iff hm] at h exact h.symm ▸ isAlgebraic_zero replace hm : 0 < m := Nat.pos_of_ne_zero hm rw [eq_div_iff hzero, ← sub_eq_zero] at h replace hzero : s ≠ 0 := by rintro rfl; simp only [map_zero, not_true_eq_false] at hzero let f : F[X] := X ^ m * expand F n s - expand F n r refine ⟨f, ?_, ?_⟩ · have : f.coeff (n * s.natDegree + m) ≠ 0 := by have hn : 0 < n := by linarith only [hm, hmn] have hndvd : ¬ n ∣ n * s.natDegree + m := by rw [← Nat.dvd_add_iff_right (n.dvd_mul_right s.natDegree)] exact Nat.not_dvd_of_pos_of_lt hm hmn simp only [f, coeff_sub, coeff_X_pow_mul, s.coeff_expand_mul' hn, coeff_natDegree, coeff_expand hn r, hndvd, ite_false, sub_zero] exact leadingCoeff_ne_zero.2 hzero intro h simp only [h, coeff_zero, ne_eq, not_true_eq_false] at this · simp only [f, map_sub, map_mul, map_pow, aeval_X, expand_aeval, h] theorem isAlgebraic_of_finite_intermediateField [Finite (IntermediateField F E)] : Algebra.IsAlgebraic F E := ⟨fun α ↦ have ⟨_m, _n, hneq, heq⟩ := Finite.exists_ne_map_eq_of_infinite fun n ↦ F⟮α ^ n⟯ isAlgebraic_of_adjoin_eq_adjoin F E hneq heq⟩
Mathlib/FieldTheory/PrimitiveElement.lean
282
292
theorem FiniteDimensional.of_finite_intermediateField [Finite (IntermediateField F E)] : FiniteDimensional F E := by
let IF := { K : IntermediateField F E // ∃ x, K = F⟮x⟯ } have := isAlgebraic_of_finite_intermediateField F E haveI : ∀ K : IF, FiniteDimensional F K.1 := fun ⟨_, x, rfl⟩ ↦ adjoin.finiteDimensional (Algebra.IsIntegral.isIntegral _) have hfin := finiteDimensional_iSup_of_finite (t := fun K : IF ↦ K.1) have htop : ⨆ K : IF, K.1 = ⊤ := le_top.antisymm fun x _ ↦ le_iSup (fun K : IF ↦ K.1) ⟨F⟮x⟯, x, rfl⟩ <| mem_adjoin_simple_self F x rw [htop] at hfin exact topEquiv.toLinearEquiv.finiteDimensional
2,031
import Mathlib.FieldTheory.Fixed import Mathlib.FieldTheory.NormalClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.GroupTheory.GroupAction.FixingSubgroup #align_import field_theory.galois from "leanprover-community/mathlib"@"9fb8964792b4237dac6200193a0d533f1b3f7423" open scoped Polynomial IntermediateField open FiniteDimensional AlgEquiv section variable (F : Type*) [Field F] (E : Type*) [Field E] [Algebra F E] class IsGalois : Prop where [to_isSeparable : IsSeparable F E] [to_normal : Normal F E] #align is_galois IsGalois variable {F E} theorem isGalois_iff : IsGalois F E ↔ IsSeparable F E ∧ Normal F E := ⟨fun h => ⟨h.1, h.2⟩, fun h => { to_isSeparable := h.1 to_normal := h.2 }⟩ #align is_galois_iff isGalois_iff attribute [instance 100] IsGalois.to_isSeparable IsGalois.to_normal -- see Note [lower instance priority] variable (F E) namespace IsGalois instance self : IsGalois F F := ⟨⟩ #align is_galois.self IsGalois.self variable {E} theorem integral [IsGalois F E] (x : E) : IsIntegral F x := to_normal.isIntegral x #align is_galois.integral IsGalois.integral theorem separable [IsGalois F E] (x : E) : (minpoly F x).Separable := IsSeparable.separable F x #align is_galois.separable IsGalois.separable theorem splits [IsGalois F E] (x : E) : (minpoly F x).Splits (algebraMap F E) := Normal.splits' x #align is_galois.splits IsGalois.splits variable (E) instance of_fixed_field (G : Type*) [Group G] [Finite G] [MulSemiringAction G E] : IsGalois (FixedPoints.subfield G E) E := ⟨⟩ #align is_galois.of_fixed_field IsGalois.of_fixed_field
Mathlib/FieldTheory/Galois.lean
93
100
theorem IntermediateField.AdjoinSimple.card_aut_eq_finrank [FiniteDimensional F E] {α : E} (hα : IsIntegral F α) (h_sep : (minpoly F α).Separable) (h_splits : (minpoly F α).Splits (algebraMap F F⟮α⟯)) : Fintype.card (F⟮α⟯ ≃ₐ[F] F⟮α⟯) = finrank F F⟮α⟯ := by
letI : Fintype (F⟮α⟯ →ₐ[F] F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα rw [IntermediateField.adjoin.finrank hα] rw [← IntermediateField.card_algHom_adjoin_integral F hα h_sep h_splits] exact Fintype.card_congr (algEquivEquivAlgHom F F⟮α⟯)
2,032
import Mathlib.FieldTheory.Fixed import Mathlib.FieldTheory.NormalClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.GroupTheory.GroupAction.FixingSubgroup #align_import field_theory.galois from "leanprover-community/mathlib"@"9fb8964792b4237dac6200193a0d533f1b3f7423" open scoped Polynomial IntermediateField open FiniteDimensional AlgEquiv section variable (F : Type*) [Field F] (E : Type*) [Field E] [Algebra F E] class IsGalois : Prop where [to_isSeparable : IsSeparable F E] [to_normal : Normal F E] #align is_galois IsGalois variable {F E} theorem isGalois_iff : IsGalois F E ↔ IsSeparable F E ∧ Normal F E := ⟨fun h => ⟨h.1, h.2⟩, fun h => { to_isSeparable := h.1 to_normal := h.2 }⟩ #align is_galois_iff isGalois_iff attribute [instance 100] IsGalois.to_isSeparable IsGalois.to_normal -- see Note [lower instance priority] variable (F E) namespace IsGalois instance self : IsGalois F F := ⟨⟩ #align is_galois.self IsGalois.self variable {E} theorem integral [IsGalois F E] (x : E) : IsIntegral F x := to_normal.isIntegral x #align is_galois.integral IsGalois.integral theorem separable [IsGalois F E] (x : E) : (minpoly F x).Separable := IsSeparable.separable F x #align is_galois.separable IsGalois.separable theorem splits [IsGalois F E] (x : E) : (minpoly F x).Splits (algebraMap F E) := Normal.splits' x #align is_galois.splits IsGalois.splits variable (E) instance of_fixed_field (G : Type*) [Group G] [Finite G] [MulSemiringAction G E] : IsGalois (FixedPoints.subfield G E) E := ⟨⟩ #align is_galois.of_fixed_field IsGalois.of_fixed_field theorem IntermediateField.AdjoinSimple.card_aut_eq_finrank [FiniteDimensional F E] {α : E} (hα : IsIntegral F α) (h_sep : (minpoly F α).Separable) (h_splits : (minpoly F α).Splits (algebraMap F F⟮α⟯)) : Fintype.card (F⟮α⟯ ≃ₐ[F] F⟮α⟯) = finrank F F⟮α⟯ := by letI : Fintype (F⟮α⟯ →ₐ[F] F⟮α⟯) := IntermediateField.fintypeOfAlgHomAdjoinIntegral F hα rw [IntermediateField.adjoin.finrank hα] rw [← IntermediateField.card_algHom_adjoin_integral F hα h_sep h_splits] exact Fintype.card_congr (algEquivEquivAlgHom F F⟮α⟯) #align is_galois.intermediate_field.adjoin_simple.card_aut_eq_finrank IsGalois.IntermediateField.AdjoinSimple.card_aut_eq_finrank
Mathlib/FieldTheory/Galois.lean
103
125
theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] : Fintype.card (E ≃ₐ[F] E) = finrank F E := by
cases' Field.exists_primitive_element F E with α hα let iso : F⟮α⟯ ≃ₐ[F] E := { toFun := fun e => e.val invFun := fun e => ⟨e, by rw [hα]; exact IntermediateField.mem_top⟩ left_inv := fun _ => by ext; rfl right_inv := fun _ => rfl map_mul' := fun _ _ => rfl map_add' := fun _ _ => rfl commutes' := fun _ => rfl } have H : IsIntegral F α := IsGalois.integral F α have h_sep : (minpoly F α).Separable := IsGalois.separable F α have h_splits : (minpoly F α).Splits (algebraMap F E) := IsGalois.splits F α replace h_splits : Polynomial.Splits (algebraMap F F⟮α⟯) (minpoly F α) := by simpa using Polynomial.splits_comp_of_splits (algebraMap F E) iso.symm.toAlgHom.toRingHom h_splits rw [← LinearEquiv.finrank_eq iso.toLinearEquiv] rw [← IntermediateField.AdjoinSimple.card_aut_eq_finrank F E H h_sep h_splits] apply Fintype.card_congr apply Equiv.mk (fun ϕ => iso.trans (ϕ.trans iso.symm)) fun ϕ => iso.symm.trans (ϕ.trans iso) · intro ϕ; ext1; simp only [trans_apply, apply_symm_apply] · intro ϕ; ext1; simp only [trans_apply, symm_apply_apply]
2,032
import Mathlib.Algebra.CharP.Algebra import Mathlib.Data.ZMod.Algebra import Mathlib.FieldTheory.Finite.Basic import Mathlib.FieldTheory.Galois import Mathlib.FieldTheory.SplittingField.IsSplittingField #align_import field_theory.finite.galois_field from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" noncomputable section open Polynomial Finset open scoped Polynomial instance FiniteField.isSplittingField_sub (K F : Type*) [Field K] [Fintype K] [Field F] [Algebra F K] : IsSplittingField F K (X ^ Fintype.card K - X) where splits' := by have h : (X ^ Fintype.card K - X : K[X]).natDegree = Fintype.card K := FiniteField.X_pow_card_sub_X_natDegree_eq K Fintype.one_lt_card rw [← splits_id_iff_splits, splits_iff_card_roots, Polynomial.map_sub, Polynomial.map_pow, map_X, h, FiniteField.roots_X_pow_card_sub_X K, ← Finset.card_def, Finset.card_univ] adjoin_rootSet' := by classical trans Algebra.adjoin F ((roots (X ^ Fintype.card K - X : K[X])).toFinset : Set K) · simp only [rootSet, aroots, Polynomial.map_pow, map_X, Polynomial.map_sub] · rw [FiniteField.roots_X_pow_card_sub_X, val_toFinset, coe_univ, Algebra.adjoin_univ] #align finite_field.has_sub.sub.polynomial.is_splitting_field FiniteField.isSplittingField_sub
Mathlib/FieldTheory/Finite/GaloisField.lean
55
60
theorem galois_poly_separable {K : Type*} [Field K] (p q : ℕ) [CharP K p] (h : p ∣ q) : Separable (X ^ q - X : K[X]) := by
use 1, X ^ q - X - 1 rw [← CharP.cast_eq_zero_iff K[X] p] at h rw [derivative_sub, derivative_X_pow, derivative_X, C_eq_natCast, h] ring
2,033
import Mathlib.Algebra.CharP.Algebra import Mathlib.Data.ZMod.Algebra import Mathlib.FieldTheory.Finite.Basic import Mathlib.FieldTheory.Galois import Mathlib.FieldTheory.SplittingField.IsSplittingField #align_import field_theory.finite.galois_field from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" noncomputable section open Polynomial Finset open scoped Polynomial instance FiniteField.isSplittingField_sub (K F : Type*) [Field K] [Fintype K] [Field F] [Algebra F K] : IsSplittingField F K (X ^ Fintype.card K - X) where splits' := by have h : (X ^ Fintype.card K - X : K[X]).natDegree = Fintype.card K := FiniteField.X_pow_card_sub_X_natDegree_eq K Fintype.one_lt_card rw [← splits_id_iff_splits, splits_iff_card_roots, Polynomial.map_sub, Polynomial.map_pow, map_X, h, FiniteField.roots_X_pow_card_sub_X K, ← Finset.card_def, Finset.card_univ] adjoin_rootSet' := by classical trans Algebra.adjoin F ((roots (X ^ Fintype.card K - X : K[X])).toFinset : Set K) · simp only [rootSet, aroots, Polynomial.map_pow, map_X, Polynomial.map_sub] · rw [FiniteField.roots_X_pow_card_sub_X, val_toFinset, coe_univ, Algebra.adjoin_univ] #align finite_field.has_sub.sub.polynomial.is_splitting_field FiniteField.isSplittingField_sub theorem galois_poly_separable {K : Type*} [Field K] (p q : ℕ) [CharP K p] (h : p ∣ q) : Separable (X ^ q - X : K[X]) := by use 1, X ^ q - X - 1 rw [← CharP.cast_eq_zero_iff K[X] p] at h rw [derivative_sub, derivative_X_pow, derivative_X, C_eq_natCast, h] ring #align galois_poly_separable galois_poly_separable variable (p : ℕ) [Fact p.Prime] (n : ℕ) def GaloisField := SplittingField (X ^ p ^ n - X : (ZMod p)[X]) -- deriving Field -- Porting note: see https://github.com/leanprover-community/mathlib4/issues/5020 #align galois_field GaloisField instance : Field (GaloisField p n) := inferInstanceAs (Field (SplittingField _)) instance : Inhabited (@GaloisField 2 (Fact.mk Nat.prime_two) 1) := ⟨37⟩ namespace GaloisField variable (p : ℕ) [h_prime : Fact p.Prime] (n : ℕ) instance : Algebra (ZMod p) (GaloisField p n) := SplittingField.algebra _ instance : IsSplittingField (ZMod p) (GaloisField p n) (X ^ p ^ n - X) := Polynomial.IsSplittingField.splittingField _ instance : CharP (GaloisField p n) p := (Algebra.charP_iff (ZMod p) (GaloisField p n) p).mp (by infer_instance) instance : FiniteDimensional (ZMod p) (GaloisField p n) := by dsimp only [GaloisField]; infer_instance instance : Fintype (GaloisField p n) := by dsimp only [GaloisField] exact FiniteDimensional.fintypeOfFintype (ZMod p) (GaloisField p n)
Mathlib/FieldTheory/Finite/GaloisField.lean
96
143
theorem finrank {n} (h : n ≠ 0) : FiniteDimensional.finrank (ZMod p) (GaloisField p n) = n := by
set g_poly := (X ^ p ^ n - X : (ZMod p)[X]) have hp : 1 < p := h_prime.out.one_lt have aux : g_poly ≠ 0 := FiniteField.X_pow_card_pow_sub_X_ne_zero _ h hp -- Porting note: in the statment of `key`, replaced `g_poly` by its value otherwise the -- proof fails have key : Fintype.card (g_poly.rootSet (GaloisField p n)) = g_poly.natDegree := card_rootSet_eq_natDegree (galois_poly_separable p _ (dvd_pow (dvd_refl p) h)) (SplittingField.splits (X ^ p ^ n - X : (ZMod p)[X])) have nat_degree_eq : g_poly.natDegree = p ^ n := FiniteField.X_pow_card_pow_sub_X_natDegree_eq _ h hp rw [nat_degree_eq] at key suffices g_poly.rootSet (GaloisField p n) = Set.univ by simp_rw [this, ← Fintype.ofEquiv_card (Equiv.Set.univ _)] at key -- Porting note: prevents `card_eq_pow_finrank` from using a wrong instance for `Fintype` rw [@card_eq_pow_finrank (ZMod p) _ _ _ _ _ (_), ZMod.card] at key exact Nat.pow_right_injective (Nat.Prime.one_lt' p).out key rw [Set.eq_univ_iff_forall] suffices ∀ (x) (hx : x ∈ (⊤ : Subalgebra (ZMod p) (GaloisField p n))), x ∈ (X ^ p ^ n - X : (ZMod p)[X]).rootSet (GaloisField p n) by simpa rw [← SplittingField.adjoin_rootSet] simp_rw [Algebra.mem_adjoin_iff] intro x hx -- We discharge the `p = 0` separately, to avoid typeclass issues on `ZMod p`. cases p; cases hp refine Subring.closure_induction hx ?_ ?_ ?_ ?_ ?_ ?_ <;> simp_rw [mem_rootSet_of_ne aux] · rintro x (⟨r, rfl⟩ | hx) · simp only [g_poly, map_sub, map_pow, aeval_X] rw [← map_pow, ZMod.pow_card_pow, sub_self] · dsimp only [GaloisField] at hx rwa [mem_rootSet_of_ne aux] at hx · rw [← coeff_zero_eq_aeval_zero'] simp only [g_poly, coeff_X_pow, coeff_X_zero, sub_zero, _root_.map_eq_zero, ite_eq_right_iff, one_ne_zero, coeff_sub] intro hn exact Nat.not_lt_zero 1 (pow_eq_zero hn.symm ▸ hp) · simp [g_poly] · simp only [g_poly, aeval_X_pow, aeval_X, AlgHom.map_sub, add_pow_char_pow, sub_eq_zero] intro x y hx hy rw [hx, hy] · intro x hx simp only [g_poly, sub_eq_zero, aeval_X_pow, aeval_X, AlgHom.map_sub, sub_neg_eq_add] at * rw [neg_pow, hx, CharP.neg_one_pow_char_pow] simp · simp only [g_poly, aeval_X_pow, aeval_X, AlgHom.map_sub, mul_pow, sub_eq_zero] intro x y hx hy rw [hx, hy]
2,033
import Mathlib.FieldTheory.Galois import Mathlib.Topology.Algebra.FilterBasis import Mathlib.Topology.Algebra.OpenSubgroup import Mathlib.Tactic.ByContra #align_import field_theory.krull_topology from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f" open scoped Classical Pointwise theorem IntermediateField.map_id {K L : Type*} [Field K] [Field L] [Algebra K L] (E : IntermediateField K L) : E.map (AlgHom.id K L) = E := SetLike.coe_injective <| Set.image_id _ #align intermediate_field.map_id IntermediateField.map_id instance im_finiteDimensional {K L : Type*} [Field K] [Field L] [Algebra K L] {E : IntermediateField K L} (σ : L ≃ₐ[K] L) [FiniteDimensional K E] : FiniteDimensional K (E.map σ.toAlgHom) := LinearEquiv.finiteDimensional (IntermediateField.intermediateFieldMap σ E).toLinearEquiv #align im_finite_dimensional im_finiteDimensional def finiteExts (K : Type*) [Field K] (L : Type*) [Field L] [Algebra K L] : Set (IntermediateField K L) := {E | FiniteDimensional K E} #align finite_exts finiteExts def fixedByFinite (K L : Type*) [Field K] [Field L] [Algebra K L] : Set (Subgroup (L ≃ₐ[K] L)) := IntermediateField.fixingSubgroup '' finiteExts K L #align fixed_by_finite fixedByFinite theorem IntermediateField.finiteDimensional_bot (K L : Type*) [Field K] [Field L] [Algebra K L] : FiniteDimensional K (⊥ : IntermediateField K L) := .of_rank_eq_one IntermediateField.rank_bot #align intermediate_field.finite_dimensional_bot IntermediateField.finiteDimensional_bot
Mathlib/FieldTheory/KrullTopology.lean
93
100
theorem IntermediateField.fixingSubgroup.bot {K L : Type*} [Field K] [Field L] [Algebra K L] : IntermediateField.fixingSubgroup (⊥ : IntermediateField K L) = ⊤ := by
ext f refine ⟨fun _ => Subgroup.mem_top _, fun _ => ?_⟩ rintro ⟨x, hx : x ∈ (⊥ : IntermediateField K L)⟩ rw [IntermediateField.mem_bot] at hx rcases hx with ⟨y, rfl⟩ exact f.commutes y
2,034
import Mathlib.FieldTheory.Galois import Mathlib.Topology.Algebra.FilterBasis import Mathlib.Topology.Algebra.OpenSubgroup import Mathlib.Tactic.ByContra #align_import field_theory.krull_topology from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f" open scoped Classical Pointwise theorem IntermediateField.map_id {K L : Type*} [Field K] [Field L] [Algebra K L] (E : IntermediateField K L) : E.map (AlgHom.id K L) = E := SetLike.coe_injective <| Set.image_id _ #align intermediate_field.map_id IntermediateField.map_id instance im_finiteDimensional {K L : Type*} [Field K] [Field L] [Algebra K L] {E : IntermediateField K L} (σ : L ≃ₐ[K] L) [FiniteDimensional K E] : FiniteDimensional K (E.map σ.toAlgHom) := LinearEquiv.finiteDimensional (IntermediateField.intermediateFieldMap σ E).toLinearEquiv #align im_finite_dimensional im_finiteDimensional def finiteExts (K : Type*) [Field K] (L : Type*) [Field L] [Algebra K L] : Set (IntermediateField K L) := {E | FiniteDimensional K E} #align finite_exts finiteExts def fixedByFinite (K L : Type*) [Field K] [Field L] [Algebra K L] : Set (Subgroup (L ≃ₐ[K] L)) := IntermediateField.fixingSubgroup '' finiteExts K L #align fixed_by_finite fixedByFinite theorem IntermediateField.finiteDimensional_bot (K L : Type*) [Field K] [Field L] [Algebra K L] : FiniteDimensional K (⊥ : IntermediateField K L) := .of_rank_eq_one IntermediateField.rank_bot #align intermediate_field.finite_dimensional_bot IntermediateField.finiteDimensional_bot theorem IntermediateField.fixingSubgroup.bot {K L : Type*} [Field K] [Field L] [Algebra K L] : IntermediateField.fixingSubgroup (⊥ : IntermediateField K L) = ⊤ := by ext f refine ⟨fun _ => Subgroup.mem_top _, fun _ => ?_⟩ rintro ⟨x, hx : x ∈ (⊥ : IntermediateField K L)⟩ rw [IntermediateField.mem_bot] at hx rcases hx with ⟨y, rfl⟩ exact f.commutes y #align intermediate_field.fixing_subgroup.bot IntermediateField.fixingSubgroup.bot theorem top_fixedByFinite {K L : Type*} [Field K] [Field L] [Algebra K L] : ⊤ ∈ fixedByFinite K L := ⟨⊥, IntermediateField.finiteDimensional_bot K L, IntermediateField.fixingSubgroup.bot⟩ #align top_fixed_by_finite top_fixedByFinite theorem finiteDimensional_sup {K L : Type*} [Field K] [Field L] [Algebra K L] (E1 E2 : IntermediateField K L) (_ : FiniteDimensional K E1) (_ : FiniteDimensional K E2) : FiniteDimensional K (↥(E1 ⊔ E2)) := IntermediateField.finiteDimensional_sup E1 E2 #align finite_dimensional_sup finiteDimensional_sup theorem IntermediateField.mem_fixingSubgroup_iff {K L : Type*} [Field K] [Field L] [Algebra K L] (E : IntermediateField K L) (σ : L ≃ₐ[K] L) : σ ∈ E.fixingSubgroup ↔ ∀ x : L, x ∈ E → σ x = x := ⟨fun hσ x hx => hσ ⟨x, hx⟩, fun h ⟨x, hx⟩ => h x hx⟩ #align intermediate_field.mem_fixing_subgroup_iff IntermediateField.mem_fixingSubgroup_iff
Mathlib/FieldTheory/KrullTopology.lean
124
127
theorem IntermediateField.fixingSubgroup.antimono {K L : Type*} [Field K] [Field L] [Algebra K L] {E1 E2 : IntermediateField K L} (h12 : E1 ≤ E2) : E2.fixingSubgroup ≤ E1.fixingSubgroup := by
rintro σ hσ ⟨x, hx⟩ exact hσ ⟨x, h12 hx⟩
2,034
import Mathlib.FieldTheory.Galois #align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Polynomial open FiniteDimensional namespace Polynomial variable {F : Type*} [Field F] (p q : F[X]) (E : Type*) [Field E] [Algebra F E] def Gal := p.SplittingField ≃ₐ[F] p.SplittingField -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5020): -- deriving Group, Fintype #align polynomial.gal Polynomial.Gal namespace Gal instance instGroup : Group (Gal p) := inferInstanceAs (Group (p.SplittingField ≃ₐ[F] p.SplittingField)) instance instFintype : Fintype (Gal p) := inferInstanceAs (Fintype (p.SplittingField ≃ₐ[F] p.SplittingField)) instance : CoeFun p.Gal fun _ => p.SplittingField → p.SplittingField := -- Porting note: was AlgEquiv.hasCoeToFun inferInstanceAs (CoeFun (p.SplittingField ≃ₐ[F] p.SplittingField) _) instance applyMulSemiringAction : MulSemiringAction p.Gal p.SplittingField := AlgEquiv.applyMulSemiringAction #align polynomial.gal.apply_mul_semiring_action Polynomial.Gal.applyMulSemiringAction @[ext]
Mathlib/FieldTheory/PolynomialGaloisGroup.lean
74
79
theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ x) : σ = τ := by
refine AlgEquiv.ext fun x => (AlgHom.mem_equalizer σ.toAlgHom τ.toAlgHom x).mp ((SetLike.ext_iff.mp ?_ x).mpr Algebra.mem_top) rwa [eq_top_iff, ← SplittingField.adjoin_rootSet, Algebra.adjoin_le_iff]
2,035
import Mathlib.FieldTheory.Galois #align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Polynomial open FiniteDimensional namespace Polynomial variable {F : Type*} [Field F] (p q : F[X]) (E : Type*) [Field E] [Algebra F E] def Gal := p.SplittingField ≃ₐ[F] p.SplittingField -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5020): -- deriving Group, Fintype #align polynomial.gal Polynomial.Gal namespace Gal instance instGroup : Group (Gal p) := inferInstanceAs (Group (p.SplittingField ≃ₐ[F] p.SplittingField)) instance instFintype : Fintype (Gal p) := inferInstanceAs (Fintype (p.SplittingField ≃ₐ[F] p.SplittingField)) instance : CoeFun p.Gal fun _ => p.SplittingField → p.SplittingField := -- Porting note: was AlgEquiv.hasCoeToFun inferInstanceAs (CoeFun (p.SplittingField ≃ₐ[F] p.SplittingField) _) instance applyMulSemiringAction : MulSemiringAction p.Gal p.SplittingField := AlgEquiv.applyMulSemiringAction #align polynomial.gal.apply_mul_semiring_action Polynomial.Gal.applyMulSemiringAction @[ext] theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ x) : σ = τ := by refine AlgEquiv.ext fun x => (AlgHom.mem_equalizer σ.toAlgHom τ.toAlgHom x).mp ((SetLike.ext_iff.mp ?_ x).mpr Algebra.mem_top) rwa [eq_top_iff, ← SplittingField.adjoin_rootSet, Algebra.adjoin_le_iff] #align polynomial.gal.ext Polynomial.Gal.ext def uniqueGalOfSplits (h : p.Splits (RingHom.id F)) : Unique p.Gal where default := 1 uniq f := AlgEquiv.ext fun x => by obtain ⟨y, rfl⟩ := Algebra.mem_bot.mp ((SetLike.ext_iff.mp ((IsSplittingField.splits_iff _ p).mp h) x).mp Algebra.mem_top) rw [AlgEquiv.commutes, AlgEquiv.commutes] #align polynomial.gal.unique_gal_of_splits Polynomial.Gal.uniqueGalOfSplits instance [h : Fact (p.Splits (RingHom.id F))] : Unique p.Gal := uniqueGalOfSplits _ h.1 instance uniqueGalZero : Unique (0 : F[X]).Gal := uniqueGalOfSplits _ (splits_zero _) #align polynomial.gal.unique_gal_zero Polynomial.Gal.uniqueGalZero instance uniqueGalOne : Unique (1 : F[X]).Gal := uniqueGalOfSplits _ (splits_one _) #align polynomial.gal.unique_gal_one Polynomial.Gal.uniqueGalOne instance uniqueGalC (x : F) : Unique (C x).Gal := uniqueGalOfSplits _ (splits_C _ _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_C Polynomial.Gal.uniqueGalC instance uniqueGalX : Unique (X : F[X]).Gal := uniqueGalOfSplits _ (splits_X _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X Polynomial.Gal.uniqueGalX instance uniqueGalXSubC (x : F) : Unique (X - C x).Gal := uniqueGalOfSplits _ (splits_X_sub_C _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X_sub_C Polynomial.Gal.uniqueGalXSubC instance uniqueGalXPow (n : ℕ) : Unique (X ^ n : F[X]).Gal := uniqueGalOfSplits _ (splits_X_pow _ _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X_pow Polynomial.Gal.uniqueGalXPow instance [h : Fact (p.Splits (algebraMap F E))] : Algebra p.SplittingField E := (IsSplittingField.lift p.SplittingField p h.1).toRingHom.toAlgebra instance [h : Fact (p.Splits (algebraMap F E))] : IsScalarTower F p.SplittingField E := IsScalarTower.of_algebraMap_eq fun x => ((IsSplittingField.lift p.SplittingField p h.1).commutes x).symm -- The `Algebra p.SplittingField E` instance above behaves badly when -- `E := p.SplittingField`, since it may result in a unification problem -- `IsSplittingField.lift.toRingHom.toAlgebra =?= Algebra.id`, -- which takes an extremely long time to resolve, causing timeouts. -- Since we don't really care about this definition, marking it as irreducible -- causes that unification to error out early. def restrict [Fact (p.Splits (algebraMap F E))] : (E ≃ₐ[F] E) →* p.Gal := AlgEquiv.restrictNormalHom p.SplittingField #align polynomial.gal.restrict Polynomial.Gal.restrict theorem restrict_surjective [Fact (p.Splits (algebraMap F E))] [Normal F E] : Function.Surjective (restrict p E) := AlgEquiv.restrictNormalHom_surjective E #align polynomial.gal.restrict_surjective Polynomial.Gal.restrict_surjective section RootsAction def mapRoots [Fact (p.Splits (algebraMap F E))] : rootSet p p.SplittingField → rootSet p E := Set.MapsTo.restrict (IsScalarTower.toAlgHom F p.SplittingField E) _ _ <| rootSet_mapsTo _ #align polynomial.gal.map_roots Polynomial.Gal.mapRoots
Mathlib/FieldTheory/PolynomialGaloisGroup.lean
155
168
theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] : Function.Bijective (mapRoots p E) := by
constructor · exact fun _ _ h => Subtype.ext (RingHom.injective _ (Subtype.ext_iff.mp h)) · intro y -- this is just an equality of two different ways to write the roots of `p` as an `E`-polynomial have key := roots_map (IsScalarTower.toAlgHom F p.SplittingField E : p.SplittingField →+* E) ((splits_id_iff_splits _).mpr (IsSplittingField.splits p.SplittingField p)) rw [map_map, AlgHom.comp_algebraMap] at key have hy := Subtype.mem y simp only [rootSet, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy rcases hy with ⟨x, hx1, hx2⟩ exact ⟨⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr hx1⟩, Subtype.ext hx2⟩
2,035
import Mathlib.FieldTheory.Galois #align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Polynomial open FiniteDimensional namespace Polynomial variable {F : Type*} [Field F] (p q : F[X]) (E : Type*) [Field E] [Algebra F E] def Gal := p.SplittingField ≃ₐ[F] p.SplittingField -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5020): -- deriving Group, Fintype #align polynomial.gal Polynomial.Gal namespace Gal instance instGroup : Group (Gal p) := inferInstanceAs (Group (p.SplittingField ≃ₐ[F] p.SplittingField)) instance instFintype : Fintype (Gal p) := inferInstanceAs (Fintype (p.SplittingField ≃ₐ[F] p.SplittingField)) instance : CoeFun p.Gal fun _ => p.SplittingField → p.SplittingField := -- Porting note: was AlgEquiv.hasCoeToFun inferInstanceAs (CoeFun (p.SplittingField ≃ₐ[F] p.SplittingField) _) instance applyMulSemiringAction : MulSemiringAction p.Gal p.SplittingField := AlgEquiv.applyMulSemiringAction #align polynomial.gal.apply_mul_semiring_action Polynomial.Gal.applyMulSemiringAction @[ext] theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ x) : σ = τ := by refine AlgEquiv.ext fun x => (AlgHom.mem_equalizer σ.toAlgHom τ.toAlgHom x).mp ((SetLike.ext_iff.mp ?_ x).mpr Algebra.mem_top) rwa [eq_top_iff, ← SplittingField.adjoin_rootSet, Algebra.adjoin_le_iff] #align polynomial.gal.ext Polynomial.Gal.ext def uniqueGalOfSplits (h : p.Splits (RingHom.id F)) : Unique p.Gal where default := 1 uniq f := AlgEquiv.ext fun x => by obtain ⟨y, rfl⟩ := Algebra.mem_bot.mp ((SetLike.ext_iff.mp ((IsSplittingField.splits_iff _ p).mp h) x).mp Algebra.mem_top) rw [AlgEquiv.commutes, AlgEquiv.commutes] #align polynomial.gal.unique_gal_of_splits Polynomial.Gal.uniqueGalOfSplits instance [h : Fact (p.Splits (RingHom.id F))] : Unique p.Gal := uniqueGalOfSplits _ h.1 instance uniqueGalZero : Unique (0 : F[X]).Gal := uniqueGalOfSplits _ (splits_zero _) #align polynomial.gal.unique_gal_zero Polynomial.Gal.uniqueGalZero instance uniqueGalOne : Unique (1 : F[X]).Gal := uniqueGalOfSplits _ (splits_one _) #align polynomial.gal.unique_gal_one Polynomial.Gal.uniqueGalOne instance uniqueGalC (x : F) : Unique (C x).Gal := uniqueGalOfSplits _ (splits_C _ _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_C Polynomial.Gal.uniqueGalC instance uniqueGalX : Unique (X : F[X]).Gal := uniqueGalOfSplits _ (splits_X _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X Polynomial.Gal.uniqueGalX instance uniqueGalXSubC (x : F) : Unique (X - C x).Gal := uniqueGalOfSplits _ (splits_X_sub_C _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X_sub_C Polynomial.Gal.uniqueGalXSubC instance uniqueGalXPow (n : ℕ) : Unique (X ^ n : F[X]).Gal := uniqueGalOfSplits _ (splits_X_pow _ _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X_pow Polynomial.Gal.uniqueGalXPow instance [h : Fact (p.Splits (algebraMap F E))] : Algebra p.SplittingField E := (IsSplittingField.lift p.SplittingField p h.1).toRingHom.toAlgebra instance [h : Fact (p.Splits (algebraMap F E))] : IsScalarTower F p.SplittingField E := IsScalarTower.of_algebraMap_eq fun x => ((IsSplittingField.lift p.SplittingField p h.1).commutes x).symm -- The `Algebra p.SplittingField E` instance above behaves badly when -- `E := p.SplittingField`, since it may result in a unification problem -- `IsSplittingField.lift.toRingHom.toAlgebra =?= Algebra.id`, -- which takes an extremely long time to resolve, causing timeouts. -- Since we don't really care about this definition, marking it as irreducible -- causes that unification to error out early. def restrict [Fact (p.Splits (algebraMap F E))] : (E ≃ₐ[F] E) →* p.Gal := AlgEquiv.restrictNormalHom p.SplittingField #align polynomial.gal.restrict Polynomial.Gal.restrict theorem restrict_surjective [Fact (p.Splits (algebraMap F E))] [Normal F E] : Function.Surjective (restrict p E) := AlgEquiv.restrictNormalHom_surjective E #align polynomial.gal.restrict_surjective Polynomial.Gal.restrict_surjective variable {p q} def restrictDvd (hpq : p ∣ q) : q.Gal →* p.Gal := haveI := Classical.dec (q = 0) if hq : q = 0 then 1 else @restrict F _ p _ _ _ ⟨splits_of_splits_of_dvd (algebraMap F q.SplittingField) hq (SplittingField.splits q) hpq⟩ #align polynomial.gal.restrict_dvd Polynomial.Gal.restrictDvd
Mathlib/FieldTheory/PolynomialGaloisGroup.lean
259
268
theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) : restrictDvd hpq = if hq : q = 0 then 1 else @restrict F _ p _ _ _ ⟨splits_of_splits_of_dvd (algebraMap F q.SplittingField) hq (SplittingField.splits q) hpq⟩ := by
-- Porting note: added `unfold` unfold restrictDvd convert rfl
2,035
import Mathlib.FieldTheory.Galois #align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Polynomial open FiniteDimensional namespace Polynomial variable {F : Type*} [Field F] (p q : F[X]) (E : Type*) [Field E] [Algebra F E] def Gal := p.SplittingField ≃ₐ[F] p.SplittingField -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5020): -- deriving Group, Fintype #align polynomial.gal Polynomial.Gal namespace Gal instance instGroup : Group (Gal p) := inferInstanceAs (Group (p.SplittingField ≃ₐ[F] p.SplittingField)) instance instFintype : Fintype (Gal p) := inferInstanceAs (Fintype (p.SplittingField ≃ₐ[F] p.SplittingField)) instance : CoeFun p.Gal fun _ => p.SplittingField → p.SplittingField := -- Porting note: was AlgEquiv.hasCoeToFun inferInstanceAs (CoeFun (p.SplittingField ≃ₐ[F] p.SplittingField) _) instance applyMulSemiringAction : MulSemiringAction p.Gal p.SplittingField := AlgEquiv.applyMulSemiringAction #align polynomial.gal.apply_mul_semiring_action Polynomial.Gal.applyMulSemiringAction @[ext] theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ x) : σ = τ := by refine AlgEquiv.ext fun x => (AlgHom.mem_equalizer σ.toAlgHom τ.toAlgHom x).mp ((SetLike.ext_iff.mp ?_ x).mpr Algebra.mem_top) rwa [eq_top_iff, ← SplittingField.adjoin_rootSet, Algebra.adjoin_le_iff] #align polynomial.gal.ext Polynomial.Gal.ext def uniqueGalOfSplits (h : p.Splits (RingHom.id F)) : Unique p.Gal where default := 1 uniq f := AlgEquiv.ext fun x => by obtain ⟨y, rfl⟩ := Algebra.mem_bot.mp ((SetLike.ext_iff.mp ((IsSplittingField.splits_iff _ p).mp h) x).mp Algebra.mem_top) rw [AlgEquiv.commutes, AlgEquiv.commutes] #align polynomial.gal.unique_gal_of_splits Polynomial.Gal.uniqueGalOfSplits instance [h : Fact (p.Splits (RingHom.id F))] : Unique p.Gal := uniqueGalOfSplits _ h.1 instance uniqueGalZero : Unique (0 : F[X]).Gal := uniqueGalOfSplits _ (splits_zero _) #align polynomial.gal.unique_gal_zero Polynomial.Gal.uniqueGalZero instance uniqueGalOne : Unique (1 : F[X]).Gal := uniqueGalOfSplits _ (splits_one _) #align polynomial.gal.unique_gal_one Polynomial.Gal.uniqueGalOne instance uniqueGalC (x : F) : Unique (C x).Gal := uniqueGalOfSplits _ (splits_C _ _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_C Polynomial.Gal.uniqueGalC instance uniqueGalX : Unique (X : F[X]).Gal := uniqueGalOfSplits _ (splits_X _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X Polynomial.Gal.uniqueGalX instance uniqueGalXSubC (x : F) : Unique (X - C x).Gal := uniqueGalOfSplits _ (splits_X_sub_C _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X_sub_C Polynomial.Gal.uniqueGalXSubC instance uniqueGalXPow (n : ℕ) : Unique (X ^ n : F[X]).Gal := uniqueGalOfSplits _ (splits_X_pow _ _) set_option linter.uppercaseLean3 false in #align polynomial.gal.unique_gal_X_pow Polynomial.Gal.uniqueGalXPow instance [h : Fact (p.Splits (algebraMap F E))] : Algebra p.SplittingField E := (IsSplittingField.lift p.SplittingField p h.1).toRingHom.toAlgebra instance [h : Fact (p.Splits (algebraMap F E))] : IsScalarTower F p.SplittingField E := IsScalarTower.of_algebraMap_eq fun x => ((IsSplittingField.lift p.SplittingField p h.1).commutes x).symm -- The `Algebra p.SplittingField E` instance above behaves badly when -- `E := p.SplittingField`, since it may result in a unification problem -- `IsSplittingField.lift.toRingHom.toAlgebra =?= Algebra.id`, -- which takes an extremely long time to resolve, causing timeouts. -- Since we don't really care about this definition, marking it as irreducible -- causes that unification to error out early. def restrict [Fact (p.Splits (algebraMap F E))] : (E ≃ₐ[F] E) →* p.Gal := AlgEquiv.restrictNormalHom p.SplittingField #align polynomial.gal.restrict Polynomial.Gal.restrict theorem restrict_surjective [Fact (p.Splits (algebraMap F E))] [Normal F E] : Function.Surjective (restrict p E) := AlgEquiv.restrictNormalHom_surjective E #align polynomial.gal.restrict_surjective Polynomial.Gal.restrict_surjective variable {p q} def restrictDvd (hpq : p ∣ q) : q.Gal →* p.Gal := haveI := Classical.dec (q = 0) if hq : q = 0 then 1 else @restrict F _ p _ _ _ ⟨splits_of_splits_of_dvd (algebraMap F q.SplittingField) hq (SplittingField.splits q) hpq⟩ #align polynomial.gal.restrict_dvd Polynomial.Gal.restrictDvd theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) : restrictDvd hpq = if hq : q = 0 then 1 else @restrict F _ p _ _ _ ⟨splits_of_splits_of_dvd (algebraMap F q.SplittingField) hq (SplittingField.splits q) hpq⟩ := by -- Porting note: added `unfold` unfold restrictDvd convert rfl #align polynomial.gal.restrict_dvd_def Polynomial.Gal.restrictDvd_def
Mathlib/FieldTheory/PolynomialGaloisGroup.lean
271
278
theorem restrictDvd_surjective (hpq : p ∣ q) (hq : q ≠ 0) : Function.Surjective (restrictDvd hpq) := by
classical -- Porting note: was `simp only [restrictDvd_def, dif_neg hq, restrict_surjective]` haveI := Fact.mk <| splits_of_splits_of_dvd (algebraMap F q.SplittingField) hq (SplittingField.splits q) hpq simp only [restrictDvd_def, dif_neg hq] exact restrict_surjective _ _
2,035
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E]
Mathlib/FieldTheory/AbelRuffini.lean
39
39
theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by
infer_instance
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
42
42
theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by
infer_instance
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
45
45
theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by
infer_instance
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
49
49
theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by
infer_instance
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_is_solvable gal_X_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
53
53
theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by
infer_instance
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_is_solvable gal_X_isSolvable theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_sub_C_is_solvable gal_X_sub_C_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
57
57
theorem gal_X_pow_isSolvable (n : ℕ) : IsSolvable (X ^ n : F[X]).Gal := by
infer_instance
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_is_solvable gal_X_isSolvable theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_sub_C_is_solvable gal_X_sub_C_isSolvable theorem gal_X_pow_isSolvable (n : ℕ) : IsSolvable (X ^ n : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_pow_is_solvable gal_X_pow_isSolvable theorem gal_mul_isSolvable {p q : F[X]} (_ : IsSolvable p.Gal) (_ : IsSolvable q.Gal) : IsSolvable (p * q).Gal := solvable_of_solvable_injective (Gal.restrictProd_injective p q) #align gal_mul_is_solvable gal_mul_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
66
72
theorem gal_prod_isSolvable {s : Multiset F[X]} (hs : ∀ p ∈ s, IsSolvable (Gal p)) : IsSolvable s.prod.Gal := by
apply Multiset.induction_on' s · exact gal_one_isSolvable · intro p t hps _ ht rw [Multiset.insert_eq_cons, Multiset.prod_cons] exact gal_mul_isSolvable (hs p hps) ht
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_is_solvable gal_X_isSolvable theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_sub_C_is_solvable gal_X_sub_C_isSolvable theorem gal_X_pow_isSolvable (n : ℕ) : IsSolvable (X ^ n : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_pow_is_solvable gal_X_pow_isSolvable theorem gal_mul_isSolvable {p q : F[X]} (_ : IsSolvable p.Gal) (_ : IsSolvable q.Gal) : IsSolvable (p * q).Gal := solvable_of_solvable_injective (Gal.restrictProd_injective p q) #align gal_mul_is_solvable gal_mul_isSolvable theorem gal_prod_isSolvable {s : Multiset F[X]} (hs : ∀ p ∈ s, IsSolvable (Gal p)) : IsSolvable s.prod.Gal := by apply Multiset.induction_on' s · exact gal_one_isSolvable · intro p t hps _ ht rw [Multiset.insert_eq_cons, Multiset.prod_cons] exact gal_mul_isSolvable (hs p hps) ht #align gal_prod_is_solvable gal_prod_isSolvable theorem gal_isSolvable_of_splits {p q : F[X]} (_ : Fact (p.Splits (algebraMap F q.SplittingField))) (hq : IsSolvable q.Gal) : IsSolvable p.Gal := haveI : IsSolvable (q.SplittingField ≃ₐ[F] q.SplittingField) := hq solvable_of_surjective (AlgEquiv.restrictNormalHom_surjective q.SplittingField) #align gal_is_solvable_of_splits gal_isSolvable_of_splits
Mathlib/FieldTheory/AbelRuffini.lean
82
93
theorem gal_isSolvable_tower (p q : F[X]) (hpq : p.Splits (algebraMap F q.SplittingField)) (hp : IsSolvable p.Gal) (hq : IsSolvable (q.map (algebraMap F p.SplittingField)).Gal) : IsSolvable q.Gal := by
let K := p.SplittingField let L := q.SplittingField haveI : Fact (p.Splits (algebraMap F L)) := ⟨hpq⟩ let ϕ : (L ≃ₐ[K] L) ≃* (q.map (algebraMap F K)).Gal := (IsSplittingField.algEquiv L (q.map (algebraMap F K))).autCongr have ϕ_inj : Function.Injective ϕ.toMonoidHom := ϕ.injective haveI : IsSolvable (K ≃ₐ[F] K) := hp haveI : IsSolvable (L ≃ₐ[K] L) := solvable_of_solvable_injective ϕ_inj exact isSolvable_of_isScalarTower F p.SplittingField q.SplittingField
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_is_solvable gal_X_isSolvable theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_sub_C_is_solvable gal_X_sub_C_isSolvable theorem gal_X_pow_isSolvable (n : ℕ) : IsSolvable (X ^ n : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_pow_is_solvable gal_X_pow_isSolvable theorem gal_mul_isSolvable {p q : F[X]} (_ : IsSolvable p.Gal) (_ : IsSolvable q.Gal) : IsSolvable (p * q).Gal := solvable_of_solvable_injective (Gal.restrictProd_injective p q) #align gal_mul_is_solvable gal_mul_isSolvable theorem gal_prod_isSolvable {s : Multiset F[X]} (hs : ∀ p ∈ s, IsSolvable (Gal p)) : IsSolvable s.prod.Gal := by apply Multiset.induction_on' s · exact gal_one_isSolvable · intro p t hps _ ht rw [Multiset.insert_eq_cons, Multiset.prod_cons] exact gal_mul_isSolvable (hs p hps) ht #align gal_prod_is_solvable gal_prod_isSolvable theorem gal_isSolvable_of_splits {p q : F[X]} (_ : Fact (p.Splits (algebraMap F q.SplittingField))) (hq : IsSolvable q.Gal) : IsSolvable p.Gal := haveI : IsSolvable (q.SplittingField ≃ₐ[F] q.SplittingField) := hq solvable_of_surjective (AlgEquiv.restrictNormalHom_surjective q.SplittingField) #align gal_is_solvable_of_splits gal_isSolvable_of_splits theorem gal_isSolvable_tower (p q : F[X]) (hpq : p.Splits (algebraMap F q.SplittingField)) (hp : IsSolvable p.Gal) (hq : IsSolvable (q.map (algebraMap F p.SplittingField)).Gal) : IsSolvable q.Gal := by let K := p.SplittingField let L := q.SplittingField haveI : Fact (p.Splits (algebraMap F L)) := ⟨hpq⟩ let ϕ : (L ≃ₐ[K] L) ≃* (q.map (algebraMap F K)).Gal := (IsSplittingField.algEquiv L (q.map (algebraMap F K))).autCongr have ϕ_inj : Function.Injective ϕ.toMonoidHom := ϕ.injective haveI : IsSolvable (K ≃ₐ[F] K) := hp haveI : IsSolvable (L ≃ₐ[K] L) := solvable_of_solvable_injective ϕ_inj exact isSolvable_of_isScalarTower F p.SplittingField q.SplittingField #align gal_is_solvable_tower gal_isSolvable_tower section GalXPowSubC
Mathlib/FieldTheory/AbelRuffini.lean
98
114
theorem gal_X_pow_sub_one_isSolvable (n : ℕ) : IsSolvable (X ^ n - 1 : F[X]).Gal := by
by_cases hn : n = 0 · rw [hn, pow_zero, sub_self] exact gal_zero_isSolvable have hn' : 0 < n := pos_iff_ne_zero.mpr hn have hn'' : (X ^ n - 1 : F[X]) ≠ 0 := X_pow_sub_C_ne_zero hn' 1 apply isSolvable_of_comm intro σ τ ext a ha simp only [mem_rootSet_of_ne hn'', map_sub, aeval_X_pow, aeval_one, sub_eq_zero] at ha have key : ∀ σ : (X ^ n - 1 : F[X]).Gal, ∃ m : ℕ, σ a = a ^ m := by intro σ lift n to ℕ+ using hn' exact map_rootsOfUnity_eq_pow_self σ.toAlgHom (rootsOfUnity.mkOfPowEq a ha) obtain ⟨c, hc⟩ := key σ obtain ⟨d, hd⟩ := key τ rw [σ.mul_apply, τ.mul_apply, hc, τ.map_pow, hd, σ.map_pow, hc, ← pow_mul, pow_mul']
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_is_solvable gal_X_isSolvable theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_sub_C_is_solvable gal_X_sub_C_isSolvable theorem gal_X_pow_isSolvable (n : ℕ) : IsSolvable (X ^ n : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_pow_is_solvable gal_X_pow_isSolvable theorem gal_mul_isSolvable {p q : F[X]} (_ : IsSolvable p.Gal) (_ : IsSolvable q.Gal) : IsSolvable (p * q).Gal := solvable_of_solvable_injective (Gal.restrictProd_injective p q) #align gal_mul_is_solvable gal_mul_isSolvable theorem gal_prod_isSolvable {s : Multiset F[X]} (hs : ∀ p ∈ s, IsSolvable (Gal p)) : IsSolvable s.prod.Gal := by apply Multiset.induction_on' s · exact gal_one_isSolvable · intro p t hps _ ht rw [Multiset.insert_eq_cons, Multiset.prod_cons] exact gal_mul_isSolvable (hs p hps) ht #align gal_prod_is_solvable gal_prod_isSolvable theorem gal_isSolvable_of_splits {p q : F[X]} (_ : Fact (p.Splits (algebraMap F q.SplittingField))) (hq : IsSolvable q.Gal) : IsSolvable p.Gal := haveI : IsSolvable (q.SplittingField ≃ₐ[F] q.SplittingField) := hq solvable_of_surjective (AlgEquiv.restrictNormalHom_surjective q.SplittingField) #align gal_is_solvable_of_splits gal_isSolvable_of_splits theorem gal_isSolvable_tower (p q : F[X]) (hpq : p.Splits (algebraMap F q.SplittingField)) (hp : IsSolvable p.Gal) (hq : IsSolvable (q.map (algebraMap F p.SplittingField)).Gal) : IsSolvable q.Gal := by let K := p.SplittingField let L := q.SplittingField haveI : Fact (p.Splits (algebraMap F L)) := ⟨hpq⟩ let ϕ : (L ≃ₐ[K] L) ≃* (q.map (algebraMap F K)).Gal := (IsSplittingField.algEquiv L (q.map (algebraMap F K))).autCongr have ϕ_inj : Function.Injective ϕ.toMonoidHom := ϕ.injective haveI : IsSolvable (K ≃ₐ[F] K) := hp haveI : IsSolvable (L ≃ₐ[K] L) := solvable_of_solvable_injective ϕ_inj exact isSolvable_of_isScalarTower F p.SplittingField q.SplittingField #align gal_is_solvable_tower gal_isSolvable_tower section GalXPowSubC theorem gal_X_pow_sub_one_isSolvable (n : ℕ) : IsSolvable (X ^ n - 1 : F[X]).Gal := by by_cases hn : n = 0 · rw [hn, pow_zero, sub_self] exact gal_zero_isSolvable have hn' : 0 < n := pos_iff_ne_zero.mpr hn have hn'' : (X ^ n - 1 : F[X]) ≠ 0 := X_pow_sub_C_ne_zero hn' 1 apply isSolvable_of_comm intro σ τ ext a ha simp only [mem_rootSet_of_ne hn'', map_sub, aeval_X_pow, aeval_one, sub_eq_zero] at ha have key : ∀ σ : (X ^ n - 1 : F[X]).Gal, ∃ m : ℕ, σ a = a ^ m := by intro σ lift n to ℕ+ using hn' exact map_rootsOfUnity_eq_pow_self σ.toAlgHom (rootsOfUnity.mkOfPowEq a ha) obtain ⟨c, hc⟩ := key σ obtain ⟨d, hd⟩ := key τ rw [σ.mul_apply, τ.mul_apply, hc, τ.map_pow, hd, σ.map_pow, hc, ← pow_mul, pow_mul'] set_option linter.uppercaseLean3 false in #align gal_X_pow_sub_one_is_solvable gal_X_pow_sub_one_isSolvable
Mathlib/FieldTheory/AbelRuffini.lean
118
153
theorem gal_X_pow_sub_C_isSolvable_aux (n : ℕ) (a : F) (h : (X ^ n - 1 : F[X]).Splits (RingHom.id F)) : IsSolvable (X ^ n - C a).Gal := by
by_cases ha : a = 0 · rw [ha, C_0, sub_zero] exact gal_X_pow_isSolvable n have ha' : algebraMap F (X ^ n - C a).SplittingField a ≠ 0 := mt ((injective_iff_map_eq_zero _).mp (RingHom.injective _) a) ha by_cases hn : n = 0 · rw [hn, pow_zero, ← C_1, ← C_sub] exact gal_C_isSolvable (1 - a) have hn' : 0 < n := pos_iff_ne_zero.mpr hn have hn'' : X ^ n - C a ≠ 0 := X_pow_sub_C_ne_zero hn' a have hn''' : (X ^ n - 1 : F[X]) ≠ 0 := X_pow_sub_C_ne_zero hn' 1 have mem_range : ∀ {c : (X ^ n - C a).SplittingField}, (c ^ n = 1 → (∃ d, algebraMap F (X ^ n - C a).SplittingField d = c)) := fun {c} hc => RingHom.mem_range.mp (minpoly.mem_range_of_degree_eq_one F c (h.def.resolve_left hn''' (minpoly.irreducible ((SplittingField.instNormal (X ^ n - C a)).isIntegral c)) (minpoly.dvd F c (by rwa [map_id, AlgHom.map_sub, sub_eq_zero, aeval_X_pow, aeval_one])))) apply isSolvable_of_comm intro σ τ ext b hb rw [mem_rootSet_of_ne hn'', map_sub, aeval_X_pow, aeval_C, sub_eq_zero] at hb have hb' : b ≠ 0 := by intro hb' rw [hb', zero_pow hn] at hb exact ha' hb.symm have key : ∀ σ : (X ^ n - C a).Gal, ∃ c, σ b = b * algebraMap F _ c := by intro σ have key : (σ b / b) ^ n = 1 := by rw [div_pow, ← σ.map_pow, hb, σ.commutes, div_self ha'] obtain ⟨c, hc⟩ := mem_range key use c rw [hc, mul_div_cancel₀ (σ b) hb'] obtain ⟨c, hc⟩ := key σ obtain ⟨d, hd⟩ := key τ rw [σ.mul_apply, τ.mul_apply, hc, τ.map_mul, τ.commutes, hd, σ.map_mul, σ.commutes, hc, mul_assoc, mul_assoc, mul_right_inj' hb', mul_comm]
2,036
import Mathlib.GroupTheory.Solvable import Mathlib.FieldTheory.PolynomialGaloisGroup import Mathlib.RingTheory.RootsOfUnity.Basic #align_import field_theory.abel_ruffini from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a" noncomputable section open scoped Classical Polynomial IntermediateField open Polynomial IntermediateField section AbelRuffini variable {F : Type*} [Field F] {E : Type*} [Field E] [Algebra F E] theorem gal_zero_isSolvable : IsSolvable (0 : F[X]).Gal := by infer_instance #align gal_zero_is_solvable gal_zero_isSolvable theorem gal_one_isSolvable : IsSolvable (1 : F[X]).Gal := by infer_instance #align gal_one_is_solvable gal_one_isSolvable theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_C_is_solvable gal_C_isSolvable theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_is_solvable gal_X_isSolvable theorem gal_X_sub_C_isSolvable (x : F) : IsSolvable (X - C x).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_sub_C_is_solvable gal_X_sub_C_isSolvable theorem gal_X_pow_isSolvable (n : ℕ) : IsSolvable (X ^ n : F[X]).Gal := by infer_instance set_option linter.uppercaseLean3 false in #align gal_X_pow_is_solvable gal_X_pow_isSolvable theorem gal_mul_isSolvable {p q : F[X]} (_ : IsSolvable p.Gal) (_ : IsSolvable q.Gal) : IsSolvable (p * q).Gal := solvable_of_solvable_injective (Gal.restrictProd_injective p q) #align gal_mul_is_solvable gal_mul_isSolvable theorem gal_prod_isSolvable {s : Multiset F[X]} (hs : ∀ p ∈ s, IsSolvable (Gal p)) : IsSolvable s.prod.Gal := by apply Multiset.induction_on' s · exact gal_one_isSolvable · intro p t hps _ ht rw [Multiset.insert_eq_cons, Multiset.prod_cons] exact gal_mul_isSolvable (hs p hps) ht #align gal_prod_is_solvable gal_prod_isSolvable theorem gal_isSolvable_of_splits {p q : F[X]} (_ : Fact (p.Splits (algebraMap F q.SplittingField))) (hq : IsSolvable q.Gal) : IsSolvable p.Gal := haveI : IsSolvable (q.SplittingField ≃ₐ[F] q.SplittingField) := hq solvable_of_surjective (AlgEquiv.restrictNormalHom_surjective q.SplittingField) #align gal_is_solvable_of_splits gal_isSolvable_of_splits theorem gal_isSolvable_tower (p q : F[X]) (hpq : p.Splits (algebraMap F q.SplittingField)) (hp : IsSolvable p.Gal) (hq : IsSolvable (q.map (algebraMap F p.SplittingField)).Gal) : IsSolvable q.Gal := by let K := p.SplittingField let L := q.SplittingField haveI : Fact (p.Splits (algebraMap F L)) := ⟨hpq⟩ let ϕ : (L ≃ₐ[K] L) ≃* (q.map (algebraMap F K)).Gal := (IsSplittingField.algEquiv L (q.map (algebraMap F K))).autCongr have ϕ_inj : Function.Injective ϕ.toMonoidHom := ϕ.injective haveI : IsSolvable (K ≃ₐ[F] K) := hp haveI : IsSolvable (L ≃ₐ[K] L) := solvable_of_solvable_injective ϕ_inj exact isSolvable_of_isScalarTower F p.SplittingField q.SplittingField #align gal_is_solvable_tower gal_isSolvable_tower variable (F) inductive IsSolvableByRad : E → Prop | base (α : F) : IsSolvableByRad (algebraMap F E α) | add (α β : E) : IsSolvableByRad α → IsSolvableByRad β → IsSolvableByRad (α + β) | neg (α : E) : IsSolvableByRad α → IsSolvableByRad (-α) | mul (α β : E) : IsSolvableByRad α → IsSolvableByRad β → IsSolvableByRad (α * β) | inv (α : E) : IsSolvableByRad α → IsSolvableByRad α⁻¹ | rad (α : E) (n : ℕ) (hn : n ≠ 0) : IsSolvableByRad (α ^ n) → IsSolvableByRad α #align is_solvable_by_rad IsSolvableByRad variable (E) def solvableByRad : IntermediateField F E where carrier := IsSolvableByRad F zero_mem' := by change IsSolvableByRad F 0 convert IsSolvableByRad.base (E := E) (0 : F); rw [RingHom.map_zero] add_mem' := by apply IsSolvableByRad.add one_mem' := by change IsSolvableByRad F 1 convert IsSolvableByRad.base (E := E) (1 : F); rw [RingHom.map_one] mul_mem' := by apply IsSolvableByRad.mul inv_mem' := IsSolvableByRad.inv algebraMap_mem' := IsSolvableByRad.base #align solvable_by_rad solvableByRad namespace solvableByRad variable {F} {E} {α : E}
Mathlib/FieldTheory/AbelRuffini.lean
248
280
theorem induction (P : solvableByRad F E → Prop) (base : ∀ α : F, P (algebraMap F (solvableByRad F E) α)) (add : ∀ α β : solvableByRad F E, P α → P β → P (α + β)) (neg : ∀ α : solvableByRad F E, P α → P (-α)) (mul : ∀ α β : solvableByRad F E, P α → P β → P (α * β)) (inv : ∀ α : solvableByRad F E, P α → P α⁻¹) (rad : ∀ α : solvableByRad F E, ∀ n : ℕ, n ≠ 0 → P (α ^ n) → P α) (α : solvableByRad F E) : P α := by
revert α suffices ∀ α : E, IsSolvableByRad F α → ∃ β : solvableByRad F E, ↑β = α ∧ P β by intro α obtain ⟨α₀, hα₀, Pα⟩ := this α (Subtype.mem α) convert Pα exact Subtype.ext hα₀.symm apply IsSolvableByRad.rec · exact fun α => ⟨algebraMap F (solvableByRad F E) α, rfl, base α⟩ · intro α β _ _ Pα Pβ obtain ⟨⟨α₀, hα₀, Pα⟩, β₀, hβ₀, Pβ⟩ := Pα, Pβ exact ⟨α₀ + β₀, by rw [← hα₀, ← hβ₀]; rfl, add α₀ β₀ Pα Pβ⟩ · intro α _ Pα obtain ⟨α₀, hα₀, Pα⟩ := Pα exact ⟨-α₀, by rw [← hα₀]; rfl, neg α₀ Pα⟩ · intro α β _ _ Pα Pβ obtain ⟨⟨α₀, hα₀, Pα⟩, β₀, hβ₀, Pβ⟩ := Pα, Pβ exact ⟨α₀ * β₀, by rw [← hα₀, ← hβ₀]; rfl, mul α₀ β₀ Pα Pβ⟩ · intro α _ Pα obtain ⟨α₀, hα₀, Pα⟩ := Pα exact ⟨α₀⁻¹, by rw [← hα₀]; rfl, inv α₀ Pα⟩ · intro α n hn hα Pα obtain ⟨α₀, hα₀, Pα⟩ := Pα refine ⟨⟨α, IsSolvableByRad.rad α n hn hα⟩, rfl, rad _ n hn ?_⟩ convert Pα exact Subtype.ext (Eq.trans ((solvableByRad F E).coe_pow _ n) hα₀.symm)
2,036
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply
Mathlib/RingTheory/Trace.lean
102
103
theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by
ext s; simp [trace_apply, LinearMap.trace, h]
2,037
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis
Mathlib/RingTheory/Trace.lean
109
111
theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by
rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl
2,037
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl #align algebra.trace_eq_matrix_trace Algebra.trace_eq_matrix_trace
Mathlib/RingTheory/Trace.lean
115
119
theorem trace_algebraMap_of_basis (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by
haveI := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert Finset.sum_const x simp [-coe_lmul_eq_mul]
2,037
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl #align algebra.trace_eq_matrix_trace Algebra.trace_eq_matrix_trace theorem trace_algebraMap_of_basis (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by haveI := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert Finset.sum_const x simp [-coe_lmul_eq_mul] #align algebra.trace_algebra_map_of_basis Algebra.trace_algebraMap_of_basis @[simp]
Mathlib/RingTheory/Trace.lean
128
131
theorem trace_algebraMap (x : K) : trace K L (algebraMap K L x) = finrank K L • x := by
by_cases H : ∃ s : Finset L, Nonempty (Basis s K L) · rw [trace_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] · simp [trace_eq_zero_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis_finset H]
2,037
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl #align algebra.trace_eq_matrix_trace Algebra.trace_eq_matrix_trace theorem trace_algebraMap_of_basis (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by haveI := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert Finset.sum_const x simp [-coe_lmul_eq_mul] #align algebra.trace_algebra_map_of_basis Algebra.trace_algebraMap_of_basis @[simp] theorem trace_algebraMap (x : K) : trace K L (algebraMap K L x) = finrank K L • x := by by_cases H : ∃ s : Finset L, Nonempty (Basis s K L) · rw [trace_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] · simp [trace_eq_zero_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis_finset H] #align algebra.trace_algebra_map Algebra.trace_algebraMap
Mathlib/RingTheory/Trace.lean
134
146
theorem trace_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) (x : T) : trace R S (trace S T x) = trace R T x := by
haveI := Classical.decEq ι haveI := Classical.decEq κ cases nonempty_fintype ι cases nonempty_fintype κ rw [trace_eq_matrix_trace (b.smul c), trace_eq_matrix_trace b, trace_eq_matrix_trace c, Matrix.trace, Matrix.trace, Matrix.trace, ← Finset.univ_product_univ, Finset.sum_product] refine Finset.sum_congr rfl fun i _ ↦ ?_ simp only [AlgHom.map_sum, smul_leftMulMatrix, Finset.sum_apply, Matrix.diag, Finset.sum_apply i (Finset.univ : Finset κ) fun y => leftMulMatrix b (leftMulMatrix c x y y)]
2,037
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl #align algebra.trace_eq_matrix_trace Algebra.trace_eq_matrix_trace theorem trace_algebraMap_of_basis (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by haveI := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert Finset.sum_const x simp [-coe_lmul_eq_mul] #align algebra.trace_algebra_map_of_basis Algebra.trace_algebraMap_of_basis @[simp] theorem trace_algebraMap (x : K) : trace K L (algebraMap K L x) = finrank K L • x := by by_cases H : ∃ s : Finset L, Nonempty (Basis s K L) · rw [trace_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] · simp [trace_eq_zero_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis_finset H] #align algebra.trace_algebra_map Algebra.trace_algebraMap theorem trace_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) (x : T) : trace R S (trace S T x) = trace R T x := by haveI := Classical.decEq ι haveI := Classical.decEq κ cases nonempty_fintype ι cases nonempty_fintype κ rw [trace_eq_matrix_trace (b.smul c), trace_eq_matrix_trace b, trace_eq_matrix_trace c, Matrix.trace, Matrix.trace, Matrix.trace, ← Finset.univ_product_univ, Finset.sum_product] refine Finset.sum_congr rfl fun i _ ↦ ?_ simp only [AlgHom.map_sum, smul_leftMulMatrix, Finset.sum_apply, Matrix.diag, Finset.sum_apply i (Finset.univ : Finset κ) fun y => leftMulMatrix b (leftMulMatrix c x y y)] #align algebra.trace_trace_of_basis Algebra.trace_trace_of_basis
Mathlib/RingTheory/Trace.lean
149
153
theorem trace_comp_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) : (trace R S).comp ((trace S T).restrictScalars R) = trace R T := by
ext rw [LinearMap.comp_apply, LinearMap.restrictScalars_apply, trace_trace_of_basis b c]
2,037
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl #align algebra.trace_eq_matrix_trace Algebra.trace_eq_matrix_trace theorem trace_algebraMap_of_basis (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by haveI := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert Finset.sum_const x simp [-coe_lmul_eq_mul] #align algebra.trace_algebra_map_of_basis Algebra.trace_algebraMap_of_basis @[simp] theorem trace_algebraMap (x : K) : trace K L (algebraMap K L x) = finrank K L • x := by by_cases H : ∃ s : Finset L, Nonempty (Basis s K L) · rw [trace_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] · simp [trace_eq_zero_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis_finset H] #align algebra.trace_algebra_map Algebra.trace_algebraMap theorem trace_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) (x : T) : trace R S (trace S T x) = trace R T x := by haveI := Classical.decEq ι haveI := Classical.decEq κ cases nonempty_fintype ι cases nonempty_fintype κ rw [trace_eq_matrix_trace (b.smul c), trace_eq_matrix_trace b, trace_eq_matrix_trace c, Matrix.trace, Matrix.trace, Matrix.trace, ← Finset.univ_product_univ, Finset.sum_product] refine Finset.sum_congr rfl fun i _ ↦ ?_ simp only [AlgHom.map_sum, smul_leftMulMatrix, Finset.sum_apply, Matrix.diag, Finset.sum_apply i (Finset.univ : Finset κ) fun y => leftMulMatrix b (leftMulMatrix c x y y)] #align algebra.trace_trace_of_basis Algebra.trace_trace_of_basis theorem trace_comp_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) : (trace R S).comp ((trace S T).restrictScalars R) = trace R T := by ext rw [LinearMap.comp_apply, LinearMap.restrictScalars_apply, trace_trace_of_basis b c] #align algebra.trace_comp_trace_of_basis Algebra.trace_comp_trace_of_basis @[simp] theorem trace_trace [Algebra K T] [Algebra L T] [IsScalarTower K L T] [FiniteDimensional K L] [FiniteDimensional L T] (x : T) : trace K L (trace L T x) = trace K T x := trace_trace_of_basis (Basis.ofVectorSpace K L) (Basis.ofVectorSpace L T) x #align algebra.trace_trace Algebra.trace_trace @[simp]
Mathlib/RingTheory/Trace.lean
163
165
theorem trace_comp_trace [Algebra K T] [Algebra L T] [IsScalarTower K L T] [FiniteDimensional K L] [FiniteDimensional L T] : (trace K L).comp ((trace L T).restrictScalars K) = trace K T := by
ext; rw [LinearMap.comp_apply, LinearMap.restrictScalars_apply, trace_trace]
2,037
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl #align algebra.trace_eq_matrix_trace Algebra.trace_eq_matrix_trace theorem trace_algebraMap_of_basis (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by haveI := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert Finset.sum_const x simp [-coe_lmul_eq_mul] #align algebra.trace_algebra_map_of_basis Algebra.trace_algebraMap_of_basis @[simp] theorem trace_algebraMap (x : K) : trace K L (algebraMap K L x) = finrank K L • x := by by_cases H : ∃ s : Finset L, Nonempty (Basis s K L) · rw [trace_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] · simp [trace_eq_zero_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis_finset H] #align algebra.trace_algebra_map Algebra.trace_algebraMap theorem trace_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) (x : T) : trace R S (trace S T x) = trace R T x := by haveI := Classical.decEq ι haveI := Classical.decEq κ cases nonempty_fintype ι cases nonempty_fintype κ rw [trace_eq_matrix_trace (b.smul c), trace_eq_matrix_trace b, trace_eq_matrix_trace c, Matrix.trace, Matrix.trace, Matrix.trace, ← Finset.univ_product_univ, Finset.sum_product] refine Finset.sum_congr rfl fun i _ ↦ ?_ simp only [AlgHom.map_sum, smul_leftMulMatrix, Finset.sum_apply, Matrix.diag, Finset.sum_apply i (Finset.univ : Finset κ) fun y => leftMulMatrix b (leftMulMatrix c x y y)] #align algebra.trace_trace_of_basis Algebra.trace_trace_of_basis theorem trace_comp_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) : (trace R S).comp ((trace S T).restrictScalars R) = trace R T := by ext rw [LinearMap.comp_apply, LinearMap.restrictScalars_apply, trace_trace_of_basis b c] #align algebra.trace_comp_trace_of_basis Algebra.trace_comp_trace_of_basis @[simp] theorem trace_trace [Algebra K T] [Algebra L T] [IsScalarTower K L T] [FiniteDimensional K L] [FiniteDimensional L T] (x : T) : trace K L (trace L T x) = trace K T x := trace_trace_of_basis (Basis.ofVectorSpace K L) (Basis.ofVectorSpace L T) x #align algebra.trace_trace Algebra.trace_trace @[simp] theorem trace_comp_trace [Algebra K T] [Algebra L T] [IsScalarTower K L T] [FiniteDimensional K L] [FiniteDimensional L T] : (trace K L).comp ((trace L T).restrictScalars K) = trace K T := by ext; rw [LinearMap.comp_apply, LinearMap.restrictScalars_apply, trace_trace] #align algebra.trace_comp_trace Algebra.trace_comp_trace @[simp]
Mathlib/RingTheory/Trace.lean
169
176
theorem trace_prod_apply [Module.Free R S] [Module.Free R T] [Module.Finite R S] [Module.Finite R T] (x : S × T) : trace R (S × T) x = trace R S x.fst + trace R T x.snd := by
nontriviality R let f := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap have : (lmul R (S × T)).toLinearMap = (prodMapLinear R S T S T R).comp f := LinearMap.ext₂ Prod.mul_def simp_rw [trace, this] exact trace_prodMap' _ _
2,037
import Mathlib.RingTheory.Trace import Mathlib.FieldTheory.Finite.GaloisField #align_import field_theory.finite.trace from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" namespace FiniteField
Mathlib/FieldTheory/Finite/Trace.lean
25
32
theorem trace_to_zmod_nondegenerate (F : Type*) [Field F] [Finite F] [Algebra (ZMod (ringChar F)) F] {a : F} (ha : a ≠ 0) : ∃ b : F, Algebra.trace (ZMod (ringChar F)) F (a * b) ≠ 0 := by
haveI : Fact (ringChar F).Prime := ⟨CharP.char_is_prime F _⟩ have htr := traceForm_nondegenerate (ZMod (ringChar F)) F a simp_rw [Algebra.traceForm_apply] at htr by_contra! hf exact ha (htr hf)
2,038
import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.LinearAlgebra.FreeModule.Finite.Basic import Mathlib.LinearAlgebra.BilinearForm.DualLattice import Mathlib.RingTheory.DedekindDomain.Basic import Mathlib.RingTheory.Localization.Module import Mathlib.RingTheory.Trace #align_import ring_theory.dedekind_domain.integral_closure from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] open scoped nonZeroDivisors Polynomial variable [IsDomain A] section IsIntegralClosure open Algebra variable [Algebra A K] [IsFractionRing A K] variable (L : Type*) [Field L] (C : Type*) [CommRing C] variable [Algebra K L] [Algebra A L] [IsScalarTower A K L] variable [Algebra C L] [IsIntegralClosure C A L] [Algebra A C] [IsScalarTower A C L]
Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean
65
83
theorem IsIntegralClosure.isLocalization [Algebra.IsAlgebraic K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := by
haveI : IsDomain C := (IsIntegralClosure.equiv A C L (integralClosure A L)).toMulEquiv.isDomain (integralClosure A L) haveI : NoZeroSMulDivisors A L := NoZeroSMulDivisors.trans A K L haveI : NoZeroSMulDivisors A C := IsIntegralClosure.noZeroSMulDivisors A L refine ⟨?_, fun z => ?_, fun {x y} h => ⟨1, ?_⟩⟩ · rintro ⟨_, x, hx, rfl⟩ rw [isUnit_iff_ne_zero, map_ne_zero_iff _ (IsIntegralClosure.algebraMap_injective C A L), Subtype.coe_mk, map_ne_zero_iff _ (NoZeroSMulDivisors.algebraMap_injective A C)] exact mem_nonZeroDivisors_iff_ne_zero.mp hx · obtain ⟨m, hm⟩ := IsIntegral.exists_multiple_integral_of_isLocalization A⁰ z (Algebra.IsIntegral.isIntegral (R := K) z) obtain ⟨x, hx⟩ : ∃ x, algebraMap C L x = m • z := IsIntegralClosure.isIntegral_iff.mp hm refine ⟨⟨x, algebraMap A C m, m, SetLike.coe_mem m, rfl⟩, ?_⟩ rw [Subtype.coe_mk, ← IsScalarTower.algebraMap_apply, hx, mul_comm, Submonoid.smul_def, smul_def] · simp only [IsIntegralClosure.algebraMap_injective C A L h]
2,039
import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.LinearAlgebra.FreeModule.Finite.Basic import Mathlib.LinearAlgebra.BilinearForm.DualLattice import Mathlib.RingTheory.DedekindDomain.Basic import Mathlib.RingTheory.Localization.Module import Mathlib.RingTheory.Trace #align_import ring_theory.dedekind_domain.integral_closure from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] open scoped nonZeroDivisors Polynomial variable [IsDomain A] section IsIntegralClosure open Algebra variable [Algebra A K] [IsFractionRing A K] variable (L : Type*) [Field L] (C : Type*) [CommRing C] variable [Algebra K L] [Algebra A L] [IsScalarTower A K L] variable [Algebra C L] [IsIntegralClosure C A L] [Algebra A C] [IsScalarTower A C L] theorem IsIntegralClosure.isLocalization [Algebra.IsAlgebraic K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := by haveI : IsDomain C := (IsIntegralClosure.equiv A C L (integralClosure A L)).toMulEquiv.isDomain (integralClosure A L) haveI : NoZeroSMulDivisors A L := NoZeroSMulDivisors.trans A K L haveI : NoZeroSMulDivisors A C := IsIntegralClosure.noZeroSMulDivisors A L refine ⟨?_, fun z => ?_, fun {x y} h => ⟨1, ?_⟩⟩ · rintro ⟨_, x, hx, rfl⟩ rw [isUnit_iff_ne_zero, map_ne_zero_iff _ (IsIntegralClosure.algebraMap_injective C A L), Subtype.coe_mk, map_ne_zero_iff _ (NoZeroSMulDivisors.algebraMap_injective A C)] exact mem_nonZeroDivisors_iff_ne_zero.mp hx · obtain ⟨m, hm⟩ := IsIntegral.exists_multiple_integral_of_isLocalization A⁰ z (Algebra.IsIntegral.isIntegral (R := K) z) obtain ⟨x, hx⟩ : ∃ x, algebraMap C L x = m • z := IsIntegralClosure.isIntegral_iff.mp hm refine ⟨⟨x, algebraMap A C m, m, SetLike.coe_mem m, rfl⟩, ?_⟩ rw [Subtype.coe_mk, ← IsScalarTower.algebraMap_apply, hx, mul_comm, Submonoid.smul_def, smul_def] · simp only [IsIntegralClosure.algebraMap_injective C A L h] theorem IsIntegralClosure.isLocalization_of_isSeparable [IsSeparable K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := IsIntegralClosure.isLocalization A K L C #align is_integral_closure.is_localization IsIntegralClosure.isLocalization_of_isSeparable variable [FiniteDimensional K L] variable {A K L}
Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean
93
103
theorem IsIntegralClosure.range_le_span_dualBasis [IsSeparable K L] {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι K L) (hb_int : ∀ i, IsIntegral A (b i)) [IsIntegrallyClosed A] : LinearMap.range ((Algebra.linearMap C L).restrictScalars A) ≤ Submodule.span A (Set.range <| (traceForm K L).dualBasis (traceForm_nondegenerate K L) b) := by
rw [← LinearMap.BilinForm.dualSubmodule_span_of_basis, ← LinearMap.BilinForm.le_flip_dualSubmodule, Submodule.span_le] rintro _ ⟨i, rfl⟩ _ ⟨y, rfl⟩ simp only [LinearMap.coe_restrictScalars, linearMap_apply, LinearMap.BilinForm.flip_apply, traceForm_apply] refine IsIntegrallyClosed.isIntegral_iff.mp ?_ exact isIntegral_trace ((IsIntegralClosure.isIntegral A L y).algebraMap.mul (hb_int i))
2,039
import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.LinearAlgebra.FreeModule.Finite.Basic import Mathlib.LinearAlgebra.BilinearForm.DualLattice import Mathlib.RingTheory.DedekindDomain.Basic import Mathlib.RingTheory.Localization.Module import Mathlib.RingTheory.Trace #align_import ring_theory.dedekind_domain.integral_closure from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] open scoped nonZeroDivisors Polynomial variable [IsDomain A] section IsIntegralClosure open Algebra variable [Algebra A K] [IsFractionRing A K] variable (L : Type*) [Field L] (C : Type*) [CommRing C] variable [Algebra K L] [Algebra A L] [IsScalarTower A K L] variable [Algebra C L] [IsIntegralClosure C A L] [Algebra A C] [IsScalarTower A C L] theorem IsIntegralClosure.isLocalization [Algebra.IsAlgebraic K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := by haveI : IsDomain C := (IsIntegralClosure.equiv A C L (integralClosure A L)).toMulEquiv.isDomain (integralClosure A L) haveI : NoZeroSMulDivisors A L := NoZeroSMulDivisors.trans A K L haveI : NoZeroSMulDivisors A C := IsIntegralClosure.noZeroSMulDivisors A L refine ⟨?_, fun z => ?_, fun {x y} h => ⟨1, ?_⟩⟩ · rintro ⟨_, x, hx, rfl⟩ rw [isUnit_iff_ne_zero, map_ne_zero_iff _ (IsIntegralClosure.algebraMap_injective C A L), Subtype.coe_mk, map_ne_zero_iff _ (NoZeroSMulDivisors.algebraMap_injective A C)] exact mem_nonZeroDivisors_iff_ne_zero.mp hx · obtain ⟨m, hm⟩ := IsIntegral.exists_multiple_integral_of_isLocalization A⁰ z (Algebra.IsIntegral.isIntegral (R := K) z) obtain ⟨x, hx⟩ : ∃ x, algebraMap C L x = m • z := IsIntegralClosure.isIntegral_iff.mp hm refine ⟨⟨x, algebraMap A C m, m, SetLike.coe_mem m, rfl⟩, ?_⟩ rw [Subtype.coe_mk, ← IsScalarTower.algebraMap_apply, hx, mul_comm, Submonoid.smul_def, smul_def] · simp only [IsIntegralClosure.algebraMap_injective C A L h] theorem IsIntegralClosure.isLocalization_of_isSeparable [IsSeparable K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := IsIntegralClosure.isLocalization A K L C #align is_integral_closure.is_localization IsIntegralClosure.isLocalization_of_isSeparable variable [FiniteDimensional K L] variable {A K L} theorem IsIntegralClosure.range_le_span_dualBasis [IsSeparable K L] {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι K L) (hb_int : ∀ i, IsIntegral A (b i)) [IsIntegrallyClosed A] : LinearMap.range ((Algebra.linearMap C L).restrictScalars A) ≤ Submodule.span A (Set.range <| (traceForm K L).dualBasis (traceForm_nondegenerate K L) b) := by rw [← LinearMap.BilinForm.dualSubmodule_span_of_basis, ← LinearMap.BilinForm.le_flip_dualSubmodule, Submodule.span_le] rintro _ ⟨i, rfl⟩ _ ⟨y, rfl⟩ simp only [LinearMap.coe_restrictScalars, linearMap_apply, LinearMap.BilinForm.flip_apply, traceForm_apply] refine IsIntegrallyClosed.isIntegral_iff.mp ?_ exact isIntegral_trace ((IsIntegralClosure.isIntegral A L y).algebraMap.mul (hb_int i)) #align is_integral_closure.range_le_span_dual_basis IsIntegralClosure.range_le_span_dualBasis
Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean
106
112
theorem integralClosure_le_span_dualBasis [IsSeparable K L] {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι K L) (hb_int : ∀ i, IsIntegral A (b i)) [IsIntegrallyClosed A] : Subalgebra.toSubmodule (integralClosure A L) ≤ Submodule.span A (Set.range <| (traceForm K L).dualBasis (traceForm_nondegenerate K L) b) := by
refine le_trans ?_ (IsIntegralClosure.range_le_span_dualBasis (integralClosure A L) b hb_int) intro x hx exact ⟨⟨x, hx⟩, rfl⟩
2,039
import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.LinearAlgebra.FreeModule.Finite.Basic import Mathlib.LinearAlgebra.BilinearForm.DualLattice import Mathlib.RingTheory.DedekindDomain.Basic import Mathlib.RingTheory.Localization.Module import Mathlib.RingTheory.Trace #align_import ring_theory.dedekind_domain.integral_closure from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] open scoped nonZeroDivisors Polynomial variable [IsDomain A] section IsIntegralClosure open Algebra variable [Algebra A K] [IsFractionRing A K] variable (L : Type*) [Field L] (C : Type*) [CommRing C] variable [Algebra K L] [Algebra A L] [IsScalarTower A K L] variable [Algebra C L] [IsIntegralClosure C A L] [Algebra A C] [IsScalarTower A C L] theorem IsIntegralClosure.isLocalization [Algebra.IsAlgebraic K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := by haveI : IsDomain C := (IsIntegralClosure.equiv A C L (integralClosure A L)).toMulEquiv.isDomain (integralClosure A L) haveI : NoZeroSMulDivisors A L := NoZeroSMulDivisors.trans A K L haveI : NoZeroSMulDivisors A C := IsIntegralClosure.noZeroSMulDivisors A L refine ⟨?_, fun z => ?_, fun {x y} h => ⟨1, ?_⟩⟩ · rintro ⟨_, x, hx, rfl⟩ rw [isUnit_iff_ne_zero, map_ne_zero_iff _ (IsIntegralClosure.algebraMap_injective C A L), Subtype.coe_mk, map_ne_zero_iff _ (NoZeroSMulDivisors.algebraMap_injective A C)] exact mem_nonZeroDivisors_iff_ne_zero.mp hx · obtain ⟨m, hm⟩ := IsIntegral.exists_multiple_integral_of_isLocalization A⁰ z (Algebra.IsIntegral.isIntegral (R := K) z) obtain ⟨x, hx⟩ : ∃ x, algebraMap C L x = m • z := IsIntegralClosure.isIntegral_iff.mp hm refine ⟨⟨x, algebraMap A C m, m, SetLike.coe_mem m, rfl⟩, ?_⟩ rw [Subtype.coe_mk, ← IsScalarTower.algebraMap_apply, hx, mul_comm, Submonoid.smul_def, smul_def] · simp only [IsIntegralClosure.algebraMap_injective C A L h] theorem IsIntegralClosure.isLocalization_of_isSeparable [IsSeparable K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := IsIntegralClosure.isLocalization A K L C #align is_integral_closure.is_localization IsIntegralClosure.isLocalization_of_isSeparable variable [FiniteDimensional K L] variable {A K L} theorem IsIntegralClosure.range_le_span_dualBasis [IsSeparable K L] {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι K L) (hb_int : ∀ i, IsIntegral A (b i)) [IsIntegrallyClosed A] : LinearMap.range ((Algebra.linearMap C L).restrictScalars A) ≤ Submodule.span A (Set.range <| (traceForm K L).dualBasis (traceForm_nondegenerate K L) b) := by rw [← LinearMap.BilinForm.dualSubmodule_span_of_basis, ← LinearMap.BilinForm.le_flip_dualSubmodule, Submodule.span_le] rintro _ ⟨i, rfl⟩ _ ⟨y, rfl⟩ simp only [LinearMap.coe_restrictScalars, linearMap_apply, LinearMap.BilinForm.flip_apply, traceForm_apply] refine IsIntegrallyClosed.isIntegral_iff.mp ?_ exact isIntegral_trace ((IsIntegralClosure.isIntegral A L y).algebraMap.mul (hb_int i)) #align is_integral_closure.range_le_span_dual_basis IsIntegralClosure.range_le_span_dualBasis theorem integralClosure_le_span_dualBasis [IsSeparable K L] {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι K L) (hb_int : ∀ i, IsIntegral A (b i)) [IsIntegrallyClosed A] : Subalgebra.toSubmodule (integralClosure A L) ≤ Submodule.span A (Set.range <| (traceForm K L).dualBasis (traceForm_nondegenerate K L) b) := by refine le_trans ?_ (IsIntegralClosure.range_le_span_dualBasis (integralClosure A L) b hb_int) intro x hx exact ⟨⟨x, hx⟩, rfl⟩ #align integral_closure_le_span_dual_basis integralClosure_le_span_dualBasis variable (A K)
Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean
119
138
theorem exists_integral_multiples (s : Finset L) : ∃ y ≠ (0 : A), ∀ x ∈ s, IsIntegral A (y • x) := by
haveI := Classical.decEq L refine s.induction ?_ ?_ · use 1, one_ne_zero rintro x ⟨⟩ · rintro x s hx ⟨y, hy, hs⟩ have := exists_integral_multiple ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x)) ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_) · rcases this with ⟨x', y', hy', hx'⟩ refine ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => ?_⟩ rcases Finset.mem_insert.mp hx'' with (rfl | hx'') · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx'] exact isIntegral_algebraMap.mul x'.2 · rw [mul_comm, mul_smul, Algebra.smul_def] exact isIntegral_algebraMap.mul (hs _ hx'') · rw [IsScalarTower.algebraMap_eq A K L] apply (algebraMap K L).injective.comp exact IsFractionRing.injective _ _
2,039
import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.LinearAlgebra.FreeModule.Finite.Basic import Mathlib.LinearAlgebra.BilinearForm.DualLattice import Mathlib.RingTheory.DedekindDomain.Basic import Mathlib.RingTheory.Localization.Module import Mathlib.RingTheory.Trace #align_import ring_theory.dedekind_domain.integral_closure from "leanprover-community/mathlib"@"4cf7ca0e69e048b006674cf4499e5c7d296a89e0" variable (R A K : Type*) [CommRing R] [CommRing A] [Field K] open scoped nonZeroDivisors Polynomial variable [IsDomain A] section IsIntegralClosure open Algebra variable [Algebra A K] [IsFractionRing A K] variable (L : Type*) [Field L] (C : Type*) [CommRing C] variable [Algebra K L] [Algebra A L] [IsScalarTower A K L] variable [Algebra C L] [IsIntegralClosure C A L] [Algebra A C] [IsScalarTower A C L] theorem IsIntegralClosure.isLocalization [Algebra.IsAlgebraic K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := by haveI : IsDomain C := (IsIntegralClosure.equiv A C L (integralClosure A L)).toMulEquiv.isDomain (integralClosure A L) haveI : NoZeroSMulDivisors A L := NoZeroSMulDivisors.trans A K L haveI : NoZeroSMulDivisors A C := IsIntegralClosure.noZeroSMulDivisors A L refine ⟨?_, fun z => ?_, fun {x y} h => ⟨1, ?_⟩⟩ · rintro ⟨_, x, hx, rfl⟩ rw [isUnit_iff_ne_zero, map_ne_zero_iff _ (IsIntegralClosure.algebraMap_injective C A L), Subtype.coe_mk, map_ne_zero_iff _ (NoZeroSMulDivisors.algebraMap_injective A C)] exact mem_nonZeroDivisors_iff_ne_zero.mp hx · obtain ⟨m, hm⟩ := IsIntegral.exists_multiple_integral_of_isLocalization A⁰ z (Algebra.IsIntegral.isIntegral (R := K) z) obtain ⟨x, hx⟩ : ∃ x, algebraMap C L x = m • z := IsIntegralClosure.isIntegral_iff.mp hm refine ⟨⟨x, algebraMap A C m, m, SetLike.coe_mem m, rfl⟩, ?_⟩ rw [Subtype.coe_mk, ← IsScalarTower.algebraMap_apply, hx, mul_comm, Submonoid.smul_def, smul_def] · simp only [IsIntegralClosure.algebraMap_injective C A L h] theorem IsIntegralClosure.isLocalization_of_isSeparable [IsSeparable K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := IsIntegralClosure.isLocalization A K L C #align is_integral_closure.is_localization IsIntegralClosure.isLocalization_of_isSeparable variable [FiniteDimensional K L] variable {A K L} theorem IsIntegralClosure.range_le_span_dualBasis [IsSeparable K L] {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι K L) (hb_int : ∀ i, IsIntegral A (b i)) [IsIntegrallyClosed A] : LinearMap.range ((Algebra.linearMap C L).restrictScalars A) ≤ Submodule.span A (Set.range <| (traceForm K L).dualBasis (traceForm_nondegenerate K L) b) := by rw [← LinearMap.BilinForm.dualSubmodule_span_of_basis, ← LinearMap.BilinForm.le_flip_dualSubmodule, Submodule.span_le] rintro _ ⟨i, rfl⟩ _ ⟨y, rfl⟩ simp only [LinearMap.coe_restrictScalars, linearMap_apply, LinearMap.BilinForm.flip_apply, traceForm_apply] refine IsIntegrallyClosed.isIntegral_iff.mp ?_ exact isIntegral_trace ((IsIntegralClosure.isIntegral A L y).algebraMap.mul (hb_int i)) #align is_integral_closure.range_le_span_dual_basis IsIntegralClosure.range_le_span_dualBasis theorem integralClosure_le_span_dualBasis [IsSeparable K L] {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι K L) (hb_int : ∀ i, IsIntegral A (b i)) [IsIntegrallyClosed A] : Subalgebra.toSubmodule (integralClosure A L) ≤ Submodule.span A (Set.range <| (traceForm K L).dualBasis (traceForm_nondegenerate K L) b) := by refine le_trans ?_ (IsIntegralClosure.range_le_span_dualBasis (integralClosure A L) b hb_int) intro x hx exact ⟨⟨x, hx⟩, rfl⟩ #align integral_closure_le_span_dual_basis integralClosure_le_span_dualBasis variable (A K) theorem exists_integral_multiples (s : Finset L) : ∃ y ≠ (0 : A), ∀ x ∈ s, IsIntegral A (y • x) := by haveI := Classical.decEq L refine s.induction ?_ ?_ · use 1, one_ne_zero rintro x ⟨⟩ · rintro x s hx ⟨y, hy, hs⟩ have := exists_integral_multiple ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x)) ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_) · rcases this with ⟨x', y', hy', hx'⟩ refine ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => ?_⟩ rcases Finset.mem_insert.mp hx'' with (rfl | hx'') · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx'] exact isIntegral_algebraMap.mul x'.2 · rw [mul_comm, mul_smul, Algebra.smul_def] exact isIntegral_algebraMap.mul (hs _ hx'') · rw [IsScalarTower.algebraMap_eq A K L] apply (algebraMap K L).injective.comp exact IsFractionRing.injective _ _ #align exists_integral_multiples exists_integral_multiples variable (L)
Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean
145
167
theorem FiniteDimensional.exists_is_basis_integral : ∃ (s : Finset L) (b : Basis s K L), ∀ x, IsIntegral A (b x) := by
letI := Classical.decEq L letI : IsNoetherian K L := IsNoetherian.iff_fg.2 inferInstance let s' := IsNoetherian.finsetBasisIndex K L let bs' := IsNoetherian.finsetBasis K L obtain ⟨y, hy, his'⟩ := exists_integral_multiples A K (Finset.univ.image bs') have hy' : algebraMap A L y ≠ 0 := by refine mt ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_ _) hy rw [IsScalarTower.algebraMap_eq A K L] exact (algebraMap K L).injective.comp (IsFractionRing.injective A K) refine ⟨s', bs'.map {Algebra.lmul _ _ (algebraMap A L y) with toFun := fun x => algebraMap A L y * x invFun := fun x => (algebraMap A L y)⁻¹ * x left_inv := ?_ right_inv := ?_}, ?_⟩ · intro x; simp only [inv_mul_cancel_left₀ hy'] · intro x; simp only [mul_inv_cancel_left₀ hy'] · rintro ⟨x', hx'⟩ simp only [Algebra.smul_def, Finset.mem_image, exists_prop, Finset.mem_univ, true_and_iff] at his' simp only [Basis.map_apply, LinearEquiv.coe_mk] exact his' _ ⟨_, rfl⟩
2,039
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected`
Mathlib/NumberTheory/FunctionField.lean
62
80
theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by
let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : ∀ (c) (x : F), e c • x = c • x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) · let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply]
2,040
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : ∀ (c) (x : F), e c • x = c • x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) · let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff
Mathlib/NumberTheory/FunctionField.lean
83
86
theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by
rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq))
2,040
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : ∀ (c) (x : F), e c • x = c • x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) · let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers namespace ringOfIntegers variable [Algebra Fq[X] F] instance : IsDomain (ringOfIntegers Fq F) := (ringOfIntegers Fq F).isDomain instance : IsIntegralClosure (ringOfIntegers Fq F) Fq[X] F := integralClosure.isIntegralClosure _ _ variable [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F]
Mathlib/NumberTheory/FunctionField.lean
113
121
theorem algebraMap_injective : Function.Injective (⇑(algebraMap Fq[X] (ringOfIntegers Fq F))) := by
have hinj : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) rw [injective_iff_map_eq_zero (algebraMap Fq[X] (↥(ringOfIntegers Fq F)))] intro p hp rw [← Subtype.coe_inj, Subalgebra.coe_zero] at hp rw [injective_iff_map_eq_zero (algebraMap Fq[X] F)] at hinj exact hinj p hp
2,040
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : ∀ (c) (x : F), e c • x = c • x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) · let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers namespace ringOfIntegers variable [Algebra Fq[X] F] instance : IsDomain (ringOfIntegers Fq F) := (ringOfIntegers Fq F).isDomain instance : IsIntegralClosure (ringOfIntegers Fq F) Fq[X] F := integralClosure.isIntegralClosure _ _ variable [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] theorem algebraMap_injective : Function.Injective (⇑(algebraMap Fq[X] (ringOfIntegers Fq F))) := by have hinj : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) rw [injective_iff_map_eq_zero (algebraMap Fq[X] (↥(ringOfIntegers Fq F)))] intro p hp rw [← Subtype.coe_inj, Subalgebra.coe_zero] at hp rw [injective_iff_map_eq_zero (algebraMap Fq[X] F)] at hinj exact hinj p hp #align function_field.ring_of_integers.algebra_map_injective FunctionField.ringOfIntegers.algebraMap_injective
Mathlib/NumberTheory/FunctionField.lean
124
127
theorem not_isField : ¬IsField (ringOfIntegers Fq F) := by
simpa [← (IsIntegralClosure.isIntegral_algebra Fq[X] F).isField_iff_isField (algebraMap_injective Fq F)] using Polynomial.not_isField Fq
2,040
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : ∀ (c) (x : F), e c • x = c • x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) · let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers section InftyValuation variable [DecidableEq (RatFunc Fq)] def inftyValuationDef (r : RatFunc Fq) : ℤₘ₀ := if r = 0 then 0 else ↑(Multiplicative.ofAdd r.intDegree) #align function_field.infty_valuation_def FunctionField.inftyValuationDef theorem InftyValuation.map_zero' : inftyValuationDef Fq 0 = 0 := if_pos rfl #align function_field.infty_valuation.map_zero' FunctionField.InftyValuation.map_zero' theorem InftyValuation.map_one' : inftyValuationDef Fq 1 = 1 := (if_neg one_ne_zero).trans <| by rw [RatFunc.intDegree_one, ofAdd_zero, WithZero.coe_one] #align function_field.infty_valuation.map_one' FunctionField.InftyValuation.map_one'
Mathlib/NumberTheory/FunctionField.lean
168
176
theorem InftyValuation.map_mul' (x y : RatFunc Fq) : inftyValuationDef Fq (x * y) = inftyValuationDef Fq x * inftyValuationDef Fq y := by
rw [inftyValuationDef, inftyValuationDef, inftyValuationDef] by_cases hx : x = 0 · rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul] · by_cases hy : y = 0 · rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero] · rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ← ofAdd_add, RatFunc.intDegree_mul hx hy]
2,040
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : ∀ (c) (x : F), e c • x = c • x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) · let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers section InftyValuation variable [DecidableEq (RatFunc Fq)] def inftyValuationDef (r : RatFunc Fq) : ℤₘ₀ := if r = 0 then 0 else ↑(Multiplicative.ofAdd r.intDegree) #align function_field.infty_valuation_def FunctionField.inftyValuationDef theorem InftyValuation.map_zero' : inftyValuationDef Fq 0 = 0 := if_pos rfl #align function_field.infty_valuation.map_zero' FunctionField.InftyValuation.map_zero' theorem InftyValuation.map_one' : inftyValuationDef Fq 1 = 1 := (if_neg one_ne_zero).trans <| by rw [RatFunc.intDegree_one, ofAdd_zero, WithZero.coe_one] #align function_field.infty_valuation.map_one' FunctionField.InftyValuation.map_one' theorem InftyValuation.map_mul' (x y : RatFunc Fq) : inftyValuationDef Fq (x * y) = inftyValuationDef Fq x * inftyValuationDef Fq y := by rw [inftyValuationDef, inftyValuationDef, inftyValuationDef] by_cases hx : x = 0 · rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul] · by_cases hy : y = 0 · rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero] · rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ← ofAdd_add, RatFunc.intDegree_mul hx hy] #align function_field.infty_valuation.map_mul' FunctionField.InftyValuation.map_mul'
Mathlib/NumberTheory/FunctionField.lean
179
195
theorem InftyValuation.map_add_le_max' (x y : RatFunc Fq) : inftyValuationDef Fq (x + y) ≤ max (inftyValuationDef Fq x) (inftyValuationDef Fq y) := by
by_cases hx : x = 0 · rw [hx, zero_add] conv_rhs => rw [inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq y))] · by_cases hy : y = 0 · rw [hy, add_zero] conv_rhs => rw [max_comm, inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq x))] · by_cases hxy : x + y = 0 · rw [inftyValuationDef, if_pos hxy]; exact zero_le' · rw [inftyValuationDef, inftyValuationDef, inftyValuationDef, if_neg hx, if_neg hy, if_neg hxy] rw [le_max_iff, WithZero.coe_le_coe, Multiplicative.ofAdd_le, WithZero.coe_le_coe, Multiplicative.ofAdd_le, ← le_max_iff] exact RatFunc.intDegree_add_le hy hxy
2,040
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : ∀ (c) (x : F), e c • x = c • x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h · let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) · let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers section InftyValuation variable [DecidableEq (RatFunc Fq)] def inftyValuationDef (r : RatFunc Fq) : ℤₘ₀ := if r = 0 then 0 else ↑(Multiplicative.ofAdd r.intDegree) #align function_field.infty_valuation_def FunctionField.inftyValuationDef theorem InftyValuation.map_zero' : inftyValuationDef Fq 0 = 0 := if_pos rfl #align function_field.infty_valuation.map_zero' FunctionField.InftyValuation.map_zero' theorem InftyValuation.map_one' : inftyValuationDef Fq 1 = 1 := (if_neg one_ne_zero).trans <| by rw [RatFunc.intDegree_one, ofAdd_zero, WithZero.coe_one] #align function_field.infty_valuation.map_one' FunctionField.InftyValuation.map_one' theorem InftyValuation.map_mul' (x y : RatFunc Fq) : inftyValuationDef Fq (x * y) = inftyValuationDef Fq x * inftyValuationDef Fq y := by rw [inftyValuationDef, inftyValuationDef, inftyValuationDef] by_cases hx : x = 0 · rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul] · by_cases hy : y = 0 · rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero] · rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ← ofAdd_add, RatFunc.intDegree_mul hx hy] #align function_field.infty_valuation.map_mul' FunctionField.InftyValuation.map_mul' theorem InftyValuation.map_add_le_max' (x y : RatFunc Fq) : inftyValuationDef Fq (x + y) ≤ max (inftyValuationDef Fq x) (inftyValuationDef Fq y) := by by_cases hx : x = 0 · rw [hx, zero_add] conv_rhs => rw [inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq y))] · by_cases hy : y = 0 · rw [hy, add_zero] conv_rhs => rw [max_comm, inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq x))] · by_cases hxy : x + y = 0 · rw [inftyValuationDef, if_pos hxy]; exact zero_le' · rw [inftyValuationDef, inftyValuationDef, inftyValuationDef, if_neg hx, if_neg hy, if_neg hxy] rw [le_max_iff, WithZero.coe_le_coe, Multiplicative.ofAdd_le, WithZero.coe_le_coe, Multiplicative.ofAdd_le, ← le_max_iff] exact RatFunc.intDegree_add_le hy hxy #align function_field.infty_valuation.map_add_le_max' FunctionField.InftyValuation.map_add_le_max' @[simp]
Mathlib/NumberTheory/FunctionField.lean
199
201
theorem inftyValuation_of_nonzero {x : RatFunc Fq} (hx : x ≠ 0) : inftyValuationDef Fq x = Multiplicative.ofAdd x.intDegree := by
rw [inftyValuationDef, if_neg hx]
2,040
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] class IsSepClosed : Prop where splits_of_separable : ∀ p : k[X], p.Separable → (p.Splits <| RingHom.id k) instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K}
Mathlib/FieldTheory/IsSepClosed.lean
78
80
theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by
convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff]
2,041
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] class IsSepClosed : Prop where splits_of_separable : ∀ p : k[X], p.Separable → (p.Splits <| RingHom.id k) instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp variable (k) in instance (priority := 100) isAlgClosed_of_perfectField [IsSepClosed k] [PerfectField k] : IsAlgClosed k := IsAlgClosed.of_exists_root k fun p _ h ↦ exists_root p ((degree_pos_of_irreducible h).ne') (PerfectField.separable_of_irreducible h)
Mathlib/FieldTheory/IsSepClosed.lean
104
116
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] : ∃ z, z ^ n = x := by
have hn' : 0 < n := Nat.pos_of_ne_zero fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 · exact ⟨0, by rw [hx, pow_eq_zero_iff hn'.ne']⟩ · obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz
2,041
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] class IsSepClosed : Prop where splits_of_separable : ∀ p : k[X], p.Separable → (p.Splits <| RingHom.id k) instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp variable (k) in instance (priority := 100) isAlgClosed_of_perfectField [IsSepClosed k] [PerfectField k] : IsAlgClosed k := IsAlgClosed.of_exists_root k fun p _ h ↦ exists_root p ((degree_pos_of_irreducible h).ne') (PerfectField.separable_of_irreducible h) theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] : ∃ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 · exact ⟨0, by rw [hx, pow_eq_zero_iff hn'.ne']⟩ · obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz
Mathlib/FieldTheory/IsSepClosed.lean
118
120
theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : ∃ z, x = z * z := by
rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩
2,041
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] class IsSepClosed : Prop where splits_of_separable : ∀ p : k[X], p.Separable → (p.Splits <| RingHom.id k) instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp variable (k) in instance (priority := 100) isAlgClosed_of_perfectField [IsSepClosed k] [PerfectField k] : IsAlgClosed k := IsAlgClosed.of_exists_root k fun p _ h ↦ exists_root p ((degree_pos_of_irreducible h).ne') (PerfectField.separable_of_irreducible h) theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] : ∃ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 · exact ⟨0, by rw [hx, pow_eq_zero_iff hn'.ne']⟩ · obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : ∃ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩
Mathlib/FieldTheory/IsSepClosed.lean
122
129
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by
refine ⟨fun h => ?_, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd · exact eq_C_of_degree_le_zero hd · obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz
2,041
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] class IsSepClosed : Prop where splits_of_separable : ∀ p : k[X], p.Separable → (p.Splits <| RingHom.id k) instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp variable (k) in instance (priority := 100) isAlgClosed_of_perfectField [IsSepClosed k] [PerfectField k] : IsAlgClosed k := IsAlgClosed.of_exists_root k fun p _ h ↦ exists_root p ((degree_pos_of_irreducible h).ne') (PerfectField.separable_of_irreducible h) theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] : ∃ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 · exact ⟨0, by rw [hx, pow_eq_zero_iff hn'.ne']⟩ · obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : ∃ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine ⟨fun h => ?_, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd · exact eq_C_of_degree_le_zero hd · obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_eval₂_eq_zero [IsSepClosed K] (f : k →+* K) (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, p.eval₂ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [eval₂_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x : K, aeval x p = 0 := exists_eval₂_eq_zero (algebraMap k K) p hp hsep variable (k) {K}
Mathlib/FieldTheory/IsSepClosed.lean
146
160
theorem of_exists_root (H : ∀ p : k[X], p.Monic → Irreducible p → Separable p → ∃ x, p.eval x = 0) : IsSepClosed k := by
refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero ▸ degree_eq_one_of_irreducible_of_root hirr' hx
2,041
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois universe u v w open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] class IsSepClosed : Prop where splits_of_separable : ∀ p : k[X], p.Separable → (p.Splits <| RingHom.id k) instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k →+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp variable (k) in instance (priority := 100) isAlgClosed_of_perfectField [IsSepClosed k] [PerfectField k] : IsAlgClosed k := IsAlgClosed.of_exists_root k fun p _ h ↦ exists_root p ((degree_pos_of_irreducible h).ne') (PerfectField.separable_of_irreducible h) theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] : ∃ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) ≠ 0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 · exact ⟨0, by rw [hx, pow_eq_zero_iff hn'.ne']⟩ · obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : ∃ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine ⟨fun h => ?_, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd · exact eq_C_of_degree_le_zero hd · obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_eval₂_eq_zero [IsSepClosed K] (f : k →+* K) (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x, p.eval₂ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [eval₂_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree ≠ 0) (hsep : p.Separable) : ∃ x : K, aeval x p = 0 := exists_eval₂_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : ∀ p : k[X], p.Monic → Irreducible p → Separable p → ∃ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero ▸ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable (K)
Mathlib/FieldTheory/IsSepClosed.lean
168
179
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by
refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep have : aeval x (minpoly k x) = 0 := minpoly.aeval k x rw [eq_X_add_C_of_degree_eq_one h, hq, C_1, one_mul, aeval_add, aeval_X, aeval_C, add_eq_zero_iff_eq_neg] at this exact (RingHom.map_neg (algebraMap k K) ((minpoly k x).coeff 0)).symm ▸ this.symm
2,041
import Mathlib.FieldTheory.SeparableDegree import Mathlib.FieldTheory.IsSepClosed open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section separableClosure def separableClosure : IntermediateField F E where carrier := {x | (minpoly F x).Separable} mul_mem' := separable_mul add_mem' := separable_add algebraMap_mem' := separable_algebraMap E inv_mem' := separable_inv variable {F E K} theorem mem_separableClosure_iff {x : E} : x ∈ separableClosure F E ↔ (minpoly F x).Separable := Iff.rfl
Mathlib/FieldTheory/SeparableClosure.lean
94
96
theorem map_mem_separableClosure_iff (i : E →ₐ[F] K) {x : E} : i x ∈ separableClosure F K ↔ x ∈ separableClosure F E := by
simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective]
2,042
import Mathlib.FieldTheory.SeparableDegree import Mathlib.FieldTheory.IsSepClosed open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section separableClosure def separableClosure : IntermediateField F E where carrier := {x | (minpoly F x).Separable} mul_mem' := separable_mul add_mem' := separable_add algebraMap_mem' := separable_algebraMap E inv_mem' := separable_inv variable {F E K} theorem mem_separableClosure_iff {x : E} : x ∈ separableClosure F E ↔ (minpoly F x).Separable := Iff.rfl theorem map_mem_separableClosure_iff (i : E →ₐ[F] K) {x : E} : i x ∈ separableClosure F K ↔ x ∈ separableClosure F E := by simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective]
Mathlib/FieldTheory/SeparableClosure.lean
100
103
theorem separableClosure.comap_eq_of_algHom (i : E →ₐ[F] K) : (separableClosure F K).comap i = separableClosure F E := by
ext x exact map_mem_separableClosure_iff i
2,042
import Mathlib.FieldTheory.SeparableDegree import Mathlib.FieldTheory.IsSepClosed open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section separableClosure def separableClosure : IntermediateField F E where carrier := {x | (minpoly F x).Separable} mul_mem' := separable_mul add_mem' := separable_add algebraMap_mem' := separable_algebraMap E inv_mem' := separable_inv variable {F E K} theorem mem_separableClosure_iff {x : E} : x ∈ separableClosure F E ↔ (minpoly F x).Separable := Iff.rfl theorem map_mem_separableClosure_iff (i : E →ₐ[F] K) {x : E} : i x ∈ separableClosure F K ↔ x ∈ separableClosure F E := by simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective] theorem separableClosure.comap_eq_of_algHom (i : E →ₐ[F] K) : (separableClosure F K).comap i = separableClosure F E := by ext x exact map_mem_separableClosure_iff i theorem separableClosure.map_le_of_algHom (i : E →ₐ[F] K) : (separableClosure F E).map i ≤ separableClosure F K := map_le_iff_le_comap.2 (comap_eq_of_algHom i).ge variable (F) in
Mathlib/FieldTheory/SeparableClosure.lean
115
121
theorem separableClosure.map_eq_of_separableClosure_eq_bot [Algebra E K] [IsScalarTower F E K] (h : separableClosure E K = ⊥) : (separableClosure F E).map (IsScalarTower.toAlgHom F E K) = separableClosure F K := by
refine le_antisymm (map_le_of_algHom _) (fun x hx ↦ ?_) obtain ⟨y, rfl⟩ := mem_bot.1 <| h ▸ mem_separableClosure_iff.2 (mem_separableClosure_iff.1 hx |>.map_minpoly E) exact ⟨y, (map_mem_separableClosure_iff <| IsScalarTower.toAlgHom F E K).mp hx, rfl⟩
2,042
import Mathlib.FieldTheory.SeparableDegree import Mathlib.FieldTheory.IsSepClosed open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section separableClosure def separableClosure : IntermediateField F E where carrier := {x | (minpoly F x).Separable} mul_mem' := separable_mul add_mem' := separable_add algebraMap_mem' := separable_algebraMap E inv_mem' := separable_inv variable {F E K} theorem mem_separableClosure_iff {x : E} : x ∈ separableClosure F E ↔ (minpoly F x).Separable := Iff.rfl theorem map_mem_separableClosure_iff (i : E →ₐ[F] K) {x : E} : i x ∈ separableClosure F K ↔ x ∈ separableClosure F E := by simp_rw [mem_separableClosure_iff, minpoly.algHom_eq i i.injective] theorem separableClosure.comap_eq_of_algHom (i : E →ₐ[F] K) : (separableClosure F K).comap i = separableClosure F E := by ext x exact map_mem_separableClosure_iff i theorem separableClosure.map_le_of_algHom (i : E →ₐ[F] K) : (separableClosure F E).map i ≤ separableClosure F K := map_le_iff_le_comap.2 (comap_eq_of_algHom i).ge variable (F) in theorem separableClosure.map_eq_of_separableClosure_eq_bot [Algebra E K] [IsScalarTower F E K] (h : separableClosure E K = ⊥) : (separableClosure F E).map (IsScalarTower.toAlgHom F E K) = separableClosure F K := by refine le_antisymm (map_le_of_algHom _) (fun x hx ↦ ?_) obtain ⟨y, rfl⟩ := mem_bot.1 <| h ▸ mem_separableClosure_iff.2 (mem_separableClosure_iff.1 hx |>.map_minpoly E) exact ⟨y, (map_mem_separableClosure_iff <| IsScalarTower.toAlgHom F E K).mp hx, rfl⟩ theorem separableClosure.map_eq_of_algEquiv (i : E ≃ₐ[F] K) : (separableClosure F E).map i = separableClosure F K := (map_le_of_algHom i.toAlgHom).antisymm (fun x h ↦ ⟨_, (map_mem_separableClosure_iff i.symm).2 h, by simp⟩) def separableClosure.algEquivOfAlgEquiv (i : E ≃ₐ[F] K) : separableClosure F E ≃ₐ[F] separableClosure F K := (intermediateFieldMap i _).trans (equivOfEq (map_eq_of_algEquiv i)) alias AlgEquiv.separableClosure := separableClosure.algEquivOfAlgEquiv variable (F E K) instance separableClosure.isAlgebraic : Algebra.IsAlgebraic F (separableClosure F E) := ⟨fun x ↦ isAlgebraic_iff.2 x.2.isIntegral.isAlgebraic⟩ instance separableClosure.isSeparable : IsSeparable F (separableClosure F E) := ⟨fun x ↦ by simpa only [minpoly_eq] using x.2⟩ theorem le_separableClosure' {L : IntermediateField F E} (hs : ∀ x : L, (minpoly F x).Separable) : L ≤ separableClosure F E := fun x h ↦ by simpa only [minpoly_eq] using hs ⟨x, h⟩ theorem le_separableClosure (L : IntermediateField F E) [IsSeparable F L] : L ≤ separableClosure F E := le_separableClosure' F E (IsSeparable.separable F) theorem le_separableClosure_iff (L : IntermediateField F E) : L ≤ separableClosure F E ↔ IsSeparable F L := ⟨fun h ↦ ⟨fun x ↦ by simpa only [minpoly_eq] using h x.2⟩, fun _ ↦ le_separableClosure _ _ _⟩ theorem separableClosure.separableClosure_eq_bot : separableClosure (separableClosure F E) E = ⊥ := bot_unique fun x hx ↦ mem_bot.2 ⟨⟨x, mem_separableClosure_iff.1 hx |>.comap_minpoly_of_isSeparable F⟩, rfl⟩ theorem separableClosure.normalClosure_eq_self : normalClosure F (separableClosure F E) E = separableClosure F E := le_antisymm (normalClosure_le_iff.2 fun i ↦ haveI : IsSeparable F i.fieldRange := (AlgEquiv.ofInjectiveField i).isSeparable le_separableClosure F E _) (le_normalClosure _) instance separableClosure.isGalois [Normal F E] : IsGalois F (separableClosure F E) where to_isSeparable := separableClosure.isSeparable F E to_normal := by rw [← separableClosure.normalClosure_eq_self] exact normalClosure.normal F _ E
Mathlib/FieldTheory/SeparableClosure.lean
186
192
theorem IsSepClosed.separableClosure_eq_bot_iff [IsSepClosed E] : separableClosure F E = ⊥ ↔ IsSepClosed F := by
refine ⟨fun h ↦ IsSepClosed.of_exists_root _ fun p _ hirr hsep ↦ ?_, fun _ ↦ IntermediateField.eq_bot_of_isSepClosed_of_isSeparable _⟩ obtain ⟨x, hx⟩ := IsSepClosed.exists_aeval_eq_zero E p (degree_pos_of_irreducible hirr).ne' hsep obtain ⟨x, rfl⟩ := h ▸ mem_separableClosure_iff.2 (hsep.of_dvd <| minpoly.dvd _ x hx) exact ⟨x, by simpa [Algebra.ofId_apply] using hx⟩
2,042
import Mathlib.FieldTheory.SeparableClosure import Mathlib.Algebra.CharP.IntermediateField open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section IsPurelyInseparable class IsPurelyInseparable : Prop where isIntegral : Algebra.IsIntegral F E inseparable' (x : E) : (minpoly F x).Separable → x ∈ (algebraMap F E).range attribute [instance] IsPurelyInseparable.isIntegral variable {E} in theorem IsPurelyInseparable.isIntegral' [IsPurelyInseparable F E] (x : E) : IsIntegral F x := Algebra.IsIntegral.isIntegral _ theorem IsPurelyInseparable.isAlgebraic [IsPurelyInseparable F E] : Algebra.IsAlgebraic F E := inferInstance variable {E} theorem IsPurelyInseparable.inseparable [IsPurelyInseparable F E] : ∀ x : E, (minpoly F x).Separable → x ∈ (algebraMap F E).range := IsPurelyInseparable.inseparable' variable {F K} theorem isPurelyInseparable_iff : IsPurelyInseparable F E ↔ ∀ x : E, IsIntegral F x ∧ ((minpoly F x).Separable → x ∈ (algebraMap F E).range) := ⟨fun h x ↦ ⟨h.isIntegral' x, h.inseparable' x⟩, fun h ↦ ⟨⟨fun x ↦ (h x).1⟩, fun x ↦ (h x).2⟩⟩
Mathlib/FieldTheory/PurelyInseparable.lean
169
174
theorem AlgEquiv.isPurelyInseparable (e : K ≃ₐ[F] E) [IsPurelyInseparable F K] : IsPurelyInseparable F E := by
refine ⟨⟨fun _ ↦ by rw [← isIntegral_algEquiv e.symm]; exact IsPurelyInseparable.isIntegral' F _⟩, fun x h ↦ ?_⟩ rw [← minpoly.algEquiv_eq e.symm] at h simpa only [RingHom.mem_range, algebraMap_eq_apply] using IsPurelyInseparable.inseparable F _ h
2,043
import Mathlib.FieldTheory.SeparableClosure import Mathlib.Algebra.CharP.IntermediateField open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section IsPurelyInseparable class IsPurelyInseparable : Prop where isIntegral : Algebra.IsIntegral F E inseparable' (x : E) : (minpoly F x).Separable → x ∈ (algebraMap F E).range attribute [instance] IsPurelyInseparable.isIntegral variable {E} in theorem IsPurelyInseparable.isIntegral' [IsPurelyInseparable F E] (x : E) : IsIntegral F x := Algebra.IsIntegral.isIntegral _ theorem IsPurelyInseparable.isAlgebraic [IsPurelyInseparable F E] : Algebra.IsAlgebraic F E := inferInstance variable {E} theorem IsPurelyInseparable.inseparable [IsPurelyInseparable F E] : ∀ x : E, (minpoly F x).Separable → x ∈ (algebraMap F E).range := IsPurelyInseparable.inseparable' variable {F K} theorem isPurelyInseparable_iff : IsPurelyInseparable F E ↔ ∀ x : E, IsIntegral F x ∧ ((minpoly F x).Separable → x ∈ (algebraMap F E).range) := ⟨fun h x ↦ ⟨h.isIntegral' x, h.inseparable' x⟩, fun h ↦ ⟨⟨fun x ↦ (h x).1⟩, fun x ↦ (h x).2⟩⟩ theorem AlgEquiv.isPurelyInseparable (e : K ≃ₐ[F] E) [IsPurelyInseparable F K] : IsPurelyInseparable F E := by refine ⟨⟨fun _ ↦ by rw [← isIntegral_algEquiv e.symm]; exact IsPurelyInseparable.isIntegral' F _⟩, fun x h ↦ ?_⟩ rw [← minpoly.algEquiv_eq e.symm] at h simpa only [RingHom.mem_range, algebraMap_eq_apply] using IsPurelyInseparable.inseparable F _ h theorem AlgEquiv.isPurelyInseparable_iff (e : K ≃ₐ[F] E) : IsPurelyInseparable F K ↔ IsPurelyInseparable F E := ⟨fun _ ↦ e.isPurelyInseparable, fun _ ↦ e.symm.isPurelyInseparable⟩ theorem Algebra.IsAlgebraic.isPurelyInseparable_of_isSepClosed [Algebra.IsAlgebraic F E] [IsSepClosed F] : IsPurelyInseparable F E := ⟨inferInstance, fun x h ↦ minpoly.mem_range_of_degree_eq_one F x <| IsSepClosed.degree_eq_one_of_irreducible F (minpoly.irreducible (Algebra.IsIntegral.isIntegral _)) h⟩ variable (F E K) theorem IsPurelyInseparable.surjective_algebraMap_of_isSeparable [IsPurelyInseparable F E] [IsSeparable F E] : Function.Surjective (algebraMap F E) := fun x ↦ IsPurelyInseparable.inseparable F x (IsSeparable.separable F x) theorem IsPurelyInseparable.bijective_algebraMap_of_isSeparable [IsPurelyInseparable F E] [IsSeparable F E] : Function.Bijective (algebraMap F E) := ⟨(algebraMap F E).injective, surjective_algebraMap_of_isSeparable F E⟩ variable {F E} in theorem IntermediateField.eq_bot_of_isPurelyInseparable_of_isSeparable (L : IntermediateField F E) [IsPurelyInseparable F L] [IsSeparable F L] : L = ⊥ := bot_unique fun x hx ↦ by obtain ⟨y, hy⟩ := IsPurelyInseparable.surjective_algebraMap_of_isSeparable F L ⟨x, hx⟩ exact ⟨y, congr_arg (algebraMap L E) hy⟩ theorem separableClosure.eq_bot_of_isPurelyInseparable [IsPurelyInseparable F E] : separableClosure F E = ⊥ := bot_unique fun x h ↦ IsPurelyInseparable.inseparable F x (mem_separableClosure_iff.1 h) variable {F E} in theorem separableClosure.eq_bot_iff [Algebra.IsAlgebraic F E] : separableClosure F E = ⊥ ↔ IsPurelyInseparable F E := ⟨fun h ↦ isPurelyInseparable_iff.2 fun x ↦ ⟨Algebra.IsIntegral.isIntegral x, fun hs ↦ by simpa only [h] using mem_separableClosure_iff.2 hs⟩, fun _ ↦ eq_bot_of_isPurelyInseparable F E⟩ instance isPurelyInseparable_self : IsPurelyInseparable F F := ⟨inferInstance, fun x _ ↦ ⟨x, rfl⟩⟩ variable {E}
Mathlib/FieldTheory/PurelyInseparable.lean
230
243
theorem isPurelyInseparable_iff_pow_mem (q : ℕ) [ExpChar F q] : IsPurelyInseparable F E ↔ ∀ x : E, ∃ n : ℕ, x ^ q ^ n ∈ (algebraMap F E).range := by
rw [isPurelyInseparable_iff] refine ⟨fun h x ↦ ?_, fun h x ↦ ?_⟩ · obtain ⟨g, h1, n, h2⟩ := (minpoly.irreducible (h x).1).hasSeparableContraction q exact ⟨n, (h _).2 <| h1.of_dvd <| minpoly.dvd F _ <| by simpa only [expand_aeval, minpoly.aeval] using congr_arg (aeval x) h2⟩ have hdeg := (minpoly.natSepDegree_eq_one_iff_pow_mem q).2 (h x) have halg : IsIntegral F x := by_contra fun h' ↦ by simp only [minpoly.eq_zero h', natSepDegree_zero, zero_ne_one] at hdeg refine ⟨halg, fun hsep ↦ ?_⟩ rw [hsep.natSepDegree_eq_natDegree, ← adjoin.finrank halg, IntermediateField.finrank_eq_one_iff] at hdeg simpa only [hdeg] using mem_adjoin_simple_self F x
2,043
import Mathlib.FieldTheory.SeparableClosure import Mathlib.Algebra.CharP.IntermediateField open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section perfectClosure def perfectClosure : IntermediateField F E where carrier := {x : E | ∃ n : ℕ, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range} add_mem' := by rintro x y ⟨n, hx⟩ ⟨m, hy⟩ use n + m have := expChar_of_injective_algebraMap (algebraMap F E).injective (ringExpChar F) rw [add_pow_expChar_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul] exact add_mem (pow_mem hx _) (pow_mem hy _) mul_mem' := by rintro x y ⟨n, hx⟩ ⟨m, hy⟩ use n + m rw [mul_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul] exact mul_mem (pow_mem hx _) (pow_mem hy _) inv_mem' := by rintro x ⟨n, hx⟩ use n; rw [inv_pow] apply inv_mem (id hx : _ ∈ (⊥ : IntermediateField F E)) algebraMap_mem' := fun x ↦ ⟨0, by rw [pow_zero, pow_one]; exact ⟨x, rfl⟩⟩ variable {F E} theorem mem_perfectClosure_iff {x : E} : x ∈ perfectClosure F E ↔ ∃ n : ℕ, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range := Iff.rfl
Mathlib/FieldTheory/PurelyInseparable.lean
281
283
theorem mem_perfectClosure_iff_pow_mem (q : ℕ) [ExpChar F q] {x : E} : x ∈ perfectClosure F E ↔ ∃ n : ℕ, x ^ q ^ n ∈ (algebraMap F E).range := by
rw [mem_perfectClosure_iff, ringExpChar.eq F q]
2,043
import Mathlib.FieldTheory.SeparableClosure import Mathlib.Algebra.CharP.IntermediateField open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section perfectClosure def perfectClosure : IntermediateField F E where carrier := {x : E | ∃ n : ℕ, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range} add_mem' := by rintro x y ⟨n, hx⟩ ⟨m, hy⟩ use n + m have := expChar_of_injective_algebraMap (algebraMap F E).injective (ringExpChar F) rw [add_pow_expChar_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul] exact add_mem (pow_mem hx _) (pow_mem hy _) mul_mem' := by rintro x y ⟨n, hx⟩ ⟨m, hy⟩ use n + m rw [mul_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul] exact mul_mem (pow_mem hx _) (pow_mem hy _) inv_mem' := by rintro x ⟨n, hx⟩ use n; rw [inv_pow] apply inv_mem (id hx : _ ∈ (⊥ : IntermediateField F E)) algebraMap_mem' := fun x ↦ ⟨0, by rw [pow_zero, pow_one]; exact ⟨x, rfl⟩⟩ variable {F E} theorem mem_perfectClosure_iff {x : E} : x ∈ perfectClosure F E ↔ ∃ n : ℕ, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range := Iff.rfl theorem mem_perfectClosure_iff_pow_mem (q : ℕ) [ExpChar F q] {x : E} : x ∈ perfectClosure F E ↔ ∃ n : ℕ, x ^ q ^ n ∈ (algebraMap F E).range := by rw [mem_perfectClosure_iff, ringExpChar.eq F q]
Mathlib/FieldTheory/PurelyInseparable.lean
287
289
theorem mem_perfectClosure_iff_natSepDegree_eq_one {x : E} : x ∈ perfectClosure F E ↔ (minpoly F x).natSepDegree = 1 := by
rw [mem_perfectClosure_iff, minpoly.natSepDegree_eq_one_iff_pow_mem (ringExpChar F)]
2,043
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #align algebra.norm_apply Algebra.norm_apply
Mathlib/RingTheory/Norm.lean
72
73
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 <;> trivial
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_basis variable {R}
Mathlib/RingTheory/Norm.lean
78
81
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
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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
Mathlib/RingTheory/Norm.lean
85
87
theorem norm_eq_matrix_det [Fintype ι] [DecidableEq ι] (b : Basis ι R S) (s : S) : norm R s = Matrix.det (Algebra.leftMulMatrix b s) := by
rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det
Mathlib/RingTheory/Norm.lean
91
97
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] · rw [Finset.prod_const, Finset.card_univ]
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det 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] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[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⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap section EqProdRoots
Mathlib/RingTheory/Norm.lean
118
121
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
rw [norm_eq_matrix_det pb.basis, det_eq_sign_charpoly_coeff, charpoly_leftMulMatrix, Fintype.card_fin]
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det 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] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[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⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap section EqProdRoots 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 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
Mathlib/RingTheory/Norm.lean
126
135
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] simp only [map_neg, _root_.map_one, neg_mul, neg_neg, one_pow, one_mul]
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det 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] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[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⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap section EqZeroIff variable [Finite ι] @[simp]
Mathlib/RingTheory/Norm.lean
145
147
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)]
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det 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] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[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⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap section EqZeroIff variable [Finite ι] @[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 @[simp]
Mathlib/RingTheory/Norm.lean
151
166
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 on_goal 1 => 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 ?_) · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i · contrapose! v_ne with sum_eq apply b.equivFun.symm.injective rw [b.equivFun_symm_apply, sum_eq, LinearEquiv.map_zero]
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det 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] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[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⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap section EqZeroIff variable [Finite ι] @[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 @[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 on_goal 1 => 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 ?_) · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i · contrapose! v_ne with sum_eq apply b.equivFun.symm.injective rw [b.equivFun_symm_apply, sum_eq, LinearEquiv.map_zero] #align algebra.norm_eq_zero_iff Algebra.norm_eq_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 @[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'
Mathlib/RingTheory/Norm.lean
179
183
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.of_basis b haveI : Module.Finite R S := Module.Finite.of_basis b exact norm_eq_zero_iff
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det 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] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[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⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap open IntermediateField variable (K)
Mathlib/RingTheory/Norm.lean
197
207
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) : norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
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) _, smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis] simp only [Finset.card_fin, Finset.prod_const] congr rw [← PowerBasis.finrank, AdjoinSimple.algebraMap_gen K x]
2,044
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" 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 open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S →* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #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 <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_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) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det 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] · rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[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⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap open IntermediateField variable (K) theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) : norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by 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) _, smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis] simp only [Finset.card_fin, Finset.prod_const] congr rw [← PowerBasis.finrank, AdjoinSimple.algebraMap_gen K x] #align algebra.norm_eq_norm_adjoin Algebra.norm_eq_norm_adjoin variable {K} section IntermediateField
Mathlib/RingTheory/Norm.lean
214
221
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) : norm K (AdjoinSimple.gen K x) = 1 := by
rw [norm_eq_one_of_not_exists_basis] contrapose! hx obtain ⟨s, ⟨b⟩⟩ := hx 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)
2,044
import Mathlib.LinearAlgebra.FreeModule.IdealQuotient import Mathlib.RingTheory.Norm #align_import linear_algebra.free_module.norm from "leanprover-community/mathlib"@"90b0d53ee6ffa910e5c2a977ce7e2fc704647974" open Ideal Polynomial open scoped Polynomial variable {R S ι : Type*} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] [CommRing S] [IsDomain S] [Algebra R S] section CommRing variable (F : Type*) [CommRing F] [Algebra F R] [Algebra F S] [IsScalarTower F R S]
Mathlib/LinearAlgebra/FreeModule/Norm.lean
30
50
theorem associated_norm_prod_smith [Fintype ι] (b : Basis ι R S) {f : S} (hf : f ≠ 0) : Associated (Algebra.norm R f) (∏ i, smithCoeffs b _ (span_singleton_eq_bot.not.2 hf) i) := by
have hI := span_singleton_eq_bot.not.2 hf let b' := ringBasis b (span {f}) hI classical rw [← Matrix.det_diagonal, ← LinearMap.det_toLin b'] let e := (b'.equiv ((span {f}).selfBasis b hI) <| Equiv.refl _).trans ((LinearEquiv.coord S S f hf).restrictScalars R) refine (LinearMap.associated_det_of_eq_comp e _ _ ?_).symm dsimp only [e, LinearEquiv.trans_apply] simp_rw [← LinearEquiv.coe_toLinearMap, ← LinearMap.comp_apply, ← LinearMap.ext_iff] refine b'.ext fun i => ?_ simp_rw [LinearMap.comp_apply, LinearEquiv.coe_toLinearMap, Matrix.toLin_apply, Basis.repr_self, Finsupp.single_eq_pi_single, Matrix.diagonal_mulVec_single, Pi.single_apply, ite_smul, zero_smul, Finset.sum_ite_eq', mul_one, if_pos (Finset.mem_univ _), b'.equiv_apply] change _ = f * _ -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [mul_comm, ← smul_eq_mul, LinearEquiv.restrictScalars_apply, LinearEquiv.coord_apply_smul, Ideal.selfBasis_def] rfl
2,045
import Mathlib.RingTheory.RootsOfUnity.Basic import Mathlib.RingTheory.AdjoinRoot import Mathlib.FieldTheory.Galois import Mathlib.LinearAlgebra.Eigenspace.Minpoly import Mathlib.RingTheory.Norm universe u variable {K : Type u} [Field K] open Polynomial IntermediateField AdjoinRoot section Splits lemma root_X_pow_sub_C_pow (n : ℕ) (a : K) : (AdjoinRoot.root (X ^ n - C a)) ^ n = AdjoinRoot.of _ a := by rw [← sub_eq_zero, ← AdjoinRoot.eval₂_root, eval₂_sub, eval₂_C, eval₂_pow, eval₂_X] lemma root_X_pow_sub_C_ne_zero {n : ℕ} (hn : 1 < n) (a : K) : (AdjoinRoot.root (X ^ n - C a)) ≠ 0 := mk_ne_zero_of_natDegree_lt (monic_X_pow_sub_C _ (Nat.not_eq_zero_of_lt hn)) X_ne_zero <| by rwa [natDegree_X_pow_sub_C, natDegree_X] lemma root_X_pow_sub_C_ne_zero' {n : ℕ} {a : K} (hn : 0 < n) (ha : a ≠ 0) : (AdjoinRoot.root (X ^ n - C a)) ≠ 0 := by obtain (rfl|hn) := (Nat.succ_le_iff.mpr hn).eq_or_lt · rw [← Nat.one_eq_succ_zero, pow_one] intro e refine mk_ne_zero_of_natDegree_lt (monic_X_sub_C a) (C_ne_zero.mpr ha) (by simp) ?_ trans AdjoinRoot.mk (X - C a) (X - (X - C a)) · rw [sub_sub_cancel] · rw [map_sub, mk_self, sub_zero, mk_X, e] · exact root_X_pow_sub_C_ne_zero hn a
Mathlib/FieldTheory/KummerExtension.lean
74
82
theorem X_pow_sub_C_splits_of_isPrimitiveRoot {n : ℕ} {ζ : K} (hζ : IsPrimitiveRoot ζ n) {α a : K} (e : α ^ n = a) : (X ^ n - C a).Splits (RingHom.id _) := by
cases n.eq_zero_or_pos with | inl hn => rw [hn, pow_zero, ← C.map_one, ← map_sub] exact splits_C _ _ | inr hn => rw [splits_iff_card_roots, ← nthRoots, hζ.card_nthRoots, natDegree_X_pow_sub_C, if_pos ⟨α, e⟩]
2,046
import Mathlib.RingTheory.RootsOfUnity.Basic import Mathlib.RingTheory.AdjoinRoot import Mathlib.FieldTheory.Galois import Mathlib.LinearAlgebra.Eigenspace.Minpoly import Mathlib.RingTheory.Norm universe u variable {K : Type u} [Field K] open Polynomial IntermediateField AdjoinRoot section Splits lemma root_X_pow_sub_C_pow (n : ℕ) (a : K) : (AdjoinRoot.root (X ^ n - C a)) ^ n = AdjoinRoot.of _ a := by rw [← sub_eq_zero, ← AdjoinRoot.eval₂_root, eval₂_sub, eval₂_C, eval₂_pow, eval₂_X] lemma root_X_pow_sub_C_ne_zero {n : ℕ} (hn : 1 < n) (a : K) : (AdjoinRoot.root (X ^ n - C a)) ≠ 0 := mk_ne_zero_of_natDegree_lt (monic_X_pow_sub_C _ (Nat.not_eq_zero_of_lt hn)) X_ne_zero <| by rwa [natDegree_X_pow_sub_C, natDegree_X] lemma root_X_pow_sub_C_ne_zero' {n : ℕ} {a : K} (hn : 0 < n) (ha : a ≠ 0) : (AdjoinRoot.root (X ^ n - C a)) ≠ 0 := by obtain (rfl|hn) := (Nat.succ_le_iff.mpr hn).eq_or_lt · rw [← Nat.one_eq_succ_zero, pow_one] intro e refine mk_ne_zero_of_natDegree_lt (monic_X_sub_C a) (C_ne_zero.mpr ha) (by simp) ?_ trans AdjoinRoot.mk (X - C a) (X - (X - C a)) · rw [sub_sub_cancel] · rw [map_sub, mk_self, sub_zero, mk_X, e] · exact root_X_pow_sub_C_ne_zero hn a theorem X_pow_sub_C_splits_of_isPrimitiveRoot {n : ℕ} {ζ : K} (hζ : IsPrimitiveRoot ζ n) {α a : K} (e : α ^ n = a) : (X ^ n - C a).Splits (RingHom.id _) := by cases n.eq_zero_or_pos with | inl hn => rw [hn, pow_zero, ← C.map_one, ← map_sub] exact splits_C _ _ | inr hn => rw [splits_iff_card_roots, ← nthRoots, hζ.card_nthRoots, natDegree_X_pow_sub_C, if_pos ⟨α, e⟩] open BigOperators -- make this private, as we only use it to prove a strictly more general version private
Mathlib/FieldTheory/KummerExtension.lean
88
93
theorem X_pow_sub_C_eq_prod' {n : ℕ} {ζ : K} (hζ : IsPrimitiveRoot ζ n) {α a : K} (hn : 0 < n) (e : α ^ n = a) : (X ^ n - C a) = ∏ i ∈ Finset.range n, (X - C (ζ ^ i * α)) := by
rw [eq_prod_roots_of_monic_of_splits_id (monic_X_pow_sub_C _ (Nat.pos_iff_ne_zero.mp hn)) (X_pow_sub_C_splits_of_isPrimitiveRoot hζ e), ← nthRoots, hζ.nthRoots_eq e, Multiset.map_map] rfl
2,046
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in
Mathlib/RingTheory/Discriminant.lean
76
79
theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by
rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv]
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Basic @[simp]
Mathlib/RingTheory/Discriminant.lean
88
89
theorem discr_reindex (b : Basis ι A B) (f : ι ≃ ι') : discr A (b ∘ ⇑f.symm) = discr A b := by
classical rw [← Basis.coe_reindex, discr_def, traceMatrix_reindex, det_reindex_self, ← discr_def]
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Basic @[simp] theorem discr_reindex (b : Basis ι A B) (f : ι ≃ ι') : discr A (b ∘ ⇑f.symm) = discr A b := by classical rw [← Basis.coe_reindex, discr_def, traceMatrix_reindex, det_reindex_self, ← discr_def] #align algebra.discr_reindex Algebra.discr_reindex
Mathlib/RingTheory/Discriminant.lean
93
106
theorem discr_zero_of_not_linearIndependent [IsDomain A] {b : ι → B} (hli : ¬LinearIndependent A b) : discr A b = 0 := by
classical obtain ⟨g, hg, i, hi⟩ := Fintype.not_linearIndependent_iff.1 hli have : (traceMatrix A b) *ᵥ g = 0 := by ext i have : ∀ j, (trace A B) (b i * b j) * g j = (trace A B) (g j • b j * b i) := by intro j; simp [mul_comm] simp only [mulVec, dotProduct, traceMatrix_apply, Pi.zero_apply, traceForm_apply, fun j => this j, ← map_sum, ← sum_mul, hg, zero_mul, LinearMap.map_zero] by_contra h rw [discr_def] at h simp [Matrix.eq_zero_of_mulVec_eq_zero h this] at hi
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Basic @[simp] theorem discr_reindex (b : Basis ι A B) (f : ι ≃ ι') : discr A (b ∘ ⇑f.symm) = discr A b := by classical rw [← Basis.coe_reindex, discr_def, traceMatrix_reindex, det_reindex_self, ← discr_def] #align algebra.discr_reindex Algebra.discr_reindex theorem discr_zero_of_not_linearIndependent [IsDomain A] {b : ι → B} (hli : ¬LinearIndependent A b) : discr A b = 0 := by classical obtain ⟨g, hg, i, hi⟩ := Fintype.not_linearIndependent_iff.1 hli have : (traceMatrix A b) *ᵥ g = 0 := by ext i have : ∀ j, (trace A B) (b i * b j) * g j = (trace A B) (g j • b j * b i) := by intro j; simp [mul_comm] simp only [mulVec, dotProduct, traceMatrix_apply, Pi.zero_apply, traceForm_apply, fun j => this j, ← map_sum, ← sum_mul, hg, zero_mul, LinearMap.map_zero] by_contra h rw [discr_def] at h simp [Matrix.eq_zero_of_mulVec_eq_zero h this] at hi #align algebra.discr_zero_of_not_linear_independent Algebra.discr_zero_of_not_linearIndependent variable {A}
Mathlib/RingTheory/Discriminant.lean
113
116
theorem discr_of_matrix_vecMul (b : ι → B) (P : Matrix ι ι A) : discr A (b ᵥ* P.map (algebraMap A B)) = P.det ^ 2 * discr A b := by
rw [discr_def, traceMatrix_of_matrix_vecMul, det_mul, det_mul, det_transpose, mul_comm, ← mul_assoc, discr_def, pow_two]
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Basic @[simp] theorem discr_reindex (b : Basis ι A B) (f : ι ≃ ι') : discr A (b ∘ ⇑f.symm) = discr A b := by classical rw [← Basis.coe_reindex, discr_def, traceMatrix_reindex, det_reindex_self, ← discr_def] #align algebra.discr_reindex Algebra.discr_reindex theorem discr_zero_of_not_linearIndependent [IsDomain A] {b : ι → B} (hli : ¬LinearIndependent A b) : discr A b = 0 := by classical obtain ⟨g, hg, i, hi⟩ := Fintype.not_linearIndependent_iff.1 hli have : (traceMatrix A b) *ᵥ g = 0 := by ext i have : ∀ j, (trace A B) (b i * b j) * g j = (trace A B) (g j • b j * b i) := by intro j; simp [mul_comm] simp only [mulVec, dotProduct, traceMatrix_apply, Pi.zero_apply, traceForm_apply, fun j => this j, ← map_sum, ← sum_mul, hg, zero_mul, LinearMap.map_zero] by_contra h rw [discr_def] at h simp [Matrix.eq_zero_of_mulVec_eq_zero h this] at hi #align algebra.discr_zero_of_not_linear_independent Algebra.discr_zero_of_not_linearIndependent variable {A} theorem discr_of_matrix_vecMul (b : ι → B) (P : Matrix ι ι A) : discr A (b ᵥ* P.map (algebraMap A B)) = P.det ^ 2 * discr A b := by rw [discr_def, traceMatrix_of_matrix_vecMul, det_mul, det_mul, det_transpose, mul_comm, ← mul_assoc, discr_def, pow_two] #align algebra.discr_of_matrix_vec_mul Algebra.discr_of_matrix_vecMul
Mathlib/RingTheory/Discriminant.lean
121
124
theorem discr_of_matrix_mulVec (b : ι → B) (P : Matrix ι ι A) : discr A (P.map (algebraMap A B) *ᵥ b) = P.det ^ 2 * discr A b := by
rw [discr_def, traceMatrix_of_matrix_mulVec, det_mul, det_mul, det_transpose, mul_comm, ← mul_assoc, discr_def, pow_two]
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Field variable (K : Type u) {L : Type v} (E : Type z) [Field K] [Field L] [Field E] variable [Algebra K L] [Algebra K E] variable [Module.Finite K L] [IsAlgClosed E]
Mathlib/RingTheory/Discriminant.lean
136
139
theorem discr_not_zero_of_basis [IsSeparable K L] (b : Basis ι K L) : discr K b ≠ 0 := by
rw [discr_def, traceMatrix_of_basis, ← LinearMap.BilinForm.nondegenerate_iff_det_ne_zero] exact traceForm_nondegenerate _ _
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Field variable (K : Type u) {L : Type v} (E : Type z) [Field K] [Field L] [Field E] variable [Algebra K L] [Algebra K E] variable [Module.Finite K L] [IsAlgClosed E] theorem discr_not_zero_of_basis [IsSeparable K L] (b : Basis ι K L) : discr K b ≠ 0 := by rw [discr_def, traceMatrix_of_basis, ← LinearMap.BilinForm.nondegenerate_iff_det_ne_zero] exact traceForm_nondegenerate _ _ #align algebra.discr_not_zero_of_basis Algebra.discr_not_zero_of_basis theorem discr_isUnit_of_basis [IsSeparable K L] (b : Basis ι K L) : IsUnit (discr K b) := IsUnit.mk0 _ (discr_not_zero_of_basis _ _) #align algebra.discr_is_unit_of_basis Algebra.discr_isUnit_of_basis variable (b : ι → L) (pb : PowerBasis K L)
Mathlib/RingTheory/Discriminant.lean
154
157
theorem discr_eq_det_embeddingsMatrixReindex_pow_two [IsSeparable K L] (e : ι ≃ (L →ₐ[K] E)) : algebraMap K E (discr K b) = (embeddingsMatrixReindex K E b e).det ^ 2 := by
rw [discr_def, RingHom.map_det, RingHom.mapMatrix_apply, traceMatrix_eq_embeddingsMatrixReindex_mul_trans, det_mul, det_transpose, pow_two]
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Field variable (K : Type u) {L : Type v} (E : Type z) [Field K] [Field L] [Field E] variable [Algebra K L] [Algebra K E] variable [Module.Finite K L] [IsAlgClosed E] theorem discr_not_zero_of_basis [IsSeparable K L] (b : Basis ι K L) : discr K b ≠ 0 := by rw [discr_def, traceMatrix_of_basis, ← LinearMap.BilinForm.nondegenerate_iff_det_ne_zero] exact traceForm_nondegenerate _ _ #align algebra.discr_not_zero_of_basis Algebra.discr_not_zero_of_basis theorem discr_isUnit_of_basis [IsSeparable K L] (b : Basis ι K L) : IsUnit (discr K b) := IsUnit.mk0 _ (discr_not_zero_of_basis _ _) #align algebra.discr_is_unit_of_basis Algebra.discr_isUnit_of_basis variable (b : ι → L) (pb : PowerBasis K L) theorem discr_eq_det_embeddingsMatrixReindex_pow_two [IsSeparable K L] (e : ι ≃ (L →ₐ[K] E)) : algebraMap K E (discr K b) = (embeddingsMatrixReindex K E b e).det ^ 2 := by rw [discr_def, RingHom.map_det, RingHom.mapMatrix_apply, traceMatrix_eq_embeddingsMatrixReindex_mul_trans, det_mul, det_transpose, pow_two] #align algebra.discr_eq_det_embeddings_matrix_reindex_pow_two Algebra.discr_eq_det_embeddingsMatrixReindex_pow_two
Mathlib/RingTheory/Discriminant.lean
161
167
theorem discr_powerBasis_eq_prod (e : Fin pb.dim ≃ (L →ₐ[K] E)) [IsSeparable K L] : algebraMap K E (discr K pb.basis) = ∏ i : Fin pb.dim, ∏ j ∈ Ioi i, (e j pb.gen - e i pb.gen) ^ 2 := by
rw [discr_eq_det_embeddingsMatrixReindex_pow_two K E pb.basis e, embeddingsMatrixReindex_eq_vandermonde, det_transpose, det_vandermonde, ← prod_pow] congr; ext i rw [← prod_pow]
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Field variable (K : Type u) {L : Type v} (E : Type z) [Field K] [Field L] [Field E] variable [Algebra K L] [Algebra K E] variable [Module.Finite K L] [IsAlgClosed E] theorem discr_not_zero_of_basis [IsSeparable K L] (b : Basis ι K L) : discr K b ≠ 0 := by rw [discr_def, traceMatrix_of_basis, ← LinearMap.BilinForm.nondegenerate_iff_det_ne_zero] exact traceForm_nondegenerate _ _ #align algebra.discr_not_zero_of_basis Algebra.discr_not_zero_of_basis theorem discr_isUnit_of_basis [IsSeparable K L] (b : Basis ι K L) : IsUnit (discr K b) := IsUnit.mk0 _ (discr_not_zero_of_basis _ _) #align algebra.discr_is_unit_of_basis Algebra.discr_isUnit_of_basis variable (b : ι → L) (pb : PowerBasis K L) theorem discr_eq_det_embeddingsMatrixReindex_pow_two [IsSeparable K L] (e : ι ≃ (L →ₐ[K] E)) : algebraMap K E (discr K b) = (embeddingsMatrixReindex K E b e).det ^ 2 := by rw [discr_def, RingHom.map_det, RingHom.mapMatrix_apply, traceMatrix_eq_embeddingsMatrixReindex_mul_trans, det_mul, det_transpose, pow_two] #align algebra.discr_eq_det_embeddings_matrix_reindex_pow_two Algebra.discr_eq_det_embeddingsMatrixReindex_pow_two theorem discr_powerBasis_eq_prod (e : Fin pb.dim ≃ (L →ₐ[K] E)) [IsSeparable K L] : algebraMap K E (discr K pb.basis) = ∏ i : Fin pb.dim, ∏ j ∈ Ioi i, (e j pb.gen - e i pb.gen) ^ 2 := by rw [discr_eq_det_embeddingsMatrixReindex_pow_two K E pb.basis e, embeddingsMatrixReindex_eq_vandermonde, det_transpose, det_vandermonde, ← prod_pow] congr; ext i rw [← prod_pow] #align algebra.discr_power_basis_eq_prod Algebra.discr_powerBasis_eq_prod
Mathlib/RingTheory/Discriminant.lean
171
176
theorem discr_powerBasis_eq_prod' [IsSeparable K L] (e : Fin pb.dim ≃ (L →ₐ[K] E)) : algebraMap K E (discr K pb.basis) = ∏ i : Fin pb.dim, ∏ j ∈ Ioi i, -((e j pb.gen - e i pb.gen) * (e i pb.gen - e j pb.gen)) := by
rw [discr_powerBasis_eq_prod _ _ _ e] congr; ext i; congr; ext j ring
2,047
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Field variable (K : Type u) {L : Type v} (E : Type z) [Field K] [Field L] [Field E] variable [Algebra K L] [Algebra K E] variable [Module.Finite K L] [IsAlgClosed E] theorem discr_not_zero_of_basis [IsSeparable K L] (b : Basis ι K L) : discr K b ≠ 0 := by rw [discr_def, traceMatrix_of_basis, ← LinearMap.BilinForm.nondegenerate_iff_det_ne_zero] exact traceForm_nondegenerate _ _ #align algebra.discr_not_zero_of_basis Algebra.discr_not_zero_of_basis theorem discr_isUnit_of_basis [IsSeparable K L] (b : Basis ι K L) : IsUnit (discr K b) := IsUnit.mk0 _ (discr_not_zero_of_basis _ _) #align algebra.discr_is_unit_of_basis Algebra.discr_isUnit_of_basis variable (b : ι → L) (pb : PowerBasis K L) theorem discr_eq_det_embeddingsMatrixReindex_pow_two [IsSeparable K L] (e : ι ≃ (L →ₐ[K] E)) : algebraMap K E (discr K b) = (embeddingsMatrixReindex K E b e).det ^ 2 := by rw [discr_def, RingHom.map_det, RingHom.mapMatrix_apply, traceMatrix_eq_embeddingsMatrixReindex_mul_trans, det_mul, det_transpose, pow_two] #align algebra.discr_eq_det_embeddings_matrix_reindex_pow_two Algebra.discr_eq_det_embeddingsMatrixReindex_pow_two theorem discr_powerBasis_eq_prod (e : Fin pb.dim ≃ (L →ₐ[K] E)) [IsSeparable K L] : algebraMap K E (discr K pb.basis) = ∏ i : Fin pb.dim, ∏ j ∈ Ioi i, (e j pb.gen - e i pb.gen) ^ 2 := by rw [discr_eq_det_embeddingsMatrixReindex_pow_two K E pb.basis e, embeddingsMatrixReindex_eq_vandermonde, det_transpose, det_vandermonde, ← prod_pow] congr; ext i rw [← prod_pow] #align algebra.discr_power_basis_eq_prod Algebra.discr_powerBasis_eq_prod theorem discr_powerBasis_eq_prod' [IsSeparable K L] (e : Fin pb.dim ≃ (L →ₐ[K] E)) : algebraMap K E (discr K pb.basis) = ∏ i : Fin pb.dim, ∏ j ∈ Ioi i, -((e j pb.gen - e i pb.gen) * (e i pb.gen - e j pb.gen)) := by rw [discr_powerBasis_eq_prod _ _ _ e] congr; ext i; congr; ext j ring #align algebra.discr_power_basis_eq_prod' Algebra.discr_powerBasis_eq_prod' local notation "n" => finrank K L
Mathlib/RingTheory/Discriminant.lean
182
210
theorem discr_powerBasis_eq_prod'' [IsSeparable K L] (e : Fin pb.dim ≃ (L →ₐ[K] E)) : algebraMap K E (discr K pb.basis) = (-1) ^ (n * (n - 1) / 2) * ∏ i : Fin pb.dim, ∏ j ∈ Ioi i, (e j pb.gen - e i pb.gen) * (e i pb.gen - e j pb.gen) := by
rw [discr_powerBasis_eq_prod' _ _ _ e] simp_rw [fun i j => neg_eq_neg_one_mul ((e j pb.gen - e i pb.gen) * (e i pb.gen - e j pb.gen)), prod_mul_distrib] congr simp only [prod_pow_eq_pow_sum, prod_const] congr rw [← @Nat.cast_inj ℚ, Nat.cast_sum] have : ∀ x : Fin pb.dim, ↑x + 1 ≤ pb.dim := by simp [Nat.succ_le_iff, Fin.is_lt] simp_rw [Fin.card_Ioi, Nat.sub_sub, add_comm 1] simp only [Nat.cast_sub, this, Finset.card_fin, nsmul_eq_mul, sum_const, sum_sub_distrib, Nat.cast_add, Nat.cast_one, sum_add_distrib, mul_one] rw [← Nat.cast_sum, ← @Finset.sum_range ℕ _ pb.dim fun i => i, sum_range_id] have hn : n = pb.dim := by rw [← AlgHom.card K L E, ← Fintype.card_fin pb.dim] -- FIXME: Without the `Fintype` namespace, why does it complain about `Finset.card_congr` being -- deprecated? exact Fintype.card_congr e.symm have h₂ : 2 ∣ pb.dim * (pb.dim - 1) := pb.dim.even_mul_pred_self.two_dvd have hne : ((2 : ℕ) : ℚ) ≠ 0 := by simp have hle : 1 ≤ pb.dim := by rw [← hn, Nat.one_le_iff_ne_zero, ← zero_lt_iff, FiniteDimensional.finrank_pos_iff] infer_instance rw [hn, Nat.cast_div h₂ hne, Nat.cast_mul, Nat.cast_sub hle] field_simp ring
2,047