Skip to content

Commit

Permalink
chore(linear_algebra/multilinear_map): Add boring coercion lemmas cop…
Browse files Browse the repository at this point in the history
…ied from ring_hom (#5099)
  • Loading branch information
eric-wieser committed Nov 24, 2020
1 parent 943b129 commit 2ed4846
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/linear_algebra/multilinear.lean
Expand Up @@ -80,8 +80,27 @@ variables [semiring R]

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

initialize_simps_projections multilinear_map (to_fun → apply)

@[simp] lemma to_fun_eq_coe : f.to_fun = f := rfl

@[simp] lemma coe_mk (f : (Π i, M₁ i) → M₂) (h₁ h₂ ) :
⇑(⟨f, h₁, h₂⟩ : multilinear_map R M₁ M₂) = f := rfl

theorem congr_fun {f g : multilinear_map R M₁ M₂} (h : f = g) (x : Π i, M₁ i) : f x = g x :=
congr_arg (λ h : multilinear_map R M₁ M₂, h x) h

theorem congr_arg (f : multilinear_map R M₁ M₂) {x y : Π i, M₁ i} (h : x = y) : f x = f y :=
congr_arg (λ x : Π i, M₁ i, f x) h

theorem coe_inj ⦃f g : multilinear_map R M₁ M₂⦄ (h : ⇑f = g) : f = g :=
by cases f; cases g; cases h; refl

@[ext] theorem ext {f f' : multilinear_map R M₁ M₂} (H : ∀ x, f x = f' x) : f = f' :=
by cases f; cases f'; congr'; exact funext H
coe_inj (funext H)

theorem ext_iff {f g : multilinear_map R M₁ M₂} : f = g ↔ ∀ x, f x = g x :=
⟨λ h x, h ▸ rfl, λ h, ext h⟩

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

0 comments on commit 2ed4846

Please sign in to comment.