@@ -90,14 +90,15 @@ end quadratic_form
90
90
variables [module R M] [module R₁ M]
91
91
92
92
open quadratic_form
93
- /-- A quadratic form over a module. -/
93
+ /-- A quadratic form over a module.
94
+
95
+ Note we only need the left lemmas about `quadratic_form.polar` as the right lemmas follow from
96
+ `quadratic_form.polar_comm`. -/
94
97
structure quadratic_form (R : Type u) (M : Type v) [ring R] [add_comm_group M] [module R M] :=
95
98
(to_fun : M → R)
96
99
(to_fun_smul : ∀ (a : R) (x : M), to_fun (a • x) = a * a * to_fun x)
97
100
(polar_add_left' : ∀ (x x' y : M), polar to_fun (x + x') y = polar to_fun x y + polar to_fun x' y)
98
101
(polar_smul_left' : ∀ (a : R) (x y : M), polar to_fun (a • x) y = a • polar to_fun x y)
99
- (polar_add_right' : ∀ (x y y' : M), polar to_fun x (y + y') = polar to_fun x y + polar to_fun x y')
100
- (polar_smul_right' : ∀ (a : R) (x y : M), polar to_fun x (a • y) = a • polar to_fun x y)
101
102
102
103
namespace quadratic_form
103
104
@@ -163,12 +164,12 @@ by simp only [add_zero, polar, quadratic_form.map_zero, sub_self]
163
164
@[simp]
164
165
lemma polar_add_right (x y y' : M) :
165
166
polar Q x (y + y') = polar Q x y + polar Q x y' :=
166
- Q.polar_add_right' x y y'
167
+ by rw [polar_comm Q x, polar_comm Q x, polar_comm Q x, polar_add_left]
167
168
168
169
@[simp]
169
170
lemma polar_smul_right (a : R) (x y : M) :
170
171
polar Q x (a • y) = a * polar Q x y :=
171
- Q.polar_smul_right' a x y
172
+ by rw [polar_comm Q x, polar_comm Q x, polar_smul_left]
172
173
173
174
@[simp]
174
175
lemma polar_neg_right (x y : M) :
@@ -222,9 +223,7 @@ protected def copy (Q : quadratic_form R M) (Q' : M → R) (h : Q' = ⇑Q) : qua
222
223
{ to_fun := Q',
223
224
to_fun_smul := h.symm ▸ Q.to_fun_smul,
224
225
polar_add_left' := h.symm ▸ Q.polar_add_left',
225
- polar_smul_left' := h.symm ▸ Q.polar_smul_left',
226
- polar_add_right' := h.symm ▸ Q.polar_add_right',
227
- polar_smul_right' := h.symm ▸ Q.polar_smul_right' }
226
+ polar_smul_left' := h.symm ▸ Q.polar_smul_left' }
228
227
229
228
section has_scalar
230
229
@@ -240,10 +239,6 @@ instance : has_scalar S (quadratic_form R M) :=
240
239
polar_add_left' := λ x x' y, by simp only [polar_smul, polar_add_left, smul_add],
241
240
polar_smul_left' := λ b x y, begin
242
241
simp only [polar_smul, polar_smul_left, ←mul_smul_comm, smul_eq_mul],
243
- end ,
244
- polar_add_right' := λ x y y', by simp only [polar_smul, polar_add_right, smul_add],
245
- polar_smul_right' := λ b x y, begin
246
- simp only [polar_smul, polar_smul_right, ←mul_smul_comm, smul_eq_mul],
247
242
end } ⟩
248
243
249
244
@[simp] lemma coe_fn_smul (a : S) (Q : quadratic_form R M) : ⇑(a • Q) = a • Q := rfl
@@ -257,9 +252,7 @@ instance : has_zero (quadratic_form R M) :=
257
252
⟨ { to_fun := λ x, 0 ,
258
253
to_fun_smul := λ a x, by simp only [mul_zero],
259
254
polar_add_left' := λ x x' y, by simp only [add_zero, polar, sub_self],
260
- polar_smul_left' := λ a x y, by simp only [polar, smul_zero, sub_self],
261
- polar_add_right' := λ x y y', by simp only [add_zero, polar, sub_self],
262
- polar_smul_right' := λ a x y, by simp only [polar, smul_zero, sub_self]} ⟩
255
+ polar_smul_left' := λ a x y, by simp only [polar, smul_zero, sub_self] } ⟩
263
256
264
257
@[simp] lemma coe_fn_zero : ⇑(0 : quadratic_form R M) = 0 := rfl
265
258
@@ -275,11 +268,7 @@ instance : has_add (quadratic_form R M) :=
275
268
polar_add_left' := λ x x' y,
276
269
by simp only [polar_add, polar_add_left, add_assoc, add_left_comm],
277
270
polar_smul_left' := λ a x y,
278
- by simp only [polar_add, smul_eq_mul, mul_add, polar_smul_left],
279
- polar_add_right' := λ x y y',
280
- by simp only [polar_add, polar_add_right, add_assoc, add_left_comm],
281
- polar_smul_right' := λ a x y,
282
- by simp only [polar_add, smul_eq_mul, mul_add, polar_smul_right] } ⟩
271
+ by simp only [polar_add, smul_eq_mul, mul_add, polar_smul_left], } ⟩
283
272
284
273
@[simp] lemma coe_fn_add (Q Q' : quadratic_form R M) : ⇑(Q + Q') = Q + Q' := rfl
285
274
@@ -293,11 +282,7 @@ instance : has_neg (quadratic_form R M) :=
293
282
polar_add_left' := λ x x' y,
294
283
by simp only [polar_neg, polar_add_left, neg_add],
295
284
polar_smul_left' := λ a x y,
296
- by simp only [polar_neg, polar_smul_left, mul_neg, smul_eq_mul],
297
- polar_add_right' := λ x y y',
298
- by simp only [polar_neg, polar_add_right, neg_add],
299
- polar_smul_right' := λ a x y,
300
- by simp only [polar_neg, polar_smul_right, mul_neg, smul_eq_mul] } ⟩
285
+ by simp only [polar_neg, polar_smul_left, mul_neg, smul_eq_mul], } ⟩
301
286
302
287
@[simp] lemma coe_fn_neg (Q : quadratic_form R M) : ⇑(-Q) = -Q := rfl
303
288
@@ -374,13 +359,7 @@ def comp (Q : quadratic_form R N) (f : M →ₗ[R] N) :
374
359
simp only [polar, f.map_add],
375
360
polar_smul_left' := λ a x y,
376
361
by convert polar_smul_left a (f x) (f y) using 1 ;
377
- simp only [polar, f.map_smul, f.map_add, smul_eq_mul],
378
- polar_add_right' := λ x y y',
379
- by convert polar_add_right (f x) (f y) (f y') using 1 ;
380
- simp only [polar, f.map_add],
381
- polar_smul_right' := λ a x y,
382
- by convert polar_smul_right a (f x) (f y) using 1 ;
383
- simp only [polar, f.map_smul, f.map_add, smul_eq_mul] }
362
+ simp only [polar, f.map_smul, f.map_add, smul_eq_mul], }
384
363
385
364
@[simp] lemma comp_apply (Q : quadratic_form R N) (f : M →ₗ[R] N) (x : M) :
386
365
(Q.comp f) x = Q (f x) := rfl
@@ -395,38 +374,21 @@ def _root_.linear_map.comp_quadratic_form {S : Type*}
395
374
to_fun_smul := λ b x, by rw [function.comp_apply, Q.map_smul_of_tower b x, f.map_smul,
396
375
smul_eq_mul],
397
376
polar_add_left' := λ x x' y, by simp only [polar_comp, f.map_add, polar_add_left],
398
- polar_smul_left' := λ b x y, by simp only [polar_comp, f.map_smul, polar_smul_left_of_tower],
399
- polar_add_right' := λ x y y', by simp only [polar_comp, f.map_add, polar_add_right],
400
- polar_smul_right' := λ b x y, by simp only [polar_comp, f.map_smul, polar_smul_right_of_tower], }
377
+ polar_smul_left' := λ b x y, by simp only [polar_comp, f.map_smul, polar_smul_left_of_tower], }
401
378
402
379
end comp
403
380
404
381
section comm_ring
405
382
406
- /-- Create a quadratic form in a commutative ring by proving only one side of the bilinearity. -/
407
- def mk_left (f : M → R₁)
408
- (to_fun_smul : ∀ a x, f (a • x) = a * a * f x)
409
- (polar_add_left : ∀ x x' y, polar f (x + x') y = polar f x y + polar f x' y)
410
- (polar_smul_left : ∀ a x y, polar f (a • x) y = a * polar f x y) :
411
- quadratic_form R₁ M :=
412
- { to_fun := f,
413
- to_fun_smul := to_fun_smul,
414
- polar_add_left' := polar_add_left,
415
- polar_smul_left' := polar_smul_left,
416
- polar_add_right' :=
417
- λ x y y', by rw [polar_comm, polar_add_left, polar_comm f y x, polar_comm f y' x],
418
- polar_smul_right' :=
419
- λ a x y, by rw [polar_comm, polar_smul_left, polar_comm f y x, smul_eq_mul] }
420
-
421
383
/-- The product of linear forms is a quadratic form. -/
422
384
def lin_mul_lin (f g : M →ₗ[R₁] R₁) : quadratic_form R₁ M :=
423
- mk_left ( f * g)
424
- ( λ a x,
425
- by { simp only [smul_eq_mul, ring_hom.id_apply, pi.mul_apply, linear_map.map_smulₛₗ], ring })
426
- ( λ x x' y, by { simp only [polar, pi.mul_apply, linear_map.map_add], ring })
427
- ( λ a x y, begin
428
- simp only [polar, pi.mul_apply, linear_map.map_add, linear_map.map_smul, smul_eq_mul], ring
429
- end )
385
+ { to_fun := f * g,
386
+ to_fun_smul := λ a x,
387
+ by { simp only [smul_eq_mul, ring_hom.id_apply, pi.mul_apply, linear_map.map_smulₛₗ], ring },
388
+ polar_add_left' := λ x x' y, by { simp only [polar, pi.mul_apply, linear_map.map_add], ring },
389
+ polar_smul_left' := λ a x y, begin
390
+ simp only [polar, pi.mul_apply, linear_map.map_add, linear_map.map_smul, smul_eq_mul], ring
391
+ end }
430
392
431
393
@[simp]
432
394
lemma lin_mul_lin_apply (f g : M →ₗ[R₁] R₁) (x) : lin_mul_lin f g x = f x * g x := rfl
@@ -486,16 +448,12 @@ by { simp only [add_assoc, add_sub_cancel', add_right, polar, add_left_inj, add_
486
448
487
449
/-- A bilinear form gives a quadratic form by applying the argument twice. -/
488
450
def to_quadratic_form (B : bilin_form R M) : quadratic_form R M :=
489
- ⟨ λ x, B x x,
490
- λ a x, by simp only [mul_assoc, smul_right, smul_left],
491
- λ x x' y, by simp only [add_assoc, add_right, add_left_inj, polar_to_quadratic_form, add_left,
492
- add_left_comm],
493
- λ a x y, by simp only [smul_add, add_left_inj, polar_to_quadratic_form,
494
- smul_right, smul_eq_mul, smul_left, smul_right, mul_add],
495
- λ x y y', by simp only [add_assoc, add_right, add_left_inj,
451
+ { to_fun := λ x, B x x,
452
+ to_fun_smul := λ a x, by simp only [mul_assoc, smul_right, smul_left],
453
+ polar_add_left' := λ x x' y, by simp only [add_assoc, add_right, add_left_inj,
496
454
polar_to_quadratic_form, add_left, add_left_comm],
497
- λ a x y, by simp only [smul_add, add_left_inj, polar_to_quadratic_form,
498
- smul_right, smul_eq_mul, smul_left, smul_right, mul_add]⟩
455
+ polar_smul_left' := λ a x y, by simp only [smul_add, add_left_inj, polar_to_quadratic_form,
456
+ smul_right, smul_eq_mul, smul_left, smul_right, mul_add] }
499
457
500
458
@[simp] lemma to_quadratic_form_apply (B : bilin_form R M) (x : M) :
501
459
B.to_quadratic_form x = B x x :=
0 commit comments