Equations
- instTyDenoteUnit = { toType := fun (x : Unit) => Unit }
Equations
- Ctxt.instEmptyCollection = { emptyCollection := Ctxt.empty }
Equations
- Ctxt.instFunctor = { map := fun {α β : Type} => Ctxt.map, mapConst := fun {α β : Type} => Ctxt.map ∘ Function.const β }
Recursion principle for contexts in terms of Ctxt.nil and Ctxt.snoc
Equations
- Ctxt.recOn nil snoc [] = nil
- Ctxt.recOn nil snoc (ty :: tys) = snoc tys ty (Ctxt.recOn nil snoc tys)
Instances For
Equations
- Ctxt.Var.emptyElim ⟨val, h⟩ = ⋯.elim
Instances For
Transport a variable from Γ to any mapped context Γ.map f
Equations
- Ctxt.Var.toMap ⟨i, h⟩ = ⟨i, ⋯⟩
Instances For
Equations
- Ctxt.Var.cast h_eq ⟨i, h⟩ = ⟨i, ⋯⟩
Instances For
Equations
- Ctxt.Var.castCtxt h_eq ⟨i, h⟩ = ⟨i, ⋯⟩
Instances For
This is an induction principle that case splits on whether or not a variable is the last variable in a context.
Equations
- Ctxt.Var.casesOn ⟨0, h⟩ toSnoc last = cast ⋯ last
- Ctxt.Var.casesOn ⟨i.succ, h⟩ toSnoc last = toSnoc ⟨i, ⋯⟩
Instances For
Ctxt.Var.casesOn behaves in the expected way when applied to the last variable
Equations
- ⋯ = ⋯
Instances For
Ctxt.Var.casesOn behaves in the expected way when applied to a previous variable,
that is not the last one.
Equations
- ⋯ = ⋯
Instances For
map.with v₁ v₂ adjusts a single variable of a Context map, so that in the resulting map
v₁now maps tov₂- all other variables
vstill map tomap vas in the original map
Equations
- f.with v₁ v₂ w = if h : ∃ (ty_eq : t = t'), ⋯ ▸ w = v₁ then Ctxt.Var.cast ⋯ v₂ else f w
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Ctxt.instInhabitedValuationNil = { default := Ctxt.Valuation.nil }
Helper to simplify context manipulation with toSnoc and variable access. #
There is only one distinct valuation for the empty context
Make a a valuation for a singleton value
Equations
- Ctxt.Valuation.singleton v = (Ctxt.Valuation.nil::ᵥv)
Instances For
Build valuation from a vector of values of types types.
Equations
- Ctxt.Valuation.ofHVector HVector.nil = default
- Ctxt.Valuation.ofHVector (x_1::ₕxs) = (Ctxt.Valuation.ofHVector xs::ᵥx_1)
Instances For
Build valuation from a vector of values of types types.
Equations
- Ctxt.Valuation.ofPair v₁ v₂ = Ctxt.Valuation.ofHVector (v₁::ₕ(v₂::ₕHVector.nil))
Instances For
Reassign the variable var to value val in context ctxt
Equations
Instances For
Recursion principle for valuations in terms of Valuation.nil and Valuation.snoc
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Ctxt.Valuation.cast h V v = V (Ctxt.Var.castCtxt ⋯ v)
Instances For
reassigning a variable to the same value that has been looked up is identity.
Equations
- Ctxt.Var.instRepr = { reprPrec := fun (v : Γ.Var t) (x : ℕ) => Lean.format "%" ++ Lean.format (List.length Γ - ↑v - 1) ++ Lean.format "" }
add #
Equations
- Ctxt.Diff.add ⟨d₁, h₁⟩ ⟨d₂, h₂⟩ = ⟨d₁ + d₂, ⋯⟩
Instances For
Equations
- Ctxt.Diff.cast h₁ h₂ ⟨n, h⟩ = ⟨n, ⋯⟩
Instances For
Δ : DerivedCtxt Γ means that Δ is a context obtained by adding elements to context Γ.
That is, there exists a context difference diff : Γ.Diff Δ.
- ctxt : Ctxt Ty
- diff : Γ.Diff self.ctxt
Instances For
Every context is trivially derived from itself
Equations
- Ctxt.DerivedCtxt.ofCtxt Γ = { ctxt := Γ, diff := Ctxt.Diff.zero Γ }
Instances For
value of a dervied context from an empty context, is the empty context with a zero diff.
Equations
- Ctxt.DerivedCtxt.instCoeDep = { coe := { ctxt := Γ, diff := Ctxt.Diff.zero Γ } }
Equations
- One or more equations did not get rendered due to their size.
Context homomorphism from (Γ.dropUntil v) to Γ, see also dropUntilDiff
Equations
- Ctxt.dropUntilHom = Ctxt.dropUntilDiff.toHom