refactor: More simps

This commit is contained in:
jstoobysmith 2024-10-12 08:42:20 +00:00
parent 4a396783ab
commit 269f4d53a7
16 changed files with 139 additions and 62 deletions

View file

@ -35,7 +35,7 @@ def BL₁ : (PlusU1 1).Sols where
| (5 : Fin 6) => 3
linearSol := by
intro i
simp at i
simp only [PlusU1_numberLinear] at i
match i with
| 0 => rfl
| 1 => rfl
@ -43,7 +43,7 @@ def BL₁ : (PlusU1 1).Sols where
| 3 => rfl
quadSol := by
intro i
simp at i
simp only [PlusU1_numberQuadratic] at i
match i with
| 0 => rfl
cubicSol := by rfl

View file

@ -40,27 +40,27 @@ variable {n : }
lemma gravSol (S : (PlusU1 n).LinSols) : accGrav S.val = 0 := by
have hS := S.linearSol
simp at hS
simp only [PlusU1_numberLinear, PlusU1_linearACCs, Fin.isValue] at hS
exact hS 0
lemma SU2Sol (S : (PlusU1 n).LinSols) : accSU2 S.val = 0 := by
have hS := S.linearSol
simp at hS
simp only [PlusU1_numberLinear, PlusU1_linearACCs, Fin.isValue] at hS
exact hS 1
lemma SU3Sol (S : (PlusU1 n).LinSols) : accSU3 S.val = 0 := by
have hS := S.linearSol
simp at hS
simp only [PlusU1_numberLinear, PlusU1_linearACCs, Fin.isValue] at hS
exact hS 2
lemma YYsol (S : (PlusU1 n).LinSols) : accYY S.val = 0 := by
have hS := S.linearSol
simp at hS
simp only [PlusU1_numberLinear, PlusU1_linearACCs, Fin.isValue] at hS
exact hS 3
lemma quadSol (S : (PlusU1 n).QuadSols) : accQuad S.val = 0 := by
have hS := S.quadSol
simp at hS
simp only [PlusU1_numberQuadratic, HomogeneousQuadratic.eq_1, PlusU1_quadraticACCs] at hS
exact hS 0
lemma cubeSol (S : (PlusU1 n).Sols) : accCube S.val = 0 := by
@ -73,7 +73,7 @@ def chargeToLinear (S : (PlusU1 n).Charges) (hGrav : accGrav S = 0)
(PlusU1 n).LinSols :=
⟨S, by
intro i
simp at i
simp only [PlusU1_numberLinear] at i
match i with
| 0 => exact hGrav
| 1 => exact hSU2
@ -86,7 +86,7 @@ def linearToQuad (S : (PlusU1 n).LinSols) (hQ : accQuad S.val = 0) :
(PlusU1 n).QuadSols :=
⟨S, by
intro i
simp at i
simp only [PlusU1_numberQuadratic] at i
match i with
| 0 => exact hQ⟩
@ -122,7 +122,7 @@ def perm (n : ) : ACCSystemGroupAction (PlusU1 n) where
rep := repCharges
linearInvariant := by
intro i
simp at i
simp only [PlusU1_numberLinear] at i
match i with
| 0 => exact accGrav_invariant
| 1 => exact accSU2_invariant
@ -130,7 +130,7 @@ def perm (n : ) : ACCSystemGroupAction (PlusU1 n) where
| 3 => exact accYY_invariant
quadInvariant := by
intro i
simp at i
simp only [PlusU1_numberQuadratic] at i
match i with
| 0 => exact accQuad_invariant
cubicInvariant := accCube_invariant

View file

@ -162,7 +162,7 @@ lemma isSolution_sum_part (f : Fin 11 → ) (hS : (PlusU1 3).IsSolution (∑
rw [isSolution_f0 f hS, isSolution_f1 f hS, isSolution_f2 f hS, isSolution_f3 f hS,
isSolution_f4 f hS, isSolution_f5 f hS,
isSolution_f6 f hS, isSolution_f7 f hS, isSolution_f8 f hS]
simp
simp only [Fin.isValue, zero_smul, add_zero, zero_add]
rfl
lemma isSolution_grav (f : Fin 11 → ) (hS : (PlusU1 3).IsSolution (∑ i, f i • B i)) :
@ -172,7 +172,7 @@ lemma isSolution_grav (f : Fin 11 → ) (hS : (PlusU1 3).IsSolution (∑ i, f
have hg := gravSol S.toLinSols
rw [hS', hx, accGrav.map_add, accGrav.map_smul, accGrav.map_smul, show accGrav B₉ = 3 by rfl,
show accGrav B₁₀ = 1 by rfl] at hg
simp at hg
simp only [Fin.isValue, smul_eq_mul, mul_one] at hg
linear_combination hg
lemma isSolution_sum_part' (f : Fin 11 → ) (hS : (PlusU1 3).IsSolution (∑ i, f i • B i)) :
@ -193,7 +193,7 @@ lemma isSolution_f9 (f : Fin 11 → ) (hS : (PlusU1 3).IsSolution (∑ i, f i
cubeTriLin.map_smul₃, cubeTriLin.map_smul₃] at hc
rw [show accCube B₉ = 9 by rfl, show accCube B₁₀ = 1 by rfl, show cubeTriLin B₉ B₉ B₁₀ = 0 by rfl,
show cubeTriLin B₁₀ B₁₀ B₉ = 0 by rfl] at hc
simp at hc
simp only [Fin.isValue, neg_mul, mul_one, mul_zero, add_zero] at hc
have h1 : f 9 ^ 3 * 9 + (-(3 * f 9)) ^ 3 = - 18 * f 9 ^ 3 := by ring
rw [h1] at hc
simpa using hc

View file

@ -55,7 +55,9 @@ lemma accQuad_α₁_α₂ (S : (PlusU1 n).LinSols) :
lemma accQuad_α₁_α₂_zero (S : (PlusU1 n).LinSols) (h1 : α₁ C S = 0)
(h2 : α₂ S = 0) (a b : ) : accQuad (a • S + b • C.1).val = 0 := by
erw [add_AFL_quad]
simp [α₁, α₂] at h1 h2
simp only [α₁, quadBiLin_toFun_apply, Fin.isValue, neg_mul, neg_eq_zero, mul_eq_zero,
OfNat.ofNat_ne_zero, false_or, α₂, HomogeneousQuadratic.eq_1, accQuad,
BiLinearSymm.toHomogeneousQuad_apply] at h1 h2
field_simp [h1, h2]
/-- The construction of a `QuadSol` from a `LinSols` in the generic case. -/

View file

@ -118,14 +118,14 @@ lemma quadSolToSolInv_α₁_α₂_neq_zero (S : (PlusU1 n).Sols) (h : α₁ S.1
lemma quadSolToSolInv_special (S : (PlusU1 n).Sols) (h : α₁ S.1 = 0) :
special (quadSolToSolInv S).1 (quadSolToSolInv S).2.1 (quadSolToSolInv S).2.2
(quadSolToSolInv_α₁_α₂_zero S h).1 (quadSolToSolInv_α₁_α₂_zero S h).2 = S := by
simp [quadSolToSolInv_1]
simp only [quadSolToSolInv_1]
rw [show (quadSolToSolInv S).2.1 = 1 by rw [quadSolToSolInv, if_pos h]]
rw [show (quadSolToSolInv S).2.2 = 0 by rw [quadSolToSolInv, if_pos h]]
rw [special_on_AF]
lemma quadSolToSolInv_generic (S : (PlusU1 n).Sols) (h : α₁ S.1 ≠ 0) :
(quadSolToSolInv S).2.1 • generic (quadSolToSolInv S).1 = S := by
simp [quadSolToSolInv_1]
simp only [quadSolToSolInv_1]
rw [show (quadSolToSolInv S).2.1 = (α₁ S.1)⁻¹ by rw [quadSolToSolInv, if_neg h]]
rw [generic_on_AF_α₁_ne_zero S h]