Threshold queries for two-socket tournament gates
DefinitionSensitivityTournamentRankRulesblock-sensitivityboolean-functionstournaments
Each vertex of a finite tournament has two natural-number input levels. An outgoing edge inspects a designated socket at its destination. If edges fail, a row passes its target when both of its levels reach and at least one reaches , with . The two target cutoffs are nondecreasing and , where is the guard cutoff.
The monotone variant gives each edge an increasing predicate of both destination levels that includes the designated test. The veto variant keeps the designated test and also rejects a row immediately if both levels of any outgoing neighbor reach a separate cutoff . A query asks whether socket at vertex reaches .
Definition code
import Mathlib
/-! Threshold-query semantics for two-socket tournament rank gates. -/
namespace SensitivityTournamentRanks
open scoped BigOperators Classical
noncomputable section
set_option autoImplicit false
variable {V : Type} [Fintype V]
abbrev Input (V : Type) := V → Bool → ℕ
abbrev Query (V : Type) := V × Bool × ℕ
structure Gate (V : Type) where
arc : V → V → Prop
label : V → V → Bool
g : ℕ
q : ℕ
lo : ℕ → ℕ
hi : ℕ → ℕ
guard_le : g ≤ lo 0
ordered : ∀ t, lo t ≤ hi t
lo_mono : Monotone lo
hi_mono : Monotone hi
def bad (G : Gate V) (x : Input V) (v : V) : Finset V :=
Finset.univ.filter (fun w => G.arc v w ∧ G.g ≤ x w (G.label v w))
def target (G : Gate V) (x : Input V) (v : V) (t : ℕ) : Prop :=
(∀ c, G.lo t ≤ x v c) ∧ ∃ c, G.hi t ≤ x v c
def pass (G : Gate V) (x : Input V) (v : V) : Prop :=
(bad G x v).card ≤ G.q ∧ target G x v (bad G x v).card
def agrees (x y : Input V) (C : Finset (Query V)) : Prop :=
∀ z ∈ C, (z.2.2 ≤ x z.1 z.2.1 ↔ z.2.2 ≤ y z.1 z.2.1)
end
end SensitivityTournamentRanks
namespace SensitivityTournamentRanks.MonotoneGuard
open SensitivityTournamentRanks
open scoped BigOperators Classical
noncomputable section
set_option autoImplicit false
variable {V : Type} [Fintype V]
structure Rule (V : Type) extends Gate V where
flag : V → V → (Bool → ℕ) → Prop
mono : ∀ v w x y,(∀ c,x c ≤ y c) → flag v w x → flag v w y
primary : ∀ v w x,g ≤ x (label v w) → flag v w x
def failures (G : Rule V) (x : Input V) (v : V) : Finset V :=
Finset.univ.filter (fun w => G.arc v w ∧ G.flag v w (x w))
def wins (G : Rule V) (x : Input V) (v : V) : Prop :=
(failures G x v).card ≤ G.q ∧ target G.toGate x v (failures G x v).card
end
end SensitivityTournamentRanks.MonotoneGuard
namespace SensitivityTournamentRanks.PairVeto
open SensitivityTournamentRanks
open scoped Classical
noncomputable section
variable {V : Type} [Fintype V]
def heavy (h : ℕ) (x : Input V) (v : V) : Prop := ∀ b,h≤x v b
def win (G : Gate V) (h : ℕ) (x : Input V) (v : V) : Prop :=
pass G x v ∧ ∀ w,G.arc v w → ¬heavy h x w
end
end SensitivityTournamentRanks.PairVeto
Source
Original tournament certificate analysis for the Reach 2.15 mission. Uses the two-child guarded tournament model of the published 22-rank family, with the edge predicates specified here. https://prove2.me/theorems/735f6c78-5b75-4a99-ac8d-7de72c3b0046