Documentation

Transfer.Hierarchy.ParamHierarchy

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:

levelfields of Map_k.Has R
map0(none)
map1map : A → B
map2amap, map_in_R : map a = b → R a b
map2bmap, R_in_map : R a b → map a = b
map3map, map_in_R, R_in_map
map4map3 + 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 #

Trocq's map_class (std/Hierarchy.v): the six structure levels a relation can carry in one direction.

Instances For
    @[instance_reducible]
    Equations
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The Map_k.Has R records (ported from std/Hierarchy.v) #

      structure Transfer.Param.Map0Has {A B : Type u} (R : A → B → Prop) :

      map0: no structure.

        Instances For
          structure Transfer.Param.Map1Has {A B : Type u} (R : A → B → Prop) :

          map1: a forward map.

          • map : A → B
          Instances For
            structure Transfer.Param.Map2aHas {A B : Type u} (R : A → B → Prop) :

            map2a: a map whose graph is included in R.

            • map : A → B
            • map_in_R (a : A) (b : B) : self.map a = b → R a b
            Instances For
              structure Transfer.Param.Map2bHas {A B : Type u} (R : A → B → Prop) :

              map2b: a map that includes R (so R is single-valued through map).

              • map : A → B
              • R_in_map (a : A) (b : B) : R a b → self.map a = b
              Instances For
                structure Transfer.Param.Map3Has {A B : Type u} (R : A → B → Prop) :

                map3: R is exactly the graph of map (both inclusions).

                • map : A → B
                • map_in_R (a : A) (b : B) : self.map a = b → R a b
                • R_in_map (a : A) (b : B) : R a b → self.map a = b
                Instances For
                  structure Transfer.Param.Map4Has {A B : Type u} (R : A → B → Prop) :

                  map4: map3 + the coherence R_in_mapK. For Prop-valued R the coherence is automatic (proof irrelevance), so this is map3 + a free field — a faithful placeholder for the univalent level (which over Type-valued R is the equivalence-coherence requiring univalence).

                  • map : A → B
                  • map_in_R (a : A) (b : B) : self.map a = b → R a b
                  • R_in_map (a : A) (b : B) : R a b → self.map a = b
                  • R_in_mapK (a : A) (b : B) (r : R a b) : ⋯ = r
                  Instances For

                    The annotated relation Param (m,n) #

                    @[reducible, inline]
                    abbrev Transfer.Param.symRel {A B : Type u} (R : A → B → Prop) :
                    B → A → Prop

                    The flipped relation.

                    Equations
                    Instances For
                      structure Transfer.Param.Param (m n : MapClass) (A B : Type u) :

                      Param m n A B: a relation R with forward structure Map_m.Has R and backward structure Map_n.Has (sym R) — Trocq's annotated relation.

                      Instances For
                        def Transfer.Param.Param.symm {m n : MapClass} {A B : Type u} (p : Param m n A B) :
                        Param n m B A

                        Symmetry (the data is symmetric): swap directions.

                        Equations
                        Instances For

                          Weakening (the lattice order): forget structure #

                          def Transfer.Param.Map1Has.forget {A B : Type u} {R : A → B → Prop} :

                          map1 → map0.

                          Equations
                          Instances For
                            def Transfer.Param.Map2aHas.toMap1 {A B : Type u} {R : A → B → Prop} (h : Map2aHas R) :

                            map2a → map1.

                            Equations
                            Instances For
                              def Transfer.Param.Map2bHas.toMap1 {A B : Type u} {R : A → B → Prop} (h : Map2bHas R) :

                              map2b → map1.

                              Equations
                              Instances For
                                def Transfer.Param.Map3Has.toMap2a {A B : Type u} {R : A → B → Prop} (h : Map3Has R) :

                                map3 → map2a.

                                Equations
                                Instances For
                                  def Transfer.Param.Map3Has.toMap2b {A B : Type u} {R : A → B → Prop} (h : Map3Has R) :

                                  map3 → map2b.

                                  Equations
                                  Instances For
                                    def Transfer.Param.Map4Has.toMap3 {A B : Type u} {R : A → B → Prop} (h : Map4Has R) :

                                    map4 → map3.

                                    Equations
                                    • h.toMap3 = { map := h.map, map_in_R := ⋯, R_in_map := ⋯ }
                                    Instances For

                                      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
                                      Instances For

                                        A bare representation map as a forward-map1, backward-map0 relation.

                                        Equations
                                        Instances For