Documentation

ConNF.Fuzz.Construction

Constructing the fuzz map #

In tangled type theory, a given model element has extensions at each level below it. We have a "preferred" extension, and must find a way to compute the other extensions from that information. In order to do this, we need to be able to convert arbitrary model elements into "junk" at other levels, which can then be clearly interpreted as a "non-preferred" extension.

The fuzz maps perform this task. They are parametrised by a pair of type indices, representing the source type level and target type level. At each pair of levels, the fuzz map is an injection from tangles to litters. An arbitrary litter can only be the image of a fuzz map defined at a single pair of type levels.

Treating the output of a fuzz map as a typed near-litter, its pos is always greater than the pos of the input to the function. This ensures a well-foundedness condition that we use in many places later.

Main declarations #

We construct the fuzz map by first defining the auxiliary function chooseWf.

Suppose we wish to construct a function f : α → β with the constraint that for each α, there is a predefined set of "denied" β values that it cannot take. Under some restrictions based on the cardinalities of the denied set, we can construct such a function. We can in addition require that f be injective if α has a well-order, which we will assume here.

The fuzz map that we will construct indeed satisfies these conditions.

noncomputable def ConNF.someOfMkLt {β : Type u} (s : Set β) (h : Cardinal.mk s < Cardinal.mk β) :
β

Noncomputably chooses an element of β \ s, given #s < #β.

Equations
Instances For
    theorem ConNF.someOfMkLt_spec {β : Type u} {s : Set β} {h : Cardinal.mk s < Cardinal.mk β} :
    theorem ConNF.mk_image₂_le {α : Type u} {β : Type u} {p : αProp} (f : (x : α) → p xβ) :
    Cardinal.mk { y : β // ∃ (z : α) (h : p z), f z h = y } Cardinal.mk { x : α // p x }
    noncomputable def ConNF.chooseWfCore {α : Type u} {β : Type u} {r : ααProp} (deny : αSet β) (h : ∀ (x : α), Cardinal.mk { y : α // r y x } + Cardinal.mk (deny x) < Cardinal.mk β) (x : α) (f : (y : α) → r y xβ) :
    β
    Equations
    Instances For
      theorem ConNF.chooseWfCore_spec {α : Type u} {β : Type u} {r : ααProp} {deny : αSet β} {h : ∀ (x : α), Cardinal.mk { y : α // r y x } + Cardinal.mk (deny x) < Cardinal.mk β} (x : α) (f : (y : α) → r y xβ) :
      ConNF.chooseWfCore deny h x f{z : β | ∃ (y : α) (h : r y x), f y h = z} deny x
      noncomputable def ConNF.chooseWf {α : Type u} {β : Type u} {r : ααProp} [hwf : IsWellOrder α r] (deny : αSet β) (h : ∀ (x : α), Cardinal.mk { y : α // r y x } + Cardinal.mk (deny x) < Cardinal.mk β) :
      αβ

      Constructs an injective function f such that f x ∉ deny x.

      Equations
      Instances For
        theorem ConNF.chooseWf_spec {α : Type u} {β : Type u} {r : ααProp} [hwf : IsWellOrder α r] {deny : αSet β} {h : ∀ (x : α), Cardinal.mk { y : α // r y x } + Cardinal.mk (deny x) < Cardinal.mk β} (x : α) :
        ConNF.chooseWf deny h x{z : β | ∃ (y : α) (_ : r y x), ConNF.chooseWf deny h y = z} deny x
        theorem ConNF.chooseWf_not_mem_deny {α : Type u} {β : Type u} {r : ααProp} [IsWellOrder α r] {deny : αSet β} {h : ∀ (x : α), Cardinal.mk { y : α // r y x } + Cardinal.mk (deny x) < Cardinal.mk β} (x : α) :
        ConNF.chooseWf deny h xdeny x
        theorem ConNF.chooseWf_ne_of_r {α : Type u} {β : Type u} {r : ααProp} [_inst : IsWellOrder α r] {deny : αSet β} {h : ∀ (x : α), Cardinal.mk { y : α // r y x } + Cardinal.mk (deny x) < Cardinal.mk β} (x₁ : α) (x₂ : α) (hx : r x₁ x₂) :
        ConNF.chooseWf deny h x₁ ConNF.chooseWf deny h x₂
        theorem ConNF.chooseWf_injective {α : Type u} {β : Type u} {r : ααProp} [inst : IsWellOrder α r] {deny : αSet β} {h : ∀ (x : α), Cardinal.mk { y : α // r y x } + Cardinal.mk (deny x) < Cardinal.mk β} :

        We construct the fuzz maps by constructing a set of image values to deny, and then choosing arbitrarily from the remaining set. This uses the chooseWf results.

        The majority of this section is spent proving that the set of values to deny isn't "too large", such that we could run out of available values for the function.

        def ConNF.fuzzDeny [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] (t : ConNF.Tangle β) :
        Set ConNF.μ

        The set of elements of ν that fuzz _ t cannot be.

        Equations
        • ConNF.fuzzDeny t = {ν : ConNF.μ | ∃ (N : ConNF.NearLitter), ConNF.pos N ConNF.pos t ν = N.fst} {ν : ConNF.μ | ∃ (a : ConNF.Atom), ConNF.pos a ConNF.pos t ν = a.1}
        Instances For
          theorem ConNF.mk_invImage_lt [ConNF.Params] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] (t : ConNF.Tangle β) :
          Cardinal.mk { t' : ConNF.Tangle β // t' < t } < Cardinal.mk ConNF.μ
          theorem ConNF.mk_fuzzDeny [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] (t : ConNF.Tangle β) :
          Cardinal.mk { t' : ConNF.Tangle β // t' < t } + Cardinal.mk (ConNF.fuzzDeny t) < Cardinal.mk ConNF.μ

          We're done with proving technical results, now we can define the fuzz maps.

          noncomputable def ConNF.fuzz [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} (hβγ : β γ) (t : ConNF.Tangle β) :
          ConNF.Litter

          The fuzz map for a particular pair of type indices.

          In tangled type theory, a given model element has extensions at each level below it. We have a "preferred" extension, and must find a way to compute the other extensions from that information. In order to do this, we need to be able to convert arbitrary model elements into "junk" at other levels, which can then be clearly interpreted as a "non-preferred" extension.

          The fuzz maps perform this task. They are parametrised by a pair of type indices, representing the source type level and target type level. At each pair of levels, the fuzz map is an injection from tangles to litters. An arbitrary litter can only be the image of a fuzz map defined at a single pair of type levels.

          Treating the output of a fuzz map as a typed near-litter, its pos is always greater than the pos of the input to the function. This ensures a well-foundedness condition that we use in many places later.

          Equations
          Instances For
            @[simp]
            theorem ConNF.fuzz_β [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} (hβγ : β γ) (t : ConNF.Tangle β) :
            (ConNF.fuzz hβγ t) = β
            @[simp]
            theorem ConNF.fuzz_γ [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} (hβγ : β γ) (t : ConNF.Tangle β) :
            (ConNF.fuzz hβγ t) = γ
            theorem ConNF.fuzz_congr_β [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} {β' : ConNF.TypeIndex} {γ' : ConNF.Λ} [ConNF.ModelData β'] [ConNF.PositionedTangles β'] {hβγ : β γ} {hβγ' : β' γ'} {t : ConNF.Tangle β} {t' : ConNF.Tangle β'} (h : ConNF.fuzz hβγ t = ConNF.fuzz hβγ' t') :
            β = β'
            theorem ConNF.fuzz_congr_γ [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} {β' : ConNF.TypeIndex} {γ' : ConNF.Λ} [ConNF.ModelData β'] [ConNF.PositionedTangles β'] {hβγ : β γ} {hβγ' : β' γ'} {t : ConNF.Tangle β} {t' : ConNF.Tangle β'} (h : ConNF.fuzz hβγ t = ConNF.fuzz hβγ' t') :
            γ = γ'
            theorem ConNF.fuzz_injective [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} (hβγ : β γ) :
            theorem ConNF.fuzz_not_mem_deny [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} (hβγ : β γ) (t : ConNF.Tangle β) :
            (ConNF.fuzz hβγ t)ConNF.fuzzDeny t
            theorem ConNF.pos_lt_pos_fuzz_nearLitter [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} (hβγ : β γ) (t : ConNF.Tangle β) (N : ConNF.NearLitter) (h : N.fst = ConNF.fuzz hβγ t) :
            ConNF.pos t < ConNF.pos N
            theorem ConNF.pos_lt_pos_fuzz_atom [ConNF.Params] [ConNF.BasePositions] {β : ConNF.TypeIndex} [ConNF.ModelData β] [ConNF.PositionedTangles β] {γ : ConNF.Λ} (hβγ : β γ) (t : ConNF.Tangle β) (a : ConNF.Atom) (ha : a.1 = ConNF.fuzz hβγ t) :
            ConNF.pos t < ConNF.pos a