refactor: simp golfing
This commit is contained in:
parent
d39c6c3e28
commit
167145acef
8 changed files with 35 additions and 75 deletions
|
@ -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. -/
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue