Skip to content

Instantly share code, notes, and snippets.

@laMudri
Last active November 14, 2018 14:07
Show Gist options
  • Save laMudri/2c9ccaf8c38c68ccd922c85e0f3c619f to your computer and use it in GitHub Desktop.
Save laMudri/2c9ccaf8c38c68ccd922c85e0f3c619f to your computer and use it in GitHub Desktop.
dot : ∀ {γ} (Γ Γ′ : Context γ) → Mult
dot ∅ ∅ = 0#
dot (Γ , π ∙ _) (Γ′ , π′ ∙ _) = dot Γ Γ′ + (π * π′)
-- Induction on the size of the output
-- (filling in each item of the output vector)
_⊛′_ : ∀ {γ δ}
→ (Δ : ∀ {B} → δ ∋ B → Context γ)
→ (Γ : Context γ)
→ Context δ
_⊛′_ {γ} {∅} Δ Γ = ∅
_⊛′_ {γ} {δ , _} Δ Γ = ((Δ ∘ S_) ⊛′ Γ) , dot (Δ Z) Γ ∙ _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment