A complete finite alphabet for sensitivity recipe search
DefinitionSensitivityWordFiniteFor a fixed number of states, a letter consists of target and gate maps into the state set, an auxiliary map into three values, and a tolerance map into six values. Its decoded recipe is the original recipe with each tolerance read as a natural number. Thus the ambient alphabet is finite, of cardinality
Recipe validity remains exactly the original monotonicity predicate. No admissibility or growth conclusion is built into the data type. The alphabet can represent every admissible recipe's transfer map: tolerance values on the first three states are unused and may be replaced by zero; on all other states the admissibility condition already bounds the tolerance by five. That completeness assertion is proved separately in the search-correctness theorem.
import Definitions.Def_SensitivityProfileWord
/-! A finite alphabet for exact searches over admissible recipe words. -/
set_option autoImplicit false
namespace SensitivityWordFinite
open SensitivityProfileCycle SensitivityProfileSearch SensitivityProfileWord
structure Letter (n : ℕ) where
target : Fin n → Fin n
gate : Fin n → Fin n
aux : Fin n → Fin 3
tol : Fin n → Fin 6
deriving Fintype, DecidableEq
def Letter.recipe {n : ℕ} (C : Letter n) : Recipe n :=
⟨C.target, C.gate, C.aux, fun i => (C.tol i).val⟩
instance {n : ℕ} (C : Letter n) : Decidable C.recipe.Valid := by
unfold Recipe.Valid Monotone
infer_instance
end SensitivityWordFinite