| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Homomorphism proofs for variables and constants over polynomials |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
open import Tactic.RingSolver.Core.Polynomial.Parameters |
| 10 |
|
| 11 |
module Tactic.RingSolver.Core.Polynomial.Homomorphism.Variables |
| 12 |
{r₁ r₂ r₃ r₄} |
| 13 |
(homo : Homomorphism r₁ r₂ r₃ r₄) |
| 14 |
where |
| 15 |
|
| 16 |
open import Data.Product.Base using (_,_) |
| 17 |
open import Data.Vec.Base as Vec using (Vec) |
| 18 |
open import Data.Fin.Base using (Fin) |
| 19 |
open import Data.List.Kleene |
| 20 |
|
| 21 |
open Homomorphism homo |
| 22 |
|
| 23 |
open import Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas homo |
| 24 |
open import Tactic.RingSolver.Core.Polynomial.Base (Homomorphism.from homo) |
| 25 |
open import Tactic.RingSolver.Core.Polynomial.Reasoning (Homomorphism.to homo) |
| 26 |
open import Tactic.RingSolver.Core.Polynomial.Semantics homo |
| 27 |
|
| 28 |
ι-hom : ∀ {n} (i : Fin n) (Ρ : Vec Carrier n) → ⟦ ι i ⟧ Ρ ≈ Vec.lookup Ρ i |
| 29 |
ι-hom i Ρ′ = let (ρ , Ρ) = drop-1 (space≤′n i) Ρ′ in begin |
| 30 |
⟦ (κ Raw.1# Δ 1 ∷↓ []) ⊐↓ space≤′n i ⟧ Ρ′ ≈⟨ ⊐↓-hom (κ Raw.1# Δ 1 ∷↓ []) (space≤′n i) Ρ′ ⟩ |
| 31 |
⅀?⟦ κ Raw.1# Δ 1 ∷↓ [] ⟧ (ρ , Ρ) ≈⟨ ∷↓-hom-s (κ Raw.1#) 0 [] ρ Ρ ⟩ |
| 32 |
ρ * ⟦ κ Raw.1# ⟧ Ρ ≈⟨ *≫ 1-homo ⟩ |
| 33 |
ρ * 1# ≈⟨ *-identityʳ ρ ⟩ |
| 34 |
ρ ≡⟨ drop-1⇒lookup i Ρ′ ⟩ |
| 35 |
Vec.lookup Ρ′ i ∎ |