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

Commit b1c0175

Browse files
urkuderic-wieser
andcommitted
refactor(linear_algebra/dual): make module.dual reducible (#18963)
Otherwise Lean 4 can't apply `simp` lemmas about linear maps to elements of `module.dual`. There is no need for this to be reducible anyway, as all the instances on `dual` agree with the instances on linear maps. Also delete `basis.to_dual_equiv_symm_apply`, which stated `⇑(b.to_dual_equiv.symm) f = ⇑((linear_equiv.of_injective b.to_dual _).symm) (⇑((linear_equiv.of_top (linear_map.range b.to_dual) _).symm) f)` which was hardly helpful. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent 08e1d8d commit b1c0175

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/linear_algebra/dual.lean

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,7 @@ variables (R : Type*) (M : Type*)
9494
variables [comm_semiring R] [add_comm_monoid M] [module R M]
9595

9696
/-- The dual space of an R-module M is the R-module of linear maps `M → R`. -/
97-
@[derive [add_comm_monoid, module R]] def dual := M →ₗ[R] R
98-
99-
instance {S : Type*} [comm_ring S] {N : Type*} [add_comm_group N] [module S N] :
100-
add_comm_group (dual S N) := linear_map.add_comm_group
101-
102-
instance : linear_map_class (dual R M) R M R :=
103-
linear_map.semilinear_map_class
97+
@[reducible] def dual := M →ₗ[R] R
10498

10599
/-- The canonical pairing of a vector space and its algebraic dual. -/
106100
def dual_pairing (R M) [comm_semiring R] [add_comm_monoid M] [module R M] :
@@ -335,11 +329,13 @@ section finite
335329
variables [_root_.finite ι]
336330

337331
/-- A vector space is linearly equivalent to its dual space. -/
338-
@[simps]
339332
def to_dual_equiv : M ≃ₗ[R] dual R M :=
340333
linear_equiv.of_bijective b.to_dual
341334
⟨ker_eq_bot.mp b.to_dual_ker, range_eq_top.mp b.to_dual_range⟩
342335

336+
-- `simps` times out when generating this
337+
@[simp] lemma to_dual_equiv_apply (m : M) : b.to_dual_equiv m = b.to_dual m := rfl
338+
343339
/-- Maps a basis for `V` to a basis for the dual space. -/
344340
def dual_basis : basis ι R (dual R M) := b.map b.to_dual_equiv
345341

0 commit comments

Comments
 (0)