From d6cf2a47e8ed67fd8e7b35c6f694ca1043b066a3 Mon Sep 17 00:00:00 2001 From: Felix Cherubini Date: Tue, 6 Feb 2024 17:41:35 +0100 Subject: [PATCH] more simplification, new test for the solver --- .../CommRing/Localisation/PullbackSquare.agda | 14 +------ .../Localisation/UniversalProperty.agda | 10 +---- .../Algebra/CommRing/Quotient/IdealSum.agda | 5 +-- Cubical/Algebra/CommRing/RadicalIdeal.agda | 4 +- Cubical/Tactics/CommRingSolver/Examples.agda | 42 ++++++++++--------- 5 files changed, 28 insertions(+), 47 deletions(-) diff --git a/Cubical/Algebra/CommRing/Localisation/PullbackSquare.agda b/Cubical/Algebra/CommRing/Localisation/PullbackSquare.agda index 7b1a1ae69c..231223071b 100644 --- a/Cubical/Algebra/CommRing/Localisation/PullbackSquare.agda +++ b/Cubical/Algebra/CommRing/Localisation/PullbackSquare.agda @@ -383,21 +383,11 @@ module _ (R' : CommRing ℓ) (f g : (fst R')) where z/1≡y/gⁿ : (z /1ᵍ) ≡ [ y , g ^ n , ∣ n , refl ∣₁ ] z/1≡y/gⁿ = eq/ _ _ ((g ^ (n +ℕ m) , ∣ n +ℕ m , refl ∣₁) , path) where - useSolver1 : ∀ x y α₀ α₁ fⁿ⁺ᵐ gⁿ⁺ᵐ gⁿ - → gⁿ⁺ᵐ · (α₀ · x · fⁿ⁺ᵐ + α₁ · y · gⁿ⁺ᵐ) · gⁿ - ≡ α₀ · (x · gⁿ · (fⁿ⁺ᵐ · gⁿ⁺ᵐ)) + gⁿ⁺ᵐ · (α₁ · y · (gⁿ · gⁿ⁺ᵐ)) - useSolver1 _ _ _ _ _ _ _ = solve! R' - - useSolver2 : ∀ y α₀ α₁ gⁿ⁺ᵐ g²ⁿ⁺ᵐ f²ⁿ⁺ᵐ - → α₀ · (y · f²ⁿ⁺ᵐ · gⁿ⁺ᵐ) + gⁿ⁺ᵐ · (α₁ · y · g²ⁿ⁺ᵐ) - ≡ gⁿ⁺ᵐ · y · (α₀ · f²ⁿ⁺ᵐ + α₁ · g²ⁿ⁺ᵐ) - useSolver2 _ _ _ _ _ _ = solve! R' - path : g ^ (n +ℕ m) · z · g ^ n ≡ g ^ (n +ℕ m) · y · 1r path = g ^ (n +ℕ m) · z · g ^ n - ≡⟨ useSolver1 _ _ _ _ _ _ _ ⟩ + ≡⟨ solve! R' ⟩ α₀ · (x · g ^ n · (f ^ (n +ℕ m) · g ^ (n +ℕ m))) + g ^ (n +ℕ m) · (α₁ · y · (g ^ n · g ^ (n +ℕ m))) @@ -424,7 +414,7 @@ module _ (R' : CommRing ℓ) (f g : (fst R')) where α₀ · (y · f ^ 2n+m · g ^ (n +ℕ m)) + g ^ (n +ℕ m) · (α₁ · y · g ^ 2n+m) - ≡⟨ useSolver2 _ _ _ _ _ _ ⟩ + ≡⟨ solve! R' ⟩ g ^ (n +ℕ m) · y · (α₀ · f ^ 2n+m + α₁ · g ^ 2n+m) diff --git a/Cubical/Algebra/CommRing/Localisation/UniversalProperty.agda b/Cubical/Algebra/CommRing/Localisation/UniversalProperty.agda index ef9cd26ff0..0c89652f21 100644 --- a/Cubical/Algebra/CommRing/Localisation/UniversalProperty.agda +++ b/Cubical/Algebra/CommRing/Localisation/UniversalProperty.agda @@ -84,10 +84,7 @@ module _ (R' : CommRing ℓ) (S' : ℙ (fst R')) (SMultClosedSubset : isMultClos S⁻¹Rˣ = S⁻¹RAsCommRing ˣ S/1⊆S⁻¹Rˣ : ∀ s → s ∈ S' → (s /1) ∈ S⁻¹Rˣ - S/1⊆S⁻¹Rˣ s s∈S' = [ 1r , s , s∈S' ] , eq/ _ _ ((1r , SMultClosedSubset .containsOne) , path s) - where - path : ∀ s → 1r · (s · 1r) · 1r ≡ 1r · 1r · (1r · s) - path _ = solve! R' + S/1⊆S⁻¹Rˣ s s∈S' = [ 1r , s , s∈S' ] , eq/ _ _ ((1r , SMultClosedSubset .containsOne) , solve! R') S⁻¹RHasUniversalProp : hasLocUniversalProp S⁻¹RAsCommRing /1AsCommRingHom S/1⊆S⁻¹Rˣ S⁻¹RHasUniversalProp B' ψ ψS⊆Bˣ = (χ , funExt χcomp) , χunique @@ -313,10 +310,7 @@ module _ (R' : CommRing ℓ) (S' : ℙ (fst R')) (SMultClosedSubset : isMultClos s-inv : ⦃ s/1∈S⁻¹Rˣ : s /1 ∈ S⁻¹Rˣ ⦄ → s /1 ⁻¹ˡ ≡ [ 1r , s , s∈S' ] s-inv ⦃ s/1∈S⁻¹Rˣ ⦄ = PathPΣ (S⁻¹RInverseUniqueness (s /1) s/1∈S⁻¹Rˣ - (_ , eq/ _ _ ((1r , SMultClosedSubset .containsOne) , path s))) .fst - where - path : ∀ s → 1r · (s · 1r) · 1r ≡ 1r · 1r · (1r · s) - path _ = solve! R' + (_ , eq/ _ _ ((1r , SMultClosedSubset .containsOne) , solve! R'))) .fst ·ₗ-path : [ r , s , s∈S' ] ≡ [ r , 1r , SMultClosedSubset .containsOne ] ·ₗ [ 1r , s , s∈S' ] diff --git a/Cubical/Algebra/CommRing/Quotient/IdealSum.agda b/Cubical/Algebra/CommRing/Quotient/IdealSum.agda index ae23b46491..937c8e0edc 100644 --- a/Cubical/Algebra/CommRing/Quotient/IdealSum.agda +++ b/Cubical/Algebra/CommRing/Quotient/IdealSum.agda @@ -93,12 +93,9 @@ module Construction {R : CommRing ℓ} (I J : IdealsIn R) where (subst (λ K → b - x ∈ K) (kernel≡I I) (kernelFiber R (R / I) π₁ b x π₁b≡π₁x)) - useSolver : (b : ⟨ R ⟩) → x ≡ - (b - x) + b - useSolver _ = solve! R - step2 : ∀ b → b ∈ J → fst π₁ b ≡ fst π₁ x → x ∈ (I +i J) step2 b b∈J π₁b≡π₁x = - ∣ (- (b - x) , b) , (step1 b π₁b≡π₁x) , (b∈J , (x ≡⟨ useSolver b ⟩ (- (b - x) + b) ∎)) ∣₁ + ∣ (- (b - x) , b) , (step1 b π₁b≡π₁x) , (b∈J , (x ≡⟨ solve! R ⟩ (- (b - x) + b) ∎)) ∣₁ ψ : CommRingHom (R / (I +i J)) ((R / I) / π₁J) ψ = UniversalProperty.inducedHom R ((R / I) / π₁J) (I +i J) π πI+J≡0 diff --git a/Cubical/Algebra/CommRing/RadicalIdeal.agda b/Cubical/Algebra/CommRing/RadicalIdeal.agda index dd0bb19b0f..0fdabfb3e7 100644 --- a/Cubical/Algebra/CommRing/RadicalIdeal.agda +++ b/Cubical/Algebra/CommRing/RadicalIdeal.agda @@ -54,8 +54,6 @@ module RadicalIdeal (R' : CommRing ℓ) where binomialCoeff∈I i with ≤-+-split n m (toℕ i) (pred-≤-pred (toℕ