The Param relation hierarchy #
A faithful Lean port of Trocq's level lattice (rocq-community/trocq,
std/Hierarchy.v) — the std (non-HoTT) variant, the appropriate one for
Lean+Mathlib.
map_class := map0 | map1 | map2a | map2b | map3 | map4 records how much structure
a relation R : A → B → Prop carries in one direction:
| level | fields of Map_k.Has R |
|---|---|
map0 | (none) |
map1 | map : A → B |
map2a | map, map_in_R : map a = b → R a b |
map2b | map, R_in_map : R a b → map a = b |
map3 | map, map_in_R, R_in_map |
map4 | map3 + coherence R_in_mapK (automatic here by proof irrelevance) |
A Param m n A B packages a relation R with a Map_m.Has R (forward) and a
Map_n.Has (sym R) (backward) — Trocq's annotated relation (m,n).
Prop-valued relations and funext #
The relations are R : A → B → Prop (the equation-style relations the crypto
transfer uses); the Type-valued generalization (needed for the universe /
dependent-Type motive) is noted where it applies. Lean has funext as a
theorem, so the combinators Coq's std had to gate on `{Funext}
(map2b/map3 arrow/forall) are axiom-free here — only the map4 universe relation
needs univalence. The univalence-free fragment is thus map0–map3 in every
component, wider than the paper's {0,1,2a}. With Prop-valued R, proof
irrelevance makes the map4 coherence R_in_mapK automatic, so even Map4.Has
is constructible for these relations.
The level lattice #
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Map_k.Has record type indexed by the level.
Equations
- Transfer.Param.MapHas Transfer.Param.MapClass.map0 x✝ = Transfer.Param.Map0Has x✝
- Transfer.Param.MapHas Transfer.Param.MapClass.map1 x✝ = Transfer.Param.Map1Has x✝
- Transfer.Param.MapHas Transfer.Param.MapClass.map2a x✝ = Transfer.Param.Map2aHas x✝
- Transfer.Param.MapHas Transfer.Param.MapClass.map2b x✝ = Transfer.Param.Map2bHas x✝
- Transfer.Param.MapHas Transfer.Param.MapClass.map3 x✝ = Transfer.Param.Map3Has x✝
- Transfer.Param.MapHas Transfer.Param.MapClass.map4 x✝ = Transfer.Param.Map4Has x✝
Instances For
Weakening (the lattice order): forget structure #
Bridge: ReprEmbeddingClass is a Param #
The encoding enc : A → α with its graph R a b := enc a = b is forward-map3
(the graph makes both inclusions identities); without a decoder the backward
direction is map0. So an embedding is a Param map3 map0.
An embedding A ↪ α (graph of enc) as a forward-map3, backward-map0
annotated relation.
Equations
- Transfer.Param.paramOfEmbedding = { R := fun (a : A) (b : α) => Transfer.ReprMapClass.enc a = b, fwd := { map := Transfer.ReprMapClass.enc, map_in_R := ⋯, R_in_map := ⋯ }, bwd := { } }
Instances For
A bare representation map as a forward-map1, backward-map0 relation.
Equations
- Transfer.Param.paramOfMap = { R := fun (a : A) (b : α) => Transfer.ReprMapClass.enc a = b, fwd := { map := Transfer.ReprMapClass.enc }, bwd := { } }