Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 1ef65c9

Browse files
committed
feat(linear_algebra/quadratic_form): more constructions for quadratic forms (#2949)
Define multiplication of two linear forms to give a quadratic form and addition of quadratic forms. With these definitions, we can write a generic binary quadratic form as `a • proj R₁ 0 0 + b • proj R₁ 0 1 + c • proj R₁ 1 1 : quadratic_form R₁ (fin 2 → R₁)`. In order to prove the linearity conditions on the constructions, there are new `simp` lemmas `polar_add_left`, `polar_smul_left`, `polar_add_right` and `polar_smul_right` copying from the corresponding fields of the `quadratic_form` structure, that use `⇑ Q` instead of `Q.to_fun`. The original field names have a `'` appended to avoid name clashes.
1 parent 31ceb62 commit 1ef65c9

File tree

2 files changed

+256
-62
lines changed

2 files changed

+256
-62
lines changed

src/linear_algebra/bilinear_form.lean

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,36 @@ B.comp linear_map.id f
210210

211211
end comp
212212

213+
section lin_mul_lin
214+
215+
variables {R₂ : Type*} [comm_ring R₂] [module R₂ M] {N : Type w} [add_comm_group N] [module R₂ N]
216+
217+
/-- `lin_mul_lin f g` is the bilinear form mapping `x` and `y` to `f x * g y` -/
218+
def lin_mul_lin (f g : M →ₗ[R₂] R₂) : bilin_form R₂ M :=
219+
{ bilin := λ x y, f x * g y,
220+
bilin_add_left := λ x y z, by simp [add_mul],
221+
bilin_smul_left := λ x y z, by simp [mul_assoc],
222+
bilin_add_right := λ x y z, by simp [mul_add],
223+
bilin_smul_right := λ x y z, by simp [mul_left_comm] }
224+
225+
variables {f g : M →ₗ[R₂] R₂}
226+
227+
@[simp] lemma lin_mul_lin_apply (x y) : lin_mul_lin f g x y = f x * g y := rfl
228+
229+
@[simp] lemma lin_mul_lin_comp (l r : N →ₗ[R₂] M) :
230+
(lin_mul_lin f g).comp l r = lin_mul_lin (f.comp l) (g.comp r) :=
231+
rfl
232+
233+
@[simp] lemma lin_mul_lin_comp_left (l : M →ₗ[R₂] M) :
234+
(lin_mul_lin f g).comp_left l = lin_mul_lin (f.comp l) g :=
235+
rfl
236+
237+
@[simp] lemma lin_mul_lin_comp_right (r : M →ₗ[R₂] M) :
238+
(lin_mul_lin f g).comp_right r = lin_mul_lin f (g.comp r) :=
239+
rfl
240+
241+
end lin_mul_lin
242+
213243
/-- The proposition that two elements of a bilinear form space are orthogonal -/
214244
def is_ortho (B : bilin_form R M) (x y : M) : Prop :=
215245
B x y = 0

0 commit comments

Comments
 (0)