Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion Mathlib/Algebra/QuadraticAlgebra/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public import Mathlib.Algebra.Star.Unitary
import Mathlib.Tactic.FieldSimp

/-!
# Quadratic algebras: involution, norm, trace, and change of generator.
# Quadratic algebras: involution, norm, trace, change of generator, etc.

Let `R` be a commutative ring. We define:

Expand All @@ -25,6 +25,8 @@ Let `R` be a commutative ring. We define:
map, respectively isomorphism (when `u` is a unit), induced by the change of generator
`ω ↦ u • ω + k`

* `QuadraticAlgebra.baseChange`: the `R`-algebra homomorphism induced by a base change `R → S`

We prove:

* `QuadraticAlgebra.isUnit_iff_norm_isUnit`:
Expand Down Expand Up @@ -438,6 +440,50 @@ def changeGeneratorEquiv (a b : R) (u : Rˣ) (k : R) {a' b' : R}

end changeGenerator

section baseChange

variable {R S : Type*} (S)

section CommSemiring

variable [CommSemiring R] [CommRing S] [Algebra R S] (a b : R)

/-- The `R`-algebra map between quadratic algebras induced by the base change `R → S`,
sending `ω` to `ω`. -/
@[simps!]
def baseChange :
QuadraticAlgebra R a b →ₐ[R] QuadraticAlgebra S (algebraMap R S a) (algebraMap R S b) :=
lift ⟨omega, by ext <;> simp [Algebra.algebraMap_eq_smul_one]⟩

theorem baseChange_omega :
baseChange S a b ω = ω := by
ext <;> simp

theorem baseChange_injective [FaithfulSMul R S] :
Function.Injective (baseChange S a b) := by
intro _ _ h
simp only [QuadraticAlgebra.ext_iff, re_baseChange_apply, ← Algebra.algebraMap_eq_smul_one,
algebraMap.coe_inj, im_baseChange_apply] at h
exact QuadraticAlgebra.ext_iff.mpr h

end CommSemiring

section CommRing

variable [CommRing R] [CommRing S] [Algebra R S] (a b : R)

theorem norm_baseChange (x : QuadraticAlgebra R a b) :
norm (baseChange S a b x) = algebraMap R S (norm x) := by
simp [norm_def, Algebra.smul_def]

theorem trace_baseChange (x : QuadraticAlgebra R a b) :
trace (baseChange S a b x) = algebraMap R S (trace x) := by
simp [trace_def, Algebra.smul_def, map_ofNat]

end CommRing

end baseChange

section field

variable [Field K] {a b : K} [Hab : Fact (∀ r, r ^ 2 ≠ a + b * r)]
Expand Down
6 changes: 6 additions & 0 deletions Mathlib/Algebra/QuadraticAlgebra/Discr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def discr [CommSemiring R] (a b : R) : R := b ^ 2 + 4 * a

theorem discr_def [CommSemiring R] (a b : R) : discr a b = b ^ 2 + 4 * a := rfl

/-- The discriminant commutes with a base change `R → S`. -/
@[simp]
theorem discr_algebraMap {S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S] (a b : R) :
discr (algebraMap R S a) (algebraMap R S b) = algebraMap R S (discr a b) := by
simp [discr_def, map_ofNat]

/-- Under the change of generator `ω ↦ u • ω + k` (see `QuadraticAlgebra.changeGenerator`), the
discriminant is multiplied by `u ^ 2`. -/
theorem discr_changeGenerator [CommRing R] (a b u k : R) :
Expand Down
Loading