linear_algebra.quadratic_form.realMathlib.LinearAlgebra.QuadraticForm.Real

This file has been ported!

Changes since the initial port

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

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2020 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
 -/
-import LinearAlgebra.QuadraticForm.Isometry
+import LinearAlgebra.QuadraticForm.IsometryEquiv
 import Analysis.SpecialFunctions.Pow.Real
 import Data.Real.Sign
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2020 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
 -/
-import Mathbin.LinearAlgebra.QuadraticForm.Isometry
-import Mathbin.Analysis.SpecialFunctions.Pow.Real
-import Mathbin.Data.Real.Sign
+import LinearAlgebra.QuadraticForm.Isometry
+import Analysis.SpecialFunctions.Pow.Real
+import Data.Real.Sign
 
 #align_import linear_algebra.quadratic_form.real from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
 
Diff
@@ -33,17 +33,17 @@ open Real Finset
 
 variable {ι : Type _} [Fintype ι]
 
-#print QuadraticForm.isometrySignWeightedSumSquares /-
+#print QuadraticForm.isometryEquivSignWeightedSumSquares /-
 /-- The isometry between a weighted sum of squares with weights `u` on the
 (non-zero) real numbers and the weighted sum of squares with weights `sign ∘ u`. -/
-noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → ℝ) :
-    Isometry (weightedSumSquares ℝ w) (weightedSumSquares ℝ (SignType.sign ∘ w)) :=
+noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι → ℝ) :
+    IsometryEquiv (weightedSumSquares ℝ w) (weightedSumSquares ℝ (SignType.sign ∘ w)) :=
   by
   let u i := if h : w i = 0 then (1 : ℝˣ) else Units.mk0 (w i) h
   have hu' : ∀ i : ι, (SignType.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 := by intro i;
     refine' (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
   convert
-    (weighted_sum_squares ℝ w).isometryBasisRepr
+    (weighted_sum_squares ℝ w).isometryEquivBasisRepr
       ((Pi.basisFun ℝ ι).units_smul fun i => (isUnit_iff_ne_zero.2 <| hu' i).Unit)
   ext1 v
   rw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply]
@@ -78,7 +78,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
     show -(1 / 2 : ℝ) + -(1 / 2) = -1 by ring, Real.rpow_neg_one, mul_inv, inv_sign,
     mul_assoc (SignType.sign (u j)) (u j)⁻¹, inv_mul_cancel (Units.ne_zero _), mul_one]
   infer_instance
-#align quadratic_form.isometry_sign_weighted_sum_squares QuadraticForm.isometrySignWeightedSumSquares
+#align quadratic_form.isometry_sign_weighted_sum_squares QuadraticForm.isometryEquivSignWeightedSumSquares
 -/
 
 #print QuadraticForm.equivalent_one_neg_one_weighted_sum_squared /-
@@ -90,7 +90,7 @@ theorem equivalent_one_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M
       (∀ i, w i = -1 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
   ⟨SignType.sign ∘ coe ∘ w, fun i => sign_apply_eq_of_ne_zero (w i) (w i).NeZero,
-    ⟨hw₁.trans (isometrySignWeightedSumSquares (coe ∘ w))⟩⟩
+    ⟨hw₁.trans (isometryEquivSignWeightedSumSquares (coe ∘ w))⟩⟩
 #align quadratic_form.equivalent_one_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_neg_one_weighted_sum_squared
 -/
 
@@ -103,7 +103,7 @@ theorem equivalent_one_zero_neg_one_weighted_sum_squared {M : Type _} [AddCommGr
       (∀ i, w i = -1 ∨ w i = 0 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares
   ⟨SignType.sign ∘ coe ∘ w, fun i => sign_apply_eq (w i),
-    ⟨hw₁.trans (isometrySignWeightedSumSquares w)⟩⟩
+    ⟨hw₁.trans (isometryEquivSignWeightedSumSquares w)⟩⟩
 #align quadratic_form.equivalent_one_zero_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_zero_neg_one_weighted_sum_squared
 -/
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
-
-! This file was ported from Lean 3 source module linear_algebra.quadratic_form.real
-! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.LinearAlgebra.QuadraticForm.Isometry
 import Mathbin.Analysis.SpecialFunctions.Pow.Real
 import Mathbin.Data.Real.Sign
 
+#align_import linear_algebra.quadratic_form.real from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
+
 /-!
 # Real quadratic forms
 
Diff
@@ -84,6 +84,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
 #align quadratic_form.isometry_sign_weighted_sum_squares QuadraticForm.isometrySignWeightedSumSquares
 -/
 
+#print QuadraticForm.equivalent_one_neg_one_weighted_sum_squared /-
 /-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1. -/
 theorem equivalent_one_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M] [Module ℝ M]
@@ -94,7 +95,9 @@ theorem equivalent_one_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M
   ⟨SignType.sign ∘ coe ∘ w, fun i => sign_apply_eq_of_ne_zero (w i) (w i).NeZero,
     ⟨hw₁.trans (isometrySignWeightedSumSquares (coe ∘ w))⟩⟩
 #align quadratic_form.equivalent_one_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_neg_one_weighted_sum_squared
+-/
 
+#print QuadraticForm.equivalent_one_zero_neg_one_weighted_sum_squared /-
 /-- **Sylvester's law of inertia**: A real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1 or 0. -/
 theorem equivalent_one_zero_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M] [Module ℝ M]
@@ -105,6 +108,7 @@ theorem equivalent_one_zero_neg_one_weighted_sum_squared {M : Type _} [AddCommGr
   ⟨SignType.sign ∘ coe ∘ w, fun i => sign_apply_eq (w i),
     ⟨hw₁.trans (isometrySignWeightedSumSquares w)⟩⟩
 #align quadratic_form.equivalent_one_zero_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_zero_neg_one_weighted_sum_squared
+-/
 
 end QuadraticForm
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
 
 ! This file was ported from Lean 3 source module linear_algebra.quadratic_form.real
-! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
+! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Data.Real.Sign
 /-!
 # Real quadratic forms
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Sylvester's law of inertia `equivalent_one_neg_one_weighted_sum_squared`:
 A real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1 or 0.
Diff
@@ -33,6 +33,7 @@ open Real Finset
 
 variable {ι : Type _} [Fintype ι]
 
+#print QuadraticForm.isometrySignWeightedSumSquares /-
 /-- The isometry between a weighted sum of squares with weights `u` on the
 (non-zero) real numbers and the weighted sum of squares with weights `sign ∘ u`. -/
 noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → ℝ) :
@@ -78,6 +79,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
     mul_assoc (SignType.sign (u j)) (u j)⁻¹, inv_mul_cancel (Units.ne_zero _), mul_one]
   infer_instance
 #align quadratic_form.isometry_sign_weighted_sum_squares QuadraticForm.isometrySignWeightedSumSquares
+-/
 
 /-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1. -/
Diff
@@ -41,7 +41,8 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
   let u i := if h : w i = 0 then (1 : ℝˣ) else Units.mk0 (w i) h
   have hu' : ∀ i : ι, (SignType.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 := by intro i;
     refine' (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
-  convert(weighted_sum_squares ℝ w).isometryBasisRepr
+  convert
+    (weighted_sum_squares ℝ w).isometryBasisRepr
       ((Pi.basisFun ℝ ι).units_smul fun i => (isUnit_iff_ne_zero.2 <| hu' i).Unit)
   ext1 v
   rw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply]
Diff
@@ -27,7 +27,7 @@ as in `equivalent_one_zero_neg_one_weighted_sum_squared`.
 
 namespace QuadraticForm
 
-open BigOperators
+open scoped BigOperators
 
 open Real Finset
 
Diff
@@ -39,9 +39,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
     Isometry (weightedSumSquares ℝ w) (weightedSumSquares ℝ (SignType.sign ∘ w)) :=
   by
   let u i := if h : w i = 0 then (1 : ℝˣ) else Units.mk0 (w i) h
-  have hu' : ∀ i : ι, (SignType.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 :=
-    by
-    intro i
+  have hu' : ∀ i : ι, (SignType.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 := by intro i;
     refine' (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
   convert(weighted_sum_squares ℝ w).isometryBasisRepr
       ((Pi.basisFun ℝ ι).units_smul fun i => (isUnit_iff_ne_zero.2 <| hu' i).Unit)
@@ -59,8 +57,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
     rw [Pi.basisFun_apply, LinearMap.stdBasis_apply, Pi.smul_apply, Pi.smul_apply,
       Function.update_noteq hij.symm, Pi.zero_apply, smul_eq_mul, smul_eq_mul,
       MulZeroClass.mul_zero, MulZeroClass.mul_zero]
-    intro hj'
-    exact False.elim (hj' hj)
+    intro hj'; exact False.elim (hj' hj)
   simp_rw [Basis.unitsSMul_apply]
   erw [hsum]
   simp only [u, Function.comp, smul_eq_mul]
@@ -74,9 +71,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
             u j *
           v j *
         v j
-    by
-    erw [← mul_assoc, this]
-    ring
+    by erw [← mul_assoc, this]; ring
   rw [← Real.rpow_add (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _),
     show -(1 / 2 : ℝ) + -(1 / 2) = -1 by ring, Real.rpow_neg_one, mul_inv, inv_sign,
     mul_assoc (SignType.sign (u j)) (u j)⁻¹, inv_mul_cancel (Units.ne_zero _), mul_one]
Diff
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
 
 ! This file was ported from Lean 3 source module linear_algebra.quadratic_form.real
-! leanprover-community/mathlib commit 50f092eb7a6a4bc5da84d36190897c35750a5d53
+! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.LinearAlgebra.QuadraticForm.Isometry
-import Mathbin.Analysis.SpecialFunctions.Pow
+import Mathbin.Analysis.SpecialFunctions.Pow.Real
 import Mathbin.Data.Real.Sign
 
 /-!
Diff
@@ -61,7 +61,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
       MulZeroClass.mul_zero, MulZeroClass.mul_zero]
     intro hj'
     exact False.elim (hj' hj)
-  simp_rw [Basis.unitsSmul_apply]
+  simp_rw [Basis.unitsSMul_apply]
   erw [hsum]
   simp only [u, Function.comp, smul_eq_mul]
   split_ifs
Diff
@@ -43,8 +43,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
     by
     intro i
     refine' (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
-  convert
-    (weighted_sum_squares ℝ w).isometryBasisRepr
+  convert(weighted_sum_squares ℝ w).isometryBasisRepr
       ((Pi.basisFun ℝ ι).units_smul fun i => (isUnit_iff_ne_zero.2 <| hu' i).Unit)
   ext1 v
   rw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply]
Diff
@@ -58,14 +58,15 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
       smul_eq_mul, smul_eq_mul, mul_one]
     intro i _ hij
     rw [Pi.basisFun_apply, LinearMap.stdBasis_apply, Pi.smul_apply, Pi.smul_apply,
-      Function.update_noteq hij.symm, Pi.zero_apply, smul_eq_mul, smul_eq_mul, mul_zero, mul_zero]
+      Function.update_noteq hij.symm, Pi.zero_apply, smul_eq_mul, smul_eq_mul,
+      MulZeroClass.mul_zero, MulZeroClass.mul_zero]
     intro hj'
     exact False.elim (hj' hj)
   simp_rw [Basis.unitsSmul_apply]
   erw [hsum]
   simp only [u, Function.comp, smul_eq_mul]
   split_ifs
-  · simp only [h, zero_smul, zero_mul, Real.sign_zero]
+  · simp only [h, zero_smul, MulZeroClass.zero_mul, Real.sign_zero]
   have hwu : w j = u j := by simp only [u, dif_neg h, Units.val_mk0]
   simp only [hwu, Units.val_mk0]
   suffices

Changes in mathlib4

mathlib3
mathlib4
refactor(QuadraticForm/Real): migrate to SignType (#12319)

See also #7842

Diff
@@ -4,8 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
 -/
 import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv
-import Mathlib.Analysis.SpecialFunctions.Pow.Real
-import Mathlib.Data.Real.Sign
+import Mathlib.Data.Sign
+import Mathlib.Algebra.CharP.Invertible
+import Mathlib.Analysis.RCLike.Basic
+import Mathlib.Data.Complex.Abs
 
 #align_import linear_algebra.quadratic_form.real from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
 
@@ -26,73 +28,67 @@ namespace QuadraticForm
 
 open scoped BigOperators
 
-open Real Finset
+open Finset SignType
 
 variable {ι : Type*} [Fintype ι]
 
 /-- The isometry between a weighted sum of squares with weights `u` on the
 (non-zero) real numbers and the weighted sum of squares with weights `sign ∘ u`. -/
 noncomputable def isometryEquivSignWeightedSumSquares (w : ι → ℝ) :
-    IsometryEquiv (weightedSumSquares ℝ w) (weightedSumSquares ℝ (Real.sign ∘ w)) := by
+    IsometryEquiv (weightedSumSquares ℝ w)
+      (weightedSumSquares ℝ (fun i ↦ (sign (w i) : ℝ))) := by
   let u i := if h : w i = 0 then (1 : ℝˣ) else Units.mk0 (w i) h
-  have hu' : ∀ i : ι, (Real.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 := by
-    intro i
-    exact (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
-  convert
-    (weightedSumSquares ℝ w).isometryEquivBasisRepr
-      ((Pi.basisFun ℝ ι).unitsSMul fun i => (isUnit_iff_ne_zero.2 <| hu' i).unit)
+  have hu : ∀ i : ι, 1 / √|(u i : ℝ)| ≠ 0 := fun i ↦
+    have : (u i : ℝ) ≠ 0 := (u i).ne_zero
+    by positivity
+  have hwu : ∀ i, w i / |(u i : ℝ)| = sign (w i) := fun i ↦ by
+    by_cases hi : w i = 0 <;> field_simp [hi, u]
+  convert (weightedSumSquares ℝ w).isometryEquivBasisRepr
+    ((Pi.basisFun ℝ ι).unitsSMul fun i => .mk0 _ (hu i))
   ext1 v
-  rw [basisRepr_apply, weightedSumSquares_apply, weightedSumSquares_apply]
-  refine' sum_congr rfl fun j hj => _
-  have hsum :
-    (∑ i : ι, v i • ((isUnit_iff_ne_zero.2 <| hu' i).unit : ℝ) • (Pi.basisFun ℝ ι) i) j =
-      v j • (Real.sign (u j) * u j) ^ (-(1 / 2 : ℝ)) := by
-    classical
-    rw [Finset.sum_apply, sum_eq_single j, Pi.basisFun_apply, IsUnit.unit_spec,
-      LinearMap.stdBasis_apply, Pi.smul_apply, Pi.smul_apply, Function.update_same, smul_eq_mul,
-      smul_eq_mul, smul_eq_mul, mul_one]
-    intro i _ hij
-    rw [Pi.basisFun_apply, LinearMap.stdBasis_apply, Pi.smul_apply, Pi.smul_apply,
-      Function.update_noteq hij.symm, Pi.zero_apply, smul_eq_mul, smul_eq_mul,
-      mul_zero, mul_zero]
-    intro hj'; exact False.elim (hj' hj)
-  simp_rw [Basis.unitsSMul_apply]
-  erw [hsum]
-  simp only [u, Function.comp, smul_eq_mul]
-  split_ifs with h
-  · simp only [h, zero_smul, zero_mul, Real.sign_zero]
-  have hwu : w j = u j := by simp only [u, dif_neg h, Units.val_mk0]
-  simp only [Units.val_mk0]
-  rw [hwu]
-  suffices (u j : ℝ).sign * v j * v j =
-      (Real.sign (u j) * u j) ^ (-(1 / 2 : ℝ)) * (Real.sign (u j) * u j) ^ (-(1 / 2 : ℝ)) *
-            u j * v j * v j by
-    erw [← mul_assoc, this]; ring
-  rw [← Real.rpow_add (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _),
-    show -(1 / 2 : ℝ) + -(1 / 2) = -1 by ring, Real.rpow_neg_one, mul_inv, inv_sign,
-    mul_assoc (Real.sign (u j)) (u j)⁻¹, inv_mul_cancel (Units.ne_zero _), mul_one]
+  classical
+  suffices ∑ i, (w i / |(u i : ℝ)|) * v i ^ 2 = ∑ i, w i * (v i ^ 2 * |(u i : ℝ)|⁻¹) by
+    simpa [basisRepr_apply, Basis.unitsSMul_apply, ← _root_.sq, mul_pow, ← hwu]
+  exact sum_congr rfl fun j _ ↦ by ring
 #align quadratic_form.isometry_sign_weighted_sum_squares QuadraticForm.isometryEquivSignWeightedSumSquares
 
+/-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
+sum of squares with the weights being ±1, `SignType` version. -/
+theorem equivalent_sign_ne_zero_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
+    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R := ℝ) Q).SeparatingLeft) :
+    ∃ w : Fin (FiniteDimensional.finrank ℝ M) → SignType,
+      (∀ i, w i ≠ 0) ∧ Equivalent Q (weightedSumSquares ℝ fun i ↦ (w i : ℝ)) :=
+  let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
+  ⟨sign ∘ ((↑) : ℝˣ → ℝ) ∘ w, fun i => sign_ne_zero.2 (w i).ne_zero,
+    ⟨hw₁.trans (isometryEquivSignWeightedSumSquares (((↑) : ℝˣ → ℝ) ∘ w))⟩⟩
+
 /-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1. -/
 theorem equivalent_one_neg_one_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
     [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R := ℝ) Q).SeparatingLeft) :
     ∃ w : Fin (FiniteDimensional.finrank ℝ M) → ℝ,
       (∀ i, w i = -1 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
-  let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
-  ⟨Real.sign ∘ ((↑) : ℝˣ → ℝ) ∘ w, fun i => sign_apply_eq_of_ne_zero (w i) (w i).ne_zero,
-    ⟨hw₁.trans (isometryEquivSignWeightedSumSquares (((↑) : ℝˣ → ℝ) ∘ w))⟩⟩
+  let ⟨w, hw₀, hw⟩ := Q.equivalent_sign_ne_zero_weighted_sum_squared hQ
+  ⟨(w ·), fun i ↦ by cases hi : w i <;> simp_all, hw⟩
 #align quadratic_form.equivalent_one_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_neg_one_weighted_sum_squared
 
+/-- **Sylvester's law of inertia**: A real quadratic form is equivalent to a weighted
+sum of squares with the weights being ±1 or 0, `SignType` version. -/
+theorem equivalent_signType_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
+    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) :
+    ∃ w : Fin (FiniteDimensional.finrank ℝ M) → SignType,
+      Equivalent Q (weightedSumSquares ℝ fun i ↦ (w i : ℝ)) :=
+  let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares
+  ⟨sign ∘ w, ⟨hw₁.trans (isometryEquivSignWeightedSumSquares w)⟩⟩
+
 /-- **Sylvester's law of inertia**: A real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1 or 0. -/
 theorem equivalent_one_zero_neg_one_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
     [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) :
     ∃ w : Fin (FiniteDimensional.finrank ℝ M) → ℝ,
       (∀ i, w i = -1 ∨ w i = 0 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
-  let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares
-  ⟨Real.sign ∘ ((↑) : ℝ → ℝ) ∘ w, fun i => sign_apply_eq (w i),
-    ⟨hw₁.trans (isometryEquivSignWeightedSumSquares w)⟩⟩
+  let ⟨w, hw⟩ := Q.equivalent_signType_weighted_sum_squared
+  ⟨(w ·), fun i ↦ by cases h : w i <;> simp [h], hw⟩
 #align quadratic_form.equivalent_one_zero_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_zero_neg_one_weighted_sum_squared
 
 end QuadraticForm
chore: prepare Lean version bump with explicit simp (#10999)

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

Diff
@@ -58,10 +58,10 @@ noncomputable def isometryEquivSignWeightedSumSquares (w : ι → ℝ) :
     intro hj'; exact False.elim (hj' hj)
   simp_rw [Basis.unitsSMul_apply]
   erw [hsum]
-  simp only [Function.comp, smul_eq_mul]
+  simp only [u, Function.comp, smul_eq_mul]
   split_ifs with h
   · simp only [h, zero_smul, zero_mul, Real.sign_zero]
-  have hwu : w j = u j := by simp only [dif_neg h, Units.val_mk0]
+  have hwu : w j = u j := by simp only [u, dif_neg h, Units.val_mk0]
   simp only [Units.val_mk0]
   rw [hwu]
   suffices (u j : ℝ).sign * v j * v j =
refactor(LinearAlgebra/QuadraticForm): Replace BilinForm with a scalar valued bi LinearMap (#10238)

Following on from #10097, which converted the companion of a quadratic form with a bilinear map, this PR replaces a number of results about quadratic forms and bilinear forms with results about quadratic forms and scalar valued bilinear maps. The long term aim is to be able to consider quadratic maps.

The main change is to LinearAlgebra/QuadraticForm/Basic, but this necessitates changes throughout LinearAlgebra/QuadraticForm/. Minor changes are also required elsewhere:

  • LinearAlgebra/CliffordAlgebra/
  • LinearAlgebra/Matrix/PosDef
  • LinearAlgebra/SesquilinearForm
  • A number of additional results about tensor products and linear maps are also required.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Christopher Hoskin <christopher.hoskin@overleaf.com>

Diff
@@ -76,7 +76,7 @@ noncomputable def isometryEquivSignWeightedSumSquares (w : ι → ℝ) :
 /-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1. -/
 theorem equivalent_one_neg_one_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
-    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R := ℝ) Q).Nondegenerate) :
+    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R := ℝ) Q).SeparatingLeft) :
     ∃ w : Fin (FiniteDimensional.finrank ℝ M) → ℝ,
       (∀ i, w i = -1 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -37,7 +37,7 @@ noncomputable def isometryEquivSignWeightedSumSquares (w : ι → ℝ) :
   let u i := if h : w i = 0 then (1 : ℝˣ) else Units.mk0 (w i) h
   have hu' : ∀ i : ι, (Real.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 := by
     intro i
-    refine' (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
+    exact (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
   convert
     (weightedSumSquares ℝ w).isometryEquivBasisRepr
       ((Pi.basisFun ℝ ι).unitsSMul fun i => (isUnit_iff_ne_zero.2 <| hu' i).unit)
chore(QuadraticForm): Fintype -> Finite, DecidableEq (#10462)
Diff
@@ -32,7 +32,7 @@ variable {ι : Type*} [Fintype ι]
 
 /-- The isometry between a weighted sum of squares with weights `u` on the
 (non-zero) real numbers and the weighted sum of squares with weights `sign ∘ u`. -/
-noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι → ℝ) :
+noncomputable def isometryEquivSignWeightedSumSquares (w : ι → ℝ) :
     IsometryEquiv (weightedSumSquares ℝ w) (weightedSumSquares ℝ (Real.sign ∘ w)) := by
   let u i := if h : w i = 0 then (1 : ℝˣ) else Units.mk0 (w i) h
   have hu' : ∀ i : ι, (Real.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 := by
@@ -47,6 +47,7 @@ noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι 
   have hsum :
     (∑ i : ι, v i • ((isUnit_iff_ne_zero.2 <| hu' i).unit : ℝ) • (Pi.basisFun ℝ ι) i) j =
       v j • (Real.sign (u j) * u j) ^ (-(1 / 2 : ℝ)) := by
+    classical
     rw [Finset.sum_apply, sum_eq_single j, Pi.basisFun_apply, IsUnit.unit_spec,
       LinearMap.stdBasis_apply, Pi.smul_apply, Pi.smul_apply, Function.update_same, smul_eq_mul,
       smul_eq_mul, smul_eq_mul, mul_one]
@@ -63,13 +64,10 @@ noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι 
   have hwu : w j = u j := by simp only [dif_neg h, Units.val_mk0]
   simp only [Units.val_mk0]
   rw [hwu]
-  suffices
-    (u j : ℝ).sign * v j * v j =
+  suffices (u j : ℝ).sign * v j * v j =
       (Real.sign (u j) * u j) ^ (-(1 / 2 : ℝ)) * (Real.sign (u j) * u j) ^ (-(1 / 2 : ℝ)) *
-            u j *
-          v j *
-        v j
-    by erw [← mul_assoc, this]; ring
+            u j * v j * v j by
+    erw [← mul_assoc, this]; ring
   rw [← Real.rpow_add (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _),
     show -(1 / 2 : ℝ) + -(1 / 2) = -1 by ring, Real.rpow_neg_one, mul_inv, inv_sign,
     mul_assoc (Real.sign (u j)) (u j)⁻¹, inv_mul_cancel (Units.ne_zero _), mul_one]
refactor(LinearAlgebra/QuadraticForm/Basic): remove non-commutativity support (#7581)

As discussed on Zulip, this generalization seems nonsensical as currently implemented.

There are sensible ways to make this generalization, but they are much larger refactors, and in the meantime the current generalization is useless anyway.

Diff
@@ -78,7 +78,7 @@ noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι 
 /-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1. -/
 theorem equivalent_one_neg_one_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
-    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R₁ := ℝ) Q).Nondegenerate) :
+    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R := ℝ) Q).Nondegenerate) :
     ∃ w : Fin (FiniteDimensional.finrank ℝ M) → ℝ,
       (∀ i, w i = -1 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -53,13 +53,13 @@ noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι 
     intro i _ hij
     rw [Pi.basisFun_apply, LinearMap.stdBasis_apply, Pi.smul_apply, Pi.smul_apply,
       Function.update_noteq hij.symm, Pi.zero_apply, smul_eq_mul, smul_eq_mul,
-      MulZeroClass.mul_zero, MulZeroClass.mul_zero]
+      mul_zero, mul_zero]
     intro hj'; exact False.elim (hj' hj)
   simp_rw [Basis.unitsSMul_apply]
   erw [hsum]
   simp only [Function.comp, smul_eq_mul]
   split_ifs with h
-  · simp only [h, zero_smul, MulZeroClass.zero_mul, Real.sign_zero]
+  · simp only [h, zero_smul, zero_mul, Real.sign_zero]
   have hwu : w j = u j := by simp only [dif_neg h, Units.val_mk0]
   simp only [Units.val_mk0]
   rw [hwu]
chore: banish Type _ and Sort _ (#6499)

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

This has nice performance benefits.

Diff
@@ -28,7 +28,7 @@ open scoped BigOperators
 
 open Real Finset
 
-variable {ι : Type _} [Fintype ι]
+variable {ι : Type*} [Fintype ι]
 
 /-- The isometry between a weighted sum of squares with weights `u` on the
 (non-zero) real numbers and the weighted sum of squares with weights `sign ∘ u`. -/
@@ -77,7 +77,7 @@ noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι 
 
 /-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1. -/
-theorem equivalent_one_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M] [Module ℝ M]
+theorem equivalent_one_neg_one_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
     [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) (hQ : (associated (R₁ := ℝ) Q).Nondegenerate) :
     ∃ w : Fin (FiniteDimensional.finrank ℝ M) → ℝ,
       (∀ i, w i = -1 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
@@ -88,7 +88,7 @@ theorem equivalent_one_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M
 
 /-- **Sylvester's law of inertia**: A real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1 or 0. -/
-theorem equivalent_one_zero_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M] [Module ℝ M]
+theorem equivalent_one_zero_neg_one_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
     [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) :
     ∃ w : Fin (FiniteDimensional.finrank ℝ M) → ℝ,
       (∀ i, w i = -1 ∨ w i = 0 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
refactor(LinearAlgebra/QuadraticForm): rename Isometry to IsometryEquiv (#6305)

This is consistent with LinearIsometryEquiv vs LinearIsometry. The motivation is to make room for QuadraticForm.Isometry as the homomorphism.

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2020 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
 -/
-import Mathlib.LinearAlgebra.QuadraticForm.Isometry
+import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
 import Mathlib.Data.Real.Sign
 
@@ -32,14 +32,14 @@ variable {ι : Type _} [Fintype ι]
 
 /-- The isometry between a weighted sum of squares with weights `u` on the
 (non-zero) real numbers and the weighted sum of squares with weights `sign ∘ u`. -/
-noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → ℝ) :
-    Isometry (weightedSumSquares ℝ w) (weightedSumSquares ℝ (Real.sign ∘ w)) := by
+noncomputable def isometryEquivSignWeightedSumSquares [DecidableEq ι] (w : ι → ℝ) :
+    IsometryEquiv (weightedSumSquares ℝ w) (weightedSumSquares ℝ (Real.sign ∘ w)) := by
   let u i := if h : w i = 0 then (1 : ℝˣ) else Units.mk0 (w i) h
   have hu' : ∀ i : ι, (Real.sign (u i) * u i) ^ (-(1 / 2 : ℝ)) ≠ 0 := by
     intro i
     refine' (ne_of_lt (Real.rpow_pos_of_pos (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _) _)).symm
   convert
-    (weightedSumSquares ℝ w).isometryBasisRepr
+    (weightedSumSquares ℝ w).isometryEquivBasisRepr
       ((Pi.basisFun ℝ ι).unitsSMul fun i => (isUnit_iff_ne_zero.2 <| hu' i).unit)
   ext1 v
   rw [basisRepr_apply, weightedSumSquares_apply, weightedSumSquares_apply]
@@ -73,7 +73,7 @@ noncomputable def isometrySignWeightedSumSquares [DecidableEq ι] (w : ι → 
   rw [← Real.rpow_add (sign_mul_pos_of_ne_zero _ <| Units.ne_zero _),
     show -(1 / 2 : ℝ) + -(1 / 2) = -1 by ring, Real.rpow_neg_one, mul_inv, inv_sign,
     mul_assoc (Real.sign (u j)) (u j)⁻¹, inv_mul_cancel (Units.ne_zero _), mul_one]
-#align quadratic_form.isometry_sign_weighted_sum_squares QuadraticForm.isometrySignWeightedSumSquares
+#align quadratic_form.isometry_sign_weighted_sum_squares QuadraticForm.isometryEquivSignWeightedSumSquares
 
 /-- **Sylvester's law of inertia**: A nondegenerate real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1. -/
@@ -83,7 +83,7 @@ theorem equivalent_one_neg_one_weighted_sum_squared {M : Type _} [AddCommGroup M
       (∀ i, w i = -1 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
   ⟨Real.sign ∘ ((↑) : ℝˣ → ℝ) ∘ w, fun i => sign_apply_eq_of_ne_zero (w i) (w i).ne_zero,
-    ⟨hw₁.trans (isometrySignWeightedSumSquares (((↑) : ℝˣ → ℝ) ∘ w))⟩⟩
+    ⟨hw₁.trans (isometryEquivSignWeightedSumSquares (((↑) : ℝˣ → ℝ) ∘ w))⟩⟩
 #align quadratic_form.equivalent_one_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_neg_one_weighted_sum_squared
 
 /-- **Sylvester's law of inertia**: A real quadratic form is equivalent to a weighted
@@ -94,7 +94,7 @@ theorem equivalent_one_zero_neg_one_weighted_sum_squared {M : Type _} [AddCommGr
       (∀ i, w i = -1 ∨ w i = 0 ∨ w i = 1) ∧ Equivalent Q (weightedSumSquares ℝ w) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares
   ⟨Real.sign ∘ ((↑) : ℝ → ℝ) ∘ w, fun i => sign_apply_eq (w i),
-    ⟨hw₁.trans (isometrySignWeightedSumSquares w)⟩⟩
+    ⟨hw₁.trans (isometryEquivSignWeightedSumSquares w)⟩⟩
 #align quadratic_form.equivalent_one_zero_neg_one_weighted_sum_squared QuadraticForm.equivalent_one_zero_neg_one_weighted_sum_squared
 
 end QuadraticForm
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Anne Baanen. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Anne Baanen, Kexing Ying, Eric Wieser
-
-! This file was ported from Lean 3 source module linear_algebra.quadratic_form.real
-! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.LinearAlgebra.QuadraticForm.Isometry
 import Mathlib.Analysis.SpecialFunctions.Pow.Real
 import Mathlib.Data.Real.Sign
 
+#align_import linear_algebra.quadratic_form.real from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
+
 /-!
 # Real quadratic forms
 
chore: fix many typos (#4967)

These are all doc fixes

Diff
@@ -19,7 +19,7 @@ Sylvester's law of inertia `equivalent_one_neg_one_weighted_sum_squared`:
 A real quadratic form is equivalent to a weighted
 sum of squares with the weights being ±1 or 0.
 
-When the real quadratic form is nondegerate we can take the weights to be ±1,
+When the real quadratic form is nondegenerate we can take the weights to be ±1,
 as in `equivalent_one_zero_neg_one_weighted_sum_squared`.
 
 -/
feat: port LinearAlgebra.QuadraticForm.Real (#4758)

Dependencies 12 + 829

830 files ported (98.6%)
366515 lines ported (98.5%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file