linear_algebra.quadratic_form.complexMathlib.LinearAlgebra.QuadraticForm.Complex

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.Complex
 
 #align_import linear_algebra.quadratic_form.complex from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
Diff
@@ -81,7 +81,7 @@ noncomputable def isometryEquivSumSquaresUnits [DecidableEq ι] (w : ι → Unit
   have hw1 : (fun i => if (w i : ℂ) = 0 then 0 else 1 : ι → ℂ) = 1 := by ext i : 1;
     exact dif_neg (w i).NeZero
   have := isometry_sum_squares (coe ∘ w)
-  rw [hw1] at this 
+  rw [hw1] at this
   exact this
 #align quadratic_form.isometry_sum_squares_units QuadraticForm.isometryEquivSumSquaresUnits
 -/
Diff
@@ -3,8 +3,8 @@ 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.Complex
+import LinearAlgebra.QuadraticForm.Isometry
+import Analysis.SpecialFunctions.Pow.Complex
 
 #align_import linear_algebra.quadratic_form.complex from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
 
Diff
@@ -28,11 +28,11 @@ open Finset
 
 variable {ι : Type _} [Fintype ι]
 
-#print QuadraticForm.isometrySumSquares /-
+#print QuadraticForm.isometryEquivSumSquares /-
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weighted_sum_squares` with weights 1 or 0. -/
-noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
-    Isometry (weightedSumSquares ℂ w')
+noncomputable def isometryEquivSumSquares [DecidableEq ι] (w' : ι → ℂ) :
+    IsometryEquiv (weightedSumSquares ℂ w')
       (weightedSumSquares ℂ (fun i => if w' i = 0 then 0 else 1 : ι → ℂ)) :=
   by
   let w i := if h : w' i = 0 then (1 : Units ℂ) else Units.mk0 (w' i) h
@@ -41,7 +41,7 @@ noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
     intro i hi
     exact (w i).NeZero ((Complex.cpow_eq_zero_iff _ _).1 hi).1
   convert
-    (weighted_sum_squares ℂ w').isometryBasisRepr
+    (weighted_sum_squares ℂ w').isometryEquivBasisRepr
       ((Pi.basisFun ℂ ι).units_smul fun i => (isUnit_iff_ne_zero.2 <| hw' i).Unit)
   ext1 v
   erw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply]
@@ -69,21 +69,21 @@ noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
     ring
   rw [← Complex.cpow_add _ _ (w j).NeZero, show -(1 / 2 : ℂ) + -(1 / 2) = -1 by simp [← two_mul],
     Complex.cpow_neg_one, inv_mul_cancel (w j).NeZero, one_mul]
-#align quadratic_form.isometry_sum_squares QuadraticForm.isometrySumSquares
+#align quadratic_form.isometry_sum_squares QuadraticForm.isometryEquivSumSquares
 -/
 
-#print QuadraticForm.isometrySumSquaresUnits /-
+#print QuadraticForm.isometryEquivSumSquaresUnits /-
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weighted_sum_squares` with weight `λ i : ι, 1`. -/
-noncomputable def isometrySumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ) :
-    Isometry (weightedSumSquares ℂ w) (weightedSumSquares ℂ (1 : ι → ℂ)) :=
+noncomputable def isometryEquivSumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ) :
+    IsometryEquiv (weightedSumSquares ℂ w) (weightedSumSquares ℂ (1 : ι → ℂ)) :=
   by
   have hw1 : (fun i => if (w i : ℂ) = 0 then 0 else 1 : ι → ℂ) = 1 := by ext i : 1;
     exact dif_neg (w i).NeZero
   have := isometry_sum_squares (coe ∘ w)
   rw [hw1] at this 
   exact this
-#align quadratic_form.isometry_sum_squares_units QuadraticForm.isometrySumSquaresUnits
+#align quadratic_form.isometry_sum_squares_units QuadraticForm.isometryEquivSumSquaresUnits
 -/
 
 #print QuadraticForm.equivalent_sum_squares /-
@@ -93,7 +93,7 @@ theorem equivalent_sum_squares {M : Type _} [AddCommGroup M] [Module ℂ M] [Fin
     (Q : QuadraticForm ℂ M) (hQ : (associated Q).Nondegenerate) :
     Equivalent Q (weightedSumSquares ℂ (1 : Fin (FiniteDimensional.finrank ℂ M) → ℂ)) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
-  ⟨hw₁.trans (isometrySumSquaresUnits w)⟩
+  ⟨hw₁.trans (isometryEquivSumSquaresUnits w)⟩
 #align quadratic_form.equivalent_sum_squares QuadraticForm.equivalent_sum_squares
 -/
 
Diff
@@ -2,15 +2,12 @@
 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.complex
-! 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.Complex
 
+#align_import linear_algebra.quadratic_form.complex from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
+
 /-!
 # Quadratic forms over the complex numbers
 
Diff
@@ -31,6 +31,7 @@ open Finset
 
 variable {ι : Type _} [Fintype ι]
 
+#print QuadraticForm.isometrySumSquares /-
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weighted_sum_squares` with weights 1 or 0. -/
 noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
@@ -72,7 +73,9 @@ noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
   rw [← Complex.cpow_add _ _ (w j).NeZero, show -(1 / 2 : ℂ) + -(1 / 2) = -1 by simp [← two_mul],
     Complex.cpow_neg_one, inv_mul_cancel (w j).NeZero, one_mul]
 #align quadratic_form.isometry_sum_squares QuadraticForm.isometrySumSquares
+-/
 
+#print QuadraticForm.isometrySumSquaresUnits /-
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weighted_sum_squares` with weight `λ i : ι, 1`. -/
 noncomputable def isometrySumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ) :
@@ -84,7 +87,9 @@ noncomputable def isometrySumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ
   rw [hw1] at this 
   exact this
 #align quadratic_form.isometry_sum_squares_units QuadraticForm.isometrySumSquaresUnits
+-/
 
+#print QuadraticForm.equivalent_sum_squares /-
 /-- A nondegenerate quadratic form on the complex numbers is equivalent to
 the sum of squares, i.e. `weighted_sum_squares` with weight `λ i : ι, 1`. -/
 theorem equivalent_sum_squares {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
@@ -93,13 +98,16 @@ theorem equivalent_sum_squares {M : Type _} [AddCommGroup M] [Module ℂ M] [Fin
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
   ⟨hw₁.trans (isometrySumSquaresUnits w)⟩
 #align quadratic_form.equivalent_sum_squares QuadraticForm.equivalent_sum_squares
+-/
 
+#print QuadraticForm.complex_equivalent /-
 /-- All nondegenerate quadratic forms on the complex numbers are equivalent. -/
 theorem complex_equivalent {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
     (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated Q₁).Nondegenerate)
     (hQ₂ : (associated Q₂).Nondegenerate) : Equivalent Q₁ Q₂ :=
   (Q₁.equivalent_sum_squares hQ₁).trans (Q₂.equivalent_sum_squares hQ₂).symm
 #align quadratic_form.complex_equivalent QuadraticForm.complex_equivalent
+-/
 
 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.complex
-! 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.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Analysis.SpecialFunctions.Pow.Complex
 /-!
 # Quadratic forms over the complex numbers
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 `equivalent_sum_squares`: A nondegenerate quadratic form over the complex numbers is equivalent to
 a sum of squares.
 
Diff
@@ -84,19 +84,19 @@ noncomputable def isometrySumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ
 
 /-- A nondegenerate quadratic form on the complex numbers is equivalent to
 the sum of squares, i.e. `weighted_sum_squares` with weight `λ i : ι, 1`. -/
-theorem equivalentSumSquares {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
+theorem equivalent_sum_squares {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
     (Q : QuadraticForm ℂ M) (hQ : (associated Q).Nondegenerate) :
     Equivalent Q (weightedSumSquares ℂ (1 : Fin (FiniteDimensional.finrank ℂ M) → ℂ)) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
   ⟨hw₁.trans (isometrySumSquaresUnits w)⟩
-#align quadratic_form.equivalent_sum_squares QuadraticForm.equivalentSumSquares
+#align quadratic_form.equivalent_sum_squares QuadraticForm.equivalent_sum_squares
 
 /-- All nondegenerate quadratic forms on the complex numbers are equivalent. -/
-theorem complexEquivalent {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
+theorem complex_equivalent {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
     (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated Q₁).Nondegenerate)
     (hQ₂ : (associated Q₂).Nondegenerate) : Equivalent Q₁ Q₂ :=
-  (Q₁.equivalentSumSquares hQ₁).trans (Q₂.equivalentSumSquares hQ₂).symm
-#align quadratic_form.complex_equivalent QuadraticForm.complexEquivalent
+  (Q₁.equivalent_sum_squares hQ₁).trans (Q₂.equivalent_sum_squares hQ₂).symm
+#align quadratic_form.complex_equivalent QuadraticForm.complex_equivalent
 
 end QuadraticForm
 
Diff
@@ -39,7 +39,8 @@ noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
     by
     intro i hi
     exact (w i).NeZero ((Complex.cpow_eq_zero_iff _ _).1 hi).1
-  convert(weighted_sum_squares ℂ w').isometryBasisRepr
+  convert
+    (weighted_sum_squares ℂ w').isometryBasisRepr
       ((Pi.basisFun ℂ ι).units_smul fun i => (isUnit_iff_ne_zero.2 <| hw' i).Unit)
   ext1 v
   erw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply]
Diff
@@ -77,7 +77,7 @@ noncomputable def isometrySumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ
   have hw1 : (fun i => if (w i : ℂ) = 0 then 0 else 1 : ι → ℂ) = 1 := by ext i : 1;
     exact dif_neg (w i).NeZero
   have := isometry_sum_squares (coe ∘ w)
-  rw [hw1] at this
+  rw [hw1] at this 
   exact this
 #align quadratic_form.isometry_sum_squares_units QuadraticForm.isometrySumSquaresUnits
 
Diff
@@ -22,7 +22,7 @@ a sum of squares.
 
 namespace QuadraticForm
 
-open BigOperators
+open scoped BigOperators
 
 open Finset
 
Diff
@@ -55,8 +55,7 @@ noncomputable def isometrySumSquares [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, smul_eq_mul]
   split_ifs
@@ -64,9 +63,7 @@ noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
   have hww' : w' j = w j := by simp only [w, dif_neg h, Units.val_mk0]
   simp only [hww', one_mul]
   change v j * v j = ↑(w j) * (v j * ↑(w j) ^ (-(1 / 2 : ℂ)) * (v j * ↑(w j) ^ (-(1 / 2 : ℂ))))
-  suffices v j * v j = w j ^ (-(1 / 2 : ℂ)) * w j ^ (-(1 / 2 : ℂ)) * w j * v j * v j
-    by
-    rw [this]
+  suffices v j * v j = w j ^ (-(1 / 2 : ℂ)) * w j ^ (-(1 / 2 : ℂ)) * w j * v j * v j by rw [this];
     ring
   rw [← Complex.cpow_add _ _ (w j).NeZero, show -(1 / 2 : ℂ) + -(1 / 2) = -1 by simp [← two_mul],
     Complex.cpow_neg_one, inv_mul_cancel (w j).NeZero, one_mul]
@@ -77,9 +74,7 @@ sum of squares, i.e. `weighted_sum_squares` with weight `λ i : ι, 1`. -/
 noncomputable def isometrySumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ) :
     Isometry (weightedSumSquares ℂ w) (weightedSumSquares ℂ (1 : ι → ℂ)) :=
   by
-  have hw1 : (fun i => if (w i : ℂ) = 0 then 0 else 1 : ι → ℂ) = 1 :=
-    by
-    ext i : 1
+  have hw1 : (fun i => if (w i : ℂ) = 0 then 0 else 1 : ι → ℂ) = 1 := by ext i : 1;
     exact dif_neg (w i).NeZero
   have := isometry_sum_squares (coe ∘ w)
   rw [hw1] at this
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.complex
-! leanprover-community/mathlib commit 32b08ef840dd25ca2e47e035c5da03ce16d2dc3c
+! 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.Complex
 
 /-!
 # Quadratic forms over the complex numbers
Diff
@@ -57,7 +57,7 @@ noncomputable def isometrySumSquares [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, smul_eq_mul]
   split_ifs
   · simp only [h, zero_smul, MulZeroClass.zero_mul]
Diff
@@ -39,8 +39,7 @@ noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
     by
     intro i hi
     exact (w i).NeZero ((Complex.cpow_eq_zero_iff _ _).1 hi).1
-  convert
-    (weighted_sum_squares ℂ w').isometryBasisRepr
+  convert(weighted_sum_squares ℂ w').isometryBasisRepr
       ((Pi.basisFun ℂ ι).units_smul fun i => (isUnit_iff_ne_zero.2 <| hw' i).Unit)
   ext1 v
   erw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply]
Diff
@@ -54,13 +54,14 @@ noncomputable def isometrySumSquares [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, smul_eq_mul]
   split_ifs
-  · simp only [h, zero_smul, zero_mul]
+  · simp only [h, zero_smul, MulZeroClass.zero_mul]
   have hww' : w' j = w j := by simp only [w, dif_neg h, Units.val_mk0]
   simp only [hww', one_mul]
   change v j * v j = ↑(w j) * (v j * ↑(w j) ^ (-(1 / 2 : ℂ)) * (v j * ↑(w j) ^ (-(1 / 2 : ℂ))))

Changes in mathlib4

mathlib3
mathlib4
chore: prepare Lean version bump with explicit simp (#10999)

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

Diff
@@ -54,7 +54,7 @@ noncomputable def isometryEquivSumSquares (w' : ι → ℂ) :
   erw [hsum, smul_eq_mul]
   split_ifs with h
   · simp only [h, zero_smul, zero_mul]
-  have hww' : w' j = w j := by simp only [dif_neg h, Units.val_mk0]
+  have hww' : w' j = w j := by simp only [w, dif_neg h, Units.val_mk0]
   simp (config := {zeta := false}) only [one_mul, Units.val_mk0, smul_eq_mul]
   rw [hww']
   suffices v j * v j = w j ^ (-(1 / 2 : ℂ)) * w j ^ (-(1 / 2 : ℂ)) * w j * v j * v j by
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
@@ -73,7 +73,7 @@ noncomputable def isometryEquivSumSquaresUnits (w : ι → Units ℂ) :
 /-- A nondegenerate quadratic form on the complex numbers is equivalent to
 the sum of squares, i.e. `weightedSumSquares` with weight `fun (i : ι) => 1`. -/
 theorem equivalent_sum_squares {M : Type*} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
-    (Q : QuadraticForm ℂ M) (hQ : (associated (R := ℂ) Q).Nondegenerate) :
+    (Q : QuadraticForm ℂ M) (hQ : (associated (R := ℂ) Q).SeparatingLeft) :
     Equivalent Q (weightedSumSquares ℂ (1 : Fin (FiniteDimensional.finrank ℂ M) → ℂ)) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
   ⟨hw₁.trans (isometryEquivSumSquaresUnits w)⟩
@@ -81,8 +81,8 @@ theorem equivalent_sum_squares {M : Type*} [AddCommGroup M] [Module ℂ M] [Fini
 
 /-- All nondegenerate quadratic forms on the complex numbers are equivalent. -/
 theorem complex_equivalent {M : Type*} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
-    (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated (R := ℂ) Q₁).Nondegenerate)
-    (hQ₂ : (associated (R := ℂ) Q₂).Nondegenerate) : Equivalent Q₁ Q₂ :=
+    (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated (R := ℂ) Q₁).SeparatingLeft)
+    (hQ₂ : (associated (R := ℂ) Q₂).SeparatingLeft) : Equivalent Q₁ Q₂ :=
   (Q₁.equivalent_sum_squares hQ₁).trans (Q₂.equivalent_sum_squares hQ₂).symm
 #align quadratic_form.complex_equivalent QuadraticForm.complex_equivalent
 
chore(QuadraticForm): Fintype -> Finite, DecidableEq (#10462)
Diff
@@ -27,7 +27,7 @@ variable {ι : Type*} [Fintype ι]
 
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weightedSumSquares` with weights 1 or 0. -/
-noncomputable def isometryEquivSumSquares [DecidableEq ι] (w' : ι → ℂ) :
+noncomputable def isometryEquivSumSquares (w' : ι → ℂ) :
     IsometryEquiv (weightedSumSquares ℂ w')
       (weightedSumSquares ℂ (fun i => if w' i = 0 then 0 else 1 : ι → ℂ)) := by
   let w i := if h : w' i = 0 then (1 : Units ℂ) else Units.mk0 (w' i) h
@@ -41,6 +41,7 @@ noncomputable def isometryEquivSumSquares [DecidableEq ι] (w' : ι → ℂ) :
   refine' sum_congr rfl fun j hj => _
   have hsum : (∑ i : ι, v i • ((isUnit_iff_ne_zero.2 <| hw' i).unit : ℂ) • (Pi.basisFun ℂ ι) i) j =
       v j • w 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]
@@ -64,7 +65,7 @@ noncomputable def isometryEquivSumSquares [DecidableEq ι] (w' : ι → ℂ) :
 
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weightedSumSquares` with weight `fun (i : ι) => 1`. -/
-noncomputable def isometryEquivSumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ) :
+noncomputable def isometryEquivSumSquaresUnits (w : ι → Units ℂ) :
     IsometryEquiv (weightedSumSquares ℂ w) (weightedSumSquares ℂ (1 : ι → ℂ)) := by
   simpa using isometryEquivSumSquares ((↑) ∘ w)
 #align quadratic_form.isometry_sum_squares_units QuadraticForm.isometryEquivSumSquaresUnits
chore: bump toolchain to v4.3.0-rc1 (#8051)

This incorporates changes from

  • #7845
  • #7847
  • #7853
  • #7872 (was never actually made to work, but the diffs in nightly-testing are unexciting: we need to fully qualify a few names)

They can all be closed when this is merged.

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

Diff
@@ -54,7 +54,7 @@ noncomputable def isometryEquivSumSquares [DecidableEq ι] (w' : ι → ℂ) :
   split_ifs with h
   · simp only [h, zero_smul, zero_mul]
   have hww' : w' j = w j := by simp only [dif_neg h, Units.val_mk0]
-  simp only [one_mul, Units.val_mk0, smul_eq_mul]
+  simp (config := {zeta := false}) only [one_mul, Units.val_mk0, smul_eq_mul]
   rw [hww']
   suffices v j * v j = w j ^ (-(1 / 2 : ℂ)) * w j ^ (-(1 / 2 : ℂ)) * w j * v j * v j by
     rw [this]; ring
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
@@ -72,7 +72,7 @@ noncomputable def isometryEquivSumSquaresUnits [DecidableEq ι] (w : ι → Unit
 /-- A nondegenerate quadratic form on the complex numbers is equivalent to
 the sum of squares, i.e. `weightedSumSquares` with weight `fun (i : ι) => 1`. -/
 theorem equivalent_sum_squares {M : Type*} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
-    (Q : QuadraticForm ℂ M) (hQ : (associated (R₁ := ℂ) Q).Nondegenerate) :
+    (Q : QuadraticForm ℂ M) (hQ : (associated (R := ℂ) Q).Nondegenerate) :
     Equivalent Q (weightedSumSquares ℂ (1 : Fin (FiniteDimensional.finrank ℂ M) → ℂ)) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
   ⟨hw₁.trans (isometryEquivSumSquaresUnits w)⟩
@@ -80,8 +80,8 @@ theorem equivalent_sum_squares {M : Type*} [AddCommGroup M] [Module ℂ M] [Fini
 
 /-- All nondegenerate quadratic forms on the complex numbers are equivalent. -/
 theorem complex_equivalent {M : Type*} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
-    (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated (R₁ := ℂ) Q₁).Nondegenerate)
-    (hQ₂ : (associated (R₁ := ℂ) Q₂).Nondegenerate) : Equivalent Q₁ Q₂ :=
+    (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated (R := ℂ) Q₁).Nondegenerate)
+    (hQ₂ : (associated (R := ℂ) Q₂).Nondegenerate) : Equivalent Q₁ Q₂ :=
   (Q₁.equivalent_sum_squares hQ₁).trans (Q₂.equivalent_sum_squares hQ₂).symm
 #align quadratic_form.complex_equivalent QuadraticForm.complex_equivalent
 
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
@@ -47,12 +47,12 @@ noncomputable def isometryEquivSumSquares [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, smul_eq_mul]
   split_ifs with h
-  · simp only [h, zero_smul, MulZeroClass.zero_mul]
+  · simp only [h, zero_smul, zero_mul]
   have hww' : w' j = w j := by simp only [dif_neg h, Units.val_mk0]
   simp only [one_mul, Units.val_mk0, smul_eq_mul]
   rw [hww']
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
@@ -23,7 +23,7 @@ open scoped BigOperators
 
 open Finset
 
-variable {ι : Type _} [Fintype ι]
+variable {ι : Type*} [Fintype ι]
 
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weightedSumSquares` with weights 1 or 0. -/
@@ -71,7 +71,7 @@ noncomputable def isometryEquivSumSquaresUnits [DecidableEq ι] (w : ι → Unit
 
 /-- A nondegenerate quadratic form on the complex numbers is equivalent to
 the sum of squares, i.e. `weightedSumSquares` with weight `fun (i : ι) => 1`. -/
-theorem equivalent_sum_squares {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
+theorem equivalent_sum_squares {M : Type*} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
     (Q : QuadraticForm ℂ M) (hQ : (associated (R₁ := ℂ) Q).Nondegenerate) :
     Equivalent Q (weightedSumSquares ℂ (1 : Fin (FiniteDimensional.finrank ℂ M) → ℂ)) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
@@ -79,7 +79,7 @@ theorem equivalent_sum_squares {M : Type _} [AddCommGroup M] [Module ℂ M] [Fin
 #align quadratic_form.equivalent_sum_squares QuadraticForm.equivalent_sum_squares
 
 /-- All nondegenerate quadratic forms on the complex numbers are equivalent. -/
-theorem complex_equivalent {M : Type _} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
+theorem complex_equivalent {M : Type*} [AddCommGroup M] [Module ℂ M] [FiniteDimensional ℂ M]
     (Q₁ Q₂ : QuadraticForm ℂ M) (hQ₁ : (associated (R₁ := ℂ) Q₁).Nondegenerate)
     (hQ₂ : (associated (R₁ := ℂ) Q₂).Nondegenerate) : Equivalent Q₁ Q₂ :=
   (Q₁.equivalent_sum_squares hQ₁).trans (Q₂.equivalent_sum_squares hQ₂).symm
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.Complex
 
 #align_import linear_algebra.quadratic_form.complex from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
@@ -27,14 +27,14 @@ variable {ι : Type _} [Fintype ι]
 
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weightedSumSquares` with weights 1 or 0. -/
-noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
-    Isometry (weightedSumSquares ℂ w')
+noncomputable def isometryEquivSumSquares [DecidableEq ι] (w' : ι → ℂ) :
+    IsometryEquiv (weightedSumSquares ℂ w')
       (weightedSumSquares ℂ (fun i => if w' i = 0 then 0 else 1 : ι → ℂ)) := by
   let w i := if h : w' i = 0 then (1 : Units ℂ) else Units.mk0 (w' i) h
   have hw' : ∀ i : ι, (w i : ℂ) ^ (-(1 / 2 : ℂ)) ≠ 0 := by
     intro i hi
     exact (w i).ne_zero ((Complex.cpow_eq_zero_iff _ _).1 hi).1
-  convert (weightedSumSquares ℂ w').isometryBasisRepr
+  convert (weightedSumSquares ℂ w').isometryEquivBasisRepr
     ((Pi.basisFun ℂ ι).unitsSMul fun i => (isUnit_iff_ne_zero.2 <| hw' i).unit)
   ext1 v
   erw [basisRepr_apply, weightedSumSquares_apply, weightedSumSquares_apply]
@@ -60,14 +60,14 @@ noncomputable def isometrySumSquares [DecidableEq ι] (w' : ι → ℂ) :
     rw [this]; ring
   rw [← Complex.cpow_add _ _ (w j).ne_zero, show -(1 / 2 : ℂ) + -(1 / 2) = -1 by simp [← two_mul],
     Complex.cpow_neg_one, inv_mul_cancel (w j).ne_zero, one_mul]
-#align quadratic_form.isometry_sum_squares QuadraticForm.isometrySumSquares
+#align quadratic_form.isometry_sum_squares QuadraticForm.isometryEquivSumSquares
 
 /-- The isometry between a weighted sum of squares on the complex numbers and the
 sum of squares, i.e. `weightedSumSquares` with weight `fun (i : ι) => 1`. -/
-noncomputable def isometrySumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ) :
-    Isometry (weightedSumSquares ℂ w) (weightedSumSquares ℂ (1 : ι → ℂ)) := by
-  simpa using isometrySumSquares ((↑) ∘ w)
-#align quadratic_form.isometry_sum_squares_units QuadraticForm.isometrySumSquaresUnits
+noncomputable def isometryEquivSumSquaresUnits [DecidableEq ι] (w : ι → Units ℂ) :
+    IsometryEquiv (weightedSumSquares ℂ w) (weightedSumSquares ℂ (1 : ι → ℂ)) := by
+  simpa using isometryEquivSumSquares ((↑) ∘ w)
+#align quadratic_form.isometry_sum_squares_units QuadraticForm.isometryEquivSumSquaresUnits
 
 /-- A nondegenerate quadratic form on the complex numbers is equivalent to
 the sum of squares, i.e. `weightedSumSquares` with weight `fun (i : ι) => 1`. -/
@@ -75,7 +75,7 @@ theorem equivalent_sum_squares {M : Type _} [AddCommGroup M] [Module ℂ M] [Fin
     (Q : QuadraticForm ℂ M) (hQ : (associated (R₁ := ℂ) Q).Nondegenerate) :
     Equivalent Q (weightedSumSquares ℂ (1 : Fin (FiniteDimensional.finrank ℂ M) → ℂ)) :=
   let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weightedSumSquares_units_of_nondegenerate' hQ
-  ⟨hw₁.trans (isometrySumSquaresUnits w)⟩
+  ⟨hw₁.trans (isometryEquivSumSquaresUnits w)⟩
 #align quadratic_form.equivalent_sum_squares QuadraticForm.equivalent_sum_squares
 
 /-- All nondegenerate quadratic forms on the complex numbers are equivalent. -/
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,15 +2,12 @@
 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.complex
-! 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.Complex
 
+#align_import linear_algebra.quadratic_form.complex from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
+
 /-!
 # Quadratic forms over the complex numbers
 
feat: port LinearAlgebra.QuadraticForm.Complex (#4733)

Dependencies 12 + 827

828 files ported (98.6%)
365657 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