@@ -8,8 +8,6 @@ import algebra.invertible
8
8
import linear_algebra.bilinear_form
9
9
import linear_algebra.matrix.determinant
10
10
import linear_algebra.special_linear_group
11
- import analysis.special_functions.pow
12
- import data.real.sign
13
11
14
12
/-!
15
13
# Quadratic forms
@@ -941,140 +939,4 @@ begin
941
939
exact ⟨λ i, units.mk0 _ (hv₂ i), ⟨Q.isometry_weighted_sum_squares v hv₁⟩⟩,
942
940
end
943
941
944
- section complex
945
-
946
- /-- The isometry between a weighted sum of squares on the complex numbers and the
947
- sum of squares, i.e. `weighted_sum_squares` with weights 1 or 0. -/
948
- noncomputable def isometry_sum_squares [decidable_eq ι] (w' : ι → ℂ) :
949
- isometry (weighted_sum_squares ℂ w')
950
- (weighted_sum_squares ℂ (λ i, if w' i = 0 then 0 else 1 : ι → ℂ)) :=
951
- begin
952
- let w := λ i, if h : w' i = 0 then (1 : units ℂ) else units.mk0 (w' i) h,
953
- have hw' : ∀ i : ι, (w i : ℂ) ^ - (1 / 2 : ℂ) ≠ 0 ,
954
- { intros i hi,
955
- exact (w i).ne_zero ((complex.cpow_eq_zero_iff _ _).1 hi).1 },
956
- convert (weighted_sum_squares ℂ w').isometry_basis_repr
957
- ((pi.basis_fun ℂ ι).units_smul (λ i, (is_unit_iff_ne_zero.2 $ hw' i).unit)),
958
- ext1 v,
959
- erw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply],
960
- refine sum_congr rfl (λ j hj, _),
961
- have hsum : (∑ (i : ι), v i • ((is_unit_iff_ne_zero.2 $ hw' i).unit : ℂ) •
962
- (pi.basis_fun ℂ ι) i) j = v j • w j ^ - (1 / 2 : ℂ),
963
- { rw [finset.sum_apply, sum_eq_single j, pi.basis_fun_apply, is_unit.unit_spec,
964
- linear_map.std_basis_apply, pi.smul_apply, pi.smul_apply, function.update_same,
965
- smul_eq_mul, smul_eq_mul, smul_eq_mul, mul_one],
966
- intros i _ hij,
967
- rw [pi.basis_fun_apply, linear_map.std_basis_apply, pi.smul_apply, pi.smul_apply,
968
- function.update_noteq hij.symm, pi.zero_apply, smul_eq_mul, smul_eq_mul,
969
- mul_zero, mul_zero],
970
- intro hj', exact false.elim (hj' hj) },
971
- simp_rw basis.units_smul_apply,
972
- erw [hsum, smul_eq_mul],
973
- split_ifs,
974
- { simp only [h, zero_smul, zero_mul]},
975
- have hww' : w' j = w j,
976
- { simp only [w, dif_neg h, units.coe_mk0] },
977
- simp only [hww', one_mul],
978
- change v j * v j = ↑(w j) * ((v j * ↑(w j) ^ -(1 / 2 : ℂ)) * (v j * ↑(w j) ^ -(1 / 2 : ℂ))),
979
- suffices : v j * v j = w j ^ - (1 / 2 : ℂ) * w j ^ - (1 / 2 : ℂ) * w j * v j * v j,
980
- { rw [this ], ring },
981
- rw [← complex.cpow_add _ _ (w j).ne_zero, show - (1 / 2 : ℂ) + - (1 / 2 ) = -1 , by ring,
982
- complex.cpow_neg_one, inv_mul_cancel (w j).ne_zero, one_mul],
983
- end
984
-
985
- /-- The isometry between a weighted sum of squares on the complex numbers and the
986
- sum of squares, i.e. `weighted_sum_squares` with weight `λ i : ι, 1`. -/
987
- noncomputable def isometry_sum_squares_units [decidable_eq ι] (w : ι → units ℂ) :
988
- isometry (weighted_sum_squares ℂ w) (weighted_sum_squares ℂ (1 : ι → ℂ)) :=
989
- begin
990
- have hw1 : (λ i, if (w i : ℂ) = 0 then 0 else 1 : ι → ℂ) = 1 ,
991
- { ext i : 1 , exact dif_neg (w i).ne_zero },
992
- have := isometry_sum_squares (coe ∘ w),
993
- rw hw1 at this ,
994
- exact this ,
995
- end
996
-
997
- /-- A nondegenerate quadratic form on the complex numbers is equivalent to
998
- the sum of squares, i.e. `weighted_sum_squares` with weight `λ i : ι, 1`. -/
999
- theorem equivalent_sum_squares {M : Type *} [add_comm_group M] [module ℂ M]
1000
- [finite_dimensional ℂ M] (Q : quadratic_form ℂ M) (hQ : (associated Q).nondegenerate) :
1001
- equivalent Q (weighted_sum_squares ℂ (1 : fin (finite_dimensional.finrank ℂ M) → ℂ)) :=
1002
- let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weighted_sum_squares_units_of_nondegenerate' hQ in
1003
- ⟨hw₁.trans (isometry_sum_squares_units w)⟩
1004
-
1005
- end complex
1006
-
1007
- section real
1008
-
1009
- open real
1010
-
1011
- /-- The isometry between a weighted sum of squares with weights `u` on the
1012
- (non-zero) real numbers and the weighted sum of squares with weights `sign ∘ u`. -/
1013
- noncomputable def isometry_sign_weighted_sum_squares
1014
- [decidable_eq ι] (w : ι → ℝ) :
1015
- isometry (weighted_sum_squares ℝ w) (weighted_sum_squares ℝ (sign ∘ w)) :=
1016
- begin
1017
- let u := λ i, if h : w i = 0 then (1 : units ℝ) else units.mk0 (w i) h,
1018
- have hu' : ∀ i : ι, (sign (u i) * u i) ^ - (1 / 2 : ℝ) ≠ 0 ,
1019
- { intro i, refine (ne_of_lt (real.rpow_pos_of_pos
1020
- (sign_mul_pos_of_ne_zero _ $ units.ne_zero _) _)).symm},
1021
- convert ((weighted_sum_squares ℝ w).isometry_basis_repr
1022
- ((pi.basis_fun ℝ ι).units_smul (λ i, (is_unit_iff_ne_zero.2 $ hu' i).unit))),
1023
- ext1 v,
1024
- rw [basis_repr_apply, weighted_sum_squares_apply, weighted_sum_squares_apply],
1025
- refine sum_congr rfl (λ j hj, _),
1026
- have hsum : (∑ (i : ι), v i • ((is_unit_iff_ne_zero.2 $ hu' i).unit : ℝ) •
1027
- (pi.basis_fun ℝ ι) i) j = v j • (sign (u j) * u j) ^ - (1 / 2 : ℝ),
1028
- { rw [finset.sum_apply, sum_eq_single j, pi.basis_fun_apply, is_unit.unit_spec,
1029
- linear_map.std_basis_apply, pi.smul_apply, pi.smul_apply, function.update_same,
1030
- smul_eq_mul, smul_eq_mul, smul_eq_mul, mul_one],
1031
- intros i _ hij,
1032
- rw [pi.basis_fun_apply, linear_map.std_basis_apply, pi.smul_apply, pi.smul_apply,
1033
- function.update_noteq hij.symm, pi.zero_apply, smul_eq_mul, smul_eq_mul,
1034
- mul_zero, mul_zero],
1035
- intro hj', exact false.elim (hj' hj) },
1036
- simp_rw basis.units_smul_apply,
1037
- erw [hsum],
1038
- simp only [u, function.comp, smul_eq_mul],
1039
- split_ifs,
1040
- { simp only [h, zero_smul, zero_mul, sign_zero] },
1041
- have hwu : w j = u j,
1042
- { simp only [u, dif_neg h, units.coe_mk0] },
1043
- simp only [hwu, units.coe_mk0],
1044
- suffices : (u j : ℝ).sign * v j * v j = (sign (u j) * u j) ^ - (1 / 2 : ℝ) *
1045
- (sign (u j) * u j) ^ - (1 / 2 : ℝ) * u j * v j * v j,
1046
- { erw [← mul_assoc, this ], ring },
1047
- rw [← real.rpow_add (sign_mul_pos_of_ne_zero _ $ units.ne_zero _),
1048
- show - (1 / 2 : ℝ) + - (1 / 2 ) = -1 , by ring, real.rpow_neg_one, mul_inv₀,
1049
- inv_sign, mul_assoc (sign (u j)) (u j)⁻¹,
1050
- inv_mul_cancel (units.ne_zero _), mul_one],
1051
- apply_instance
1052
- end
1053
-
1054
- /-- **Sylvester's law of inertia** : A nondegenerate real quadratic form is equivalent to a weighted
1055
- sum of squares with the weights being ±1. -/
1056
- theorem equivalent_one_neg_one_weighted_sum_squared
1057
- {M : Type *} [add_comm_group M] [module ℝ M] [finite_dimensional ℝ M]
1058
- (Q : quadratic_form ℝ M) (hQ : (associated Q).nondegenerate) :
1059
- ∃ w : fin (finite_dimensional.finrank ℝ M) → ℝ,
1060
- (∀ i, w i = -1 ∨ w i = 1 ) ∧ equivalent Q (weighted_sum_squares ℝ w) :=
1061
- let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weighted_sum_squares_units_of_nondegenerate' hQ in
1062
- ⟨sign ∘ coe ∘ w,
1063
- λ i, sign_apply_eq_of_ne_zero (w i) (w i).ne_zero,
1064
- ⟨hw₁.trans (isometry_sign_weighted_sum_squares (coe ∘ w))⟩⟩
1065
-
1066
- /-- **Sylvester's law of inertia** : A real quadratic form is equivalent to a weighted
1067
- sum of squares with the weights being ±1 or 0. -/
1068
- theorem equivalent_one_zero_neg_one_weighted_sum_squared
1069
- {M : Type *} [add_comm_group M] [module ℝ M] [finite_dimensional ℝ M]
1070
- (Q : quadratic_form ℝ M) :
1071
- ∃ w : fin (finite_dimensional.finrank ℝ M) → ℝ,
1072
- (∀ i, w i = -1 ∨ w i = 0 ∨ w i = 1 ) ∧ equivalent Q (weighted_sum_squares ℝ w) :=
1073
- let ⟨w, ⟨hw₁⟩⟩ := Q.equivalent_weighted_sum_squares in
1074
- ⟨sign ∘ coe ∘ w,
1075
- λ i, sign_apply_eq (w i),
1076
- ⟨hw₁.trans (isometry_sign_weighted_sum_squares w)⟩⟩
1077
-
1078
- end real
1079
-
1080
942
end quadratic_form
0 commit comments