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

Commit d9934b2

Browse files
pecherskyjcommelin
andcommitted
feat(linear_algebra/basic): curry is linear_equiv (#3012)
Currying provides a linear_equiv. This can be used to show that matrix lookup is a linear operation. This should allow to easily provide a finite_dimensional instance for matrices. Co-authored-by: Johan Commelin <johan@commelin.net>
1 parent 6a0412e commit d9934b2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/linear_algebra/basic.lean

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/-
22
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov
4+
Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Yakov Pechersky
55
-/
66
import algebra.pi_instances
77
import data.finsupp
@@ -1641,6 +1641,24 @@ rfl
16411641

16421642
end prod
16431643

1644+
section uncurry
1645+
1646+
variables (V V₂ R)
1647+
1648+
/-- Linear equivalence between a curried and uncurried function.
1649+
Differs from `tensor_product.curry`. -/
1650+
protected def uncurry :
1651+
(V → V₂ → R) ≃ₗ[R] (V × V₂ → R) :=
1652+
{ add := λ _ _, by { ext z, cases z, refl },
1653+
smul := λ _ _, by { ext z, cases z, refl },
1654+
.. equiv.arrow_arrow_equiv_prod_arrow _ _ _}
1655+
1656+
@[simp] lemma coe_uncurry : ⇑(linear_equiv.uncurry R V V₂) = uncurry := rfl
1657+
1658+
@[simp] lemma coe_uncurry_symm : ⇑(linear_equiv.uncurry R V V₂).symm = curry := rfl
1659+
1660+
end uncurry
1661+
16441662
section
16451663
variables {semimodule_M : semimodule R M} {semimodule_M₂ : semimodule R M₂}
16461664
variables (f : M →ₗ[R] M₂) (g : M₂ →ₗ[R] M) (e : M ≃ₗ[R] M₂)

0 commit comments

Comments
 (0)