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

Commit 2ed4846

Browse files
committed
chore(linear_algebra/multilinear_map): Add boring coercion lemmas copied from ring_hom (#5099)
1 parent 943b129 commit 2ed4846

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/linear_algebra/multilinear.lean

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,27 @@ variables [semiring R]
8080

8181
instance : has_coe_to_fun (multilinear_map R M₁ M₂) := ⟨_, to_fun⟩
8282

83+
initialize_simps_projections multilinear_map (to_fun → apply)
84+
85+
@[simp] lemma to_fun_eq_coe : f.to_fun = f := rfl
86+
87+
@[simp] lemma coe_mk (f : (Π i, M₁ i) → M₂) (h₁ h₂ ) :
88+
⇑(⟨f, h₁, h₂⟩ : multilinear_map R M₁ M₂) = f := rfl
89+
90+
theorem congr_fun {f g : multilinear_map R M₁ M₂} (h : f = g) (x : Π i, M₁ i) : f x = g x :=
91+
congr_arg (λ h : multilinear_map R M₁ M₂, h x) h
92+
93+
theorem congr_arg (f : multilinear_map R M₁ M₂) {x y : Π i, M₁ i} (h : x = y) : f x = f y :=
94+
congr_arg (λ x : Π i, M₁ i, f x) h
95+
96+
theorem coe_inj ⦃f g : multilinear_map R M₁ M₂⦄ (h : ⇑f = g) : f = g :=
97+
by cases f; cases g; cases h; refl
98+
8399
@[ext] theorem ext {f f' : multilinear_map R M₁ M₂} (H : ∀ x, f x = f' x) : f = f' :=
84-
by cases f; cases f'; congr'; exact funext H
100+
coe_inj (funext H)
101+
102+
theorem ext_iff {f g : multilinear_map R M₁ M₂} : f = g ↔ ∀ x, f x = g x :=
103+
⟨λ h x, h ▸ rfl, λ h, ext h⟩
85104

86105
@[simp] lemma map_add (m : Πi, M₁ i) (i : ι) (x y : M₁ i) :
87106
f (update m i (x + y)) = f (update m i x) + f (update m i y) :=

0 commit comments

Comments
 (0)