refactor: simp golfing

This commit is contained in:
jstoobysmith 2024-08-30 10:11:55 -04:00
parent d39c6c3e28
commit 167145acef
8 changed files with 35 additions and 75 deletions

View file

@ -42,12 +42,8 @@ def chargesMapOfSpeciesMap {n m : } (f : (SMSpecies n).Charges →ₗ[] (S
def speciesFamilyProj {m n : } (h : n ≤ m) :
(SMSpecies m).Charges →ₗ[] (SMSpecies n).Charges where
toFun S := S ∘ Fin.castLE h
map_add' S T := by
funext i
simp
map_smul' a S := by
funext i
simp [HSMul.hSMul]
map_add' _ _ := rfl
map_smul' _ _ := rfl
--rw [show Rat.cast a = a from rfl]
/-- The projection of the `m`-family charges onto the first `n`-family charges. -/
@ -77,7 +73,7 @@ def speciesEmbed (m n : ) :
by_cases hi : i.val < m
· erw [dif_pos hi, dif_pos hi]
· erw [dif_neg hi, dif_neg hi]
simp
exact Eq.symm (Rat.mul_zero a)
/-- The embedding of the `m`-family charges onto the `n`-family charges, with all
other charges zero. -/
@ -89,14 +85,9 @@ a universal manor. -/
@[simps!]
def speciesFamilyUniversial (n : ) :
(SMSpecies 1).Charges →ₗ[] (SMSpecies n).Charges where
toFun S _ := S ⟨0, by simp⟩
map_add' S T := by
funext _
simp
map_smul' a S := by
funext i
simp [HSMul.hSMul]
--rw [show Rat.cast a = a from rfl]
toFun S _ := S ⟨0, Nat.zero_lt_succ 0⟩
map_add' _ _ := rfl
map_smul' _ _ := rfl
/-- The embedding of the `1`-family charges into the `n`-family charges in
a universal manor. -/

View file

@ -125,8 +125,7 @@ def bijection : linearParameters ≃ (SMNoGrav 1).LinSols where
repeat erw [speciesVal]
simp only [asCharges, neg_add_rev]
ring
· simp only [toSpecies_apply]
rfl
· rfl
right_inv S := by
simp only [Fin.isValue, toSpecies_apply]
apply ACCSystemLinear.LinSols.ext