Paths of type indices #
In this file, we define the notion of a path, and the derivative and coderivative operations.
Main declarations #
ConNF.Path
: A path of type indices.ConNF.Path.recSderiv
,ConNF.Path.recSderivLe
,ConNF.Path.recSderivGlobal
: Downwards induction principles for paths.ConNF.Path.recScoderiv
: An upwards induction principle for paths.
A path of type indices starting at α
and ending at β
is a finite sequence of type indices
α > ... > β
.
- nil: [inst : ConNF.Params] → {α : ConNF.TypeIndex} → α ↝ α
- cons: [inst : ConNF.Params] → {α β γ : ConNF.TypeIndex} → α ↝ β → γ < β → α ↝ γ
Instances For
A path of type indices starting at α
and ending at β
is a finite sequence of type indices
α > ... > β
.
Equations
- ConNF.«term_↝_» = Lean.ParserDescr.trailingNode `ConNF.«term_↝_» 70 71 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↝ ") (Lean.ParserDescr.cat `term 71))
Instances For
Equations
- ConNF.Path.single h = ConNF.Path.nil.cons h
Instances For
Typeclass for the ↘
notation.
- sderiv : X → γ < β → Y
Instances
Typeclass for the ⇘
notation.
Instances
Typeclass for the ⇘.
notation.
- botSderiv : X → Y
We often need to do case analysis on
β
to show that it's a proper type index here. This case check doesn't need to be done in most actual use cases of the notation.
Instances
Typeclass for the ↗
notation.
- scoderiv : X → γ < β → Y
Instances
Typeclass for the ⇗
notation.
Instances
Equations
- ConNF.«term_↘_» = Lean.ParserDescr.trailingNode `ConNF.«term_↘_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↘ ") (Lean.ParserDescr.cat `term 76))
Instances For
Equations
- ConNF.«term_⇘_» = Lean.ParserDescr.trailingNode `ConNF.«term_⇘_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇘ ") (Lean.ParserDescr.cat `term 76))
Instances For
Equations
- ConNF.«term_↘.» = Lean.ParserDescr.trailingNode `ConNF.«term_↘.» 75 75 (Lean.ParserDescr.symbol " ↘.")
Instances For
Equations
- ConNF.«term_⇘._» = Lean.ParserDescr.trailingNode `ConNF.«term_⇘._» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇘. ") (Lean.ParserDescr.cat `term 76))
Instances For
Equations
- ConNF.«term_↗_» = Lean.ParserDescr.trailingNode `ConNF.«term_↗_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↗ ") (Lean.ParserDescr.cat `term 76))
Instances For
Equations
- ConNF.«term_⇗_» = Lean.ParserDescr.trailingNode `ConNF.«term_⇗_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇗ ") (Lean.ParserDescr.cat `term 76))
Instances For
Downwards recursion along paths #
Equations
- ConNF.instSingleDerivativePath = { sderiv := ConNF.Path.cons }
The downwards recursion principle for paths.
Equations
- ConNF.Path.recSderiv nil sderiv ConNF.Path.nil = nil
- ConNF.Path.recSderiv nil sderiv (A.cons h) = sderiv β x A h (ConNF.Path.recSderiv nil sderiv A)
Instances For
The downwards recursion principle for paths, specialised to the case where the motive at β
only depends on the fact that β ≤ α
.
Equations
- ConNF.Path.recSderivLe nil sderiv = ConNF.Path.recSderiv nil sderiv
Instances For
The downwards recursion principle for paths, specialised to the case where the motive is not
dependent on the relation of β
to α
.
Equations
- ConNF.Path.recSderivGlobal nil sderiv = ConNF.Path.recSderiv nil sderiv
Instances For
Derivatives of paths #
Equations
- One or more equations did not get rendered due to their size.
Equations
- ConNF.instCoderivativePath = ConNF.Coderivative.mk (fun (A : β ↝ γ) (B : α ↝ β) => B ⇘ A) ⋯
Upwards recursion along paths #
The same as Path
, but the components of this path point "upwards" instead of "downwards".
This type is only used for proving revScoderiv
, and should be considered an implementation detail.
- nil: [inst : ConNF.Params] → {α : ConNF.TypeIndex} → ConNF.RevPath α α
- cons: [inst : ConNF.Params] → {α β γ : ConNF.TypeIndex} → ConNF.RevPath α β → β < γ → ConNF.RevPath α γ
Instances For
A computable statement of the recursion principle for RevPath
. This needs to be written due
to a current limitation in the Lean 4 kernel: it cannot generate code for the .rec
functions.
Equations
- ConNF.RevPath.rec' nil cons ConNF.RevPath.nil = nil
- ConNF.RevPath.rec' nil cons (A.cons h) = cons A h (ConNF.RevPath.rec' nil (fun {β γ : ConNF.TypeIndex} => cons) A)
Instances For
Equations
- ConNF.RevPath.snoc h ConNF.RevPath.nil = ConNF.RevPath.nil.cons h
- ConNF.RevPath.snoc h (A.cons h_1) = (ConNF.RevPath.snoc h A).cons h_1
Instances For
Equations
- A.rev = ConNF.Path.recSderiv ConNF.RevPath.nil (fun (x x_1 : ConNF.TypeIndex) (x_2 : α ↝ x) (h : x_1 < x) => ConNF.RevPath.snoc h) A
Instances For
Instances For
Equations
- ConNF.Path.recScoderiv' nil scoderiv A = ConNF.RevPath.rec' nil (fun {β γ_1 : ConNF.TypeIndex} (A : ConNF.RevPath γ β) => scoderiv γ_1 β A.rev) A
Instances For
The upwards recursion principle for paths. The scoderiv
computation rule
recScoderiv_scoderiv
is not a definitional equality.
Equations
- ConNF.Path.recScoderiv nil scoderiv A = cast ⋯ (ConNF.Path.recScoderiv' nil scoderiv A.rev)