Skip to content

Commit

Permalink
chore(linear_algebra/quadratic_form): Add missing simp lemmas about q…
Browse files Browse the repository at this point in the history
…uadratic_form.polar (#5748)
  • Loading branch information
eric-wieser authored and b-mehta committed Jan 16, 2021
1 parent b0f9eef commit 210381c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/linear_algebra/quadratic_form.lean
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ lemma polar_smul_left (a : R) (x y : M) :
polar Q (a • x) y = a * polar Q x y :=
Q.polar_smul_left' a x y

@[simp]
lemma polar_neg_left (x y : M) :
polar Q (-x) y = -polar Q x y :=
by rw [←neg_one_smul R x, polar_smul_left, neg_one_mul]

@[simp]
lemma polar_sub_left (x x' y : M) :
polar Q (x - x') y = polar Q x y - polar Q x' y :=
by rw [sub_eq_add_neg, sub_eq_add_neg, polar_add_left, polar_neg_left]

@[simp]
lemma polar_add_right (x y y' : M) :
polar Q x (y + y') = polar Q x y + polar Q x y' :=
Expand All @@ -122,15 +132,25 @@ lemma polar_smul_right (a : R) (x y : M) :
polar Q x (a • y) = a * polar Q x y :=
Q.polar_smul_right' a x y

@[simp]
lemma polar_neg_right (x y : M) :
polar Q x (-y) = -polar Q x y :=
by rw [←neg_one_smul R y, polar_smul_right, neg_one_mul]

@[simp]
lemma polar_sub_right (x y y' : M) :
polar Q x (y - y') = polar Q x y - polar Q x y' :=
by rw [sub_eq_add_neg, sub_eq_add_neg, polar_add_right, polar_neg_right]

lemma map_smul (a : R) (x : M) : Q (a • x) = a * a * Q x := Q.to_fun_smul a x

lemma map_add_self (x : M) : Q (x + x) = 4 * Q x :=
by { rw [←one_smul R x, ←add_smul, map_smul], norm_num }

lemma map_zero : Q 0 = 0 :=
@[simp] lemma map_zero : Q 0 = 0 :=
by rw [←@zero_smul R _ _ _ _ (0 : M), map_smul, zero_mul, zero_mul]

lemma map_neg (x : M) : Q (-x) = Q x :=
@[simp] lemma map_neg (x : M) : Q (-x) = Q x :=
by rw [←@neg_one_smul R _ _ _ _ x, map_smul, neg_one_mul, neg_neg, one_mul]

lemma map_sub (x y : M) : Q (x - y) = Q (y - x) :=
Expand Down

0 comments on commit 210381c

Please sign in to comment.