Skip to content

Commit

Permalink
chore(topology/algebra/module/basic): add continuous_linear_map.copy (#…
Browse files Browse the repository at this point in the history
…13166)

As suggested by the fun_like docs
  • Loading branch information
eric-wieser committed Apr 4, 2022
1 parent 05e2fc0 commit a925d1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/topology/algebra/module/basic.lean
Expand Up @@ -383,6 +383,12 @@ fun_like.ext f g h
theorem ext_iff {f g : M₁ →SL[σ₁₂] M₂} : f = g ↔ ∀ x, f x = g x :=
fun_like.ext_iff

/-- Copy of a `continuous_linear_map` with a new `to_fun` equal to the old one. Useful to fix
definitional equalities. -/
protected def copy (f : M₁ →SL[σ₁₂] M₂) (f' : M₁ → M₂) (h : f' = ⇑f) : M₁ →SL[σ₁₂] M₂ :=
{ to_linear_map := f.to_linear_map.copy f' h,
cont := show continuous f', from h.symm ▸ f.continuous }

-- make some straightforward lemmas available to `simp`.
protected lemma map_zero (f : M₁ →SL[σ₁₂] M₂) : f (0 : M₁) = 0 := map_zero f
protected lemma map_add (f : M₁ →SL[σ₁₂] M₂) (x y : M₁) : f (x + y) = f x + f y := map_add f x y
Expand Down

0 comments on commit a925d1d

Please sign in to comment.