@@ -669,7 +669,7 @@ section DualBases
669
669
open Module
670
670
671
671
variable {R M ι : Type *}
672
- variable [CommSemiring R] [AddCommMonoid M] [Module R M] [DecidableEq ι]
672
+ variable [CommSemiring R] [AddCommMonoid M] [Module R M]
673
673
674
674
-- Porting note: replace use_finite_instance tactic
675
675
open Lean.Elab.Tactic in
@@ -682,10 +682,10 @@ elab "use_finite_instance" : tactic => evalUseFiniteInstance
682
682
/-- `e` and `ε` have characteristic properties of a basis and its dual -/
683
683
-- @[nolint has_nonempty_instance] Porting note (#5171): removed
684
684
structure Module.DualBases (e : ι → M) (ε : ι → Dual R M) : Prop where
685
- eval : ∀ i j : ι, ε i (e j) = if i = j then 1 else 0
685
+ eval_same : ∀ i, ε i (e i) = 1
686
+ eval_of_ne : Pairwise fun i j ↦ ε i (e j) = 0
686
687
protected total : ∀ {m : M}, (∀ i, ε i m = 0 ) → m = 0
687
- protected finite : ∀ m : M, { i | ε i m ≠ 0 }.Finite := by
688
- use_finite_instance
688
+ protected finite : ∀ m : M, {i | ε i m ≠ 0 }.Finite := by use_finite_instance
689
689
690
690
end DualBases
691
691
@@ -698,13 +698,13 @@ variable [CommRing R] [AddCommGroup M] [Module R M]
698
698
variable {e : ι → M} {ε : ι → Dual R M}
699
699
700
700
/-- The coefficients of `v` on the basis `e` -/
701
- def coeffs [DecidableEq ι] (h : DualBases e ε) (m : M) : ι →₀ R where
701
+ def coeffs (h : DualBases e ε) (m : M) : ι →₀ R where
702
702
toFun i := ε i m
703
703
support := (h.finite m).toFinset
704
704
mem_support_toFun i := by rw [Set.Finite.mem_toFinset, Set.mem_setOf_eq]
705
705
706
706
@[simp]
707
- theorem coeffs_apply [DecidableEq ι] (h : DualBases e ε) (m : M) (i : ι) : h.coeffs m i = ε i m :=
707
+ theorem coeffs_apply (h : DualBases e ε) (m : M) (i : ι) : h.coeffs m i = ε i m :=
708
708
rfl
709
709
710
710
/-- linear combinations of elements of `e`.
@@ -717,16 +717,16 @@ theorem lc_def (e : ι → M) (l : ι →₀ R) : lc e l = Finsupp.total _ _ R e
717
717
718
718
open Module
719
719
720
- variable [DecidableEq ι] (h : DualBases e ε)
720
+ variable (h : DualBases e ε)
721
721
include h
722
722
723
723
theorem dual_lc (l : ι →₀ R) (i : ι) : ε i (DualBases.lc e l) = l i := by
724
724
rw [lc, _root_.map_finsupp_sum, Finsupp.sum_eq_single i (g := fun a b ↦ (ε i) (b • e a))]
725
725
-- Porting note: cannot get at •
726
726
-- simp only [h.eval, map_smul, smul_eq_mul]
727
- · simp [h.eval , smul_eq_mul]
727
+ · simp [h.eval_same , smul_eq_mul]
728
728
· intro q _ q_ne
729
- simp [q_ne.symm, h.eval , smul_eq_mul]
729
+ simp [h.eval_of_ne q_ne.symm , smul_eq_mul]
730
730
· simp
731
731
732
732
@[simp]
@@ -741,7 +741,7 @@ theorem lc_coeffs (m : M) : DualBases.lc e (h.coeffs m) = m := by
741
741
simp [LinearMap.map_sub, h.dual_lc, sub_eq_zero]
742
742
743
743
/-- `(h : DualBases e ε).basis` shows the family of vectors `e` forms a basis. -/
744
- @[simps]
744
+ @[simps repr_apply, simps (config := .lemmasOnly) repr_symm_apply ]
745
745
def basis : Basis ι R M :=
746
746
Basis.ofRepr
747
747
{ toFun := coeffs h
@@ -755,30 +755,24 @@ def basis : Basis ι R M :=
755
755
ext i
756
756
exact (ε i).map_smul c v }
757
757
758
- -- Porting note: from simpNF the LHS simplifies; it yields lc_def.symm
759
- -- probably not a useful simp lemma; nolint simpNF since it cannot see this removal
760
- attribute [-simp, nolint simpNF] basis_repr_symm_apply
761
-
762
758
@[simp]
763
759
theorem coe_basis : ⇑h.basis = e := by
764
760
ext i
765
761
rw [Basis.apply_eq_iff]
766
762
ext j
767
- rw [h.basis_repr_apply, coeffs_apply, h.eval, Finsupp.single_apply]
768
- convert if_congr (eq_comm (a := j) (b := i)) rfl rfl
763
+ rcases eq_or_ne i j with rfl | hne
764
+ · simp [h.eval_same]
765
+ · simp [hne, h.eval_of_ne hne.symm]
769
766
770
- -- `convert` to get rid of a `DecidableEq` mismatch
771
767
theorem mem_of_mem_span {H : Set ι} {x : M} (hmem : x ∈ Submodule.span R (e '' H)) :
772
768
∀ i : ι, ε i x ≠ 0 → i ∈ H := by
773
769
intro i hi
774
770
rcases (Finsupp.mem_span_image_iff_total _).mp hmem with ⟨l, supp_l, rfl⟩
775
771
apply not_imp_comm.mp ((Finsupp.mem_supported' _ _).mp supp_l i)
776
772
rwa [← lc_def, h.dual_lc] at hi
777
773
778
- theorem coe_dualBasis [_root_.Finite ι] : ⇑h.basis.dualBasis = ε :=
779
- funext fun i =>
780
- h.basis.ext fun j => by
781
- rw [h.basis.dualBasis_apply_self, h.coe_basis, h.eval, if_congr eq_comm rfl rfl]
774
+ theorem coe_dualBasis [DecidableEq ι] [_root_.Finite ι] : ⇑h.basis.dualBasis = ε :=
775
+ funext fun i => h.basis.ext fun j => by simp
782
776
783
777
end Module.DualBases
784
778
0 commit comments