Validity over a row source #
The proof-producing kernel checker cannot use a flat Array: child lookup in a
two-million-row literal would be linear in the child index. Runtime checking,
on the other hand, naturally gets rows from an array. Both routes use the same
validity predicates below, parameterized only by a total row getter and its
logical size. The bounds in the predicates ensure that out-of-range values of
the total getter are irrelevant.
structure
Noperthedron.Solution.Row.ValidSplitParamAt
(get : ℕ → Row)
(size : ℕ)
(row : Row)
(param : Param)
:
- children_intervals_good (n : Fin row.nrChildren) : (get (row.IDfirstChild + ↑n)).interval = Interval.nth_part param row.interval row.nrChildren n
Instances For
theorem
Noperthedron.Solution.Row.validSplitParamAt_iff
(get : ℕ → Row)
(size : ℕ)
(row : Row)
(param : Param)
:
ValidSplitParamAt get size row param ↔ row.ID < row.IDfirstChild ∧ row.IDfirstChild + row.nrChildren ≤ size ∧ ∃ (nonzero_children : row.nrChildren ≠ 0),
∀ (n : Fin row.nrChildren),
(get (row.IDfirstChild + ↑n)).interval = Interval.nth_part param row.interval row.nrChildren n
@[implicit_reducible]
instance
Noperthedron.Solution.instDecidableValidSplitParamAt
(get : ℕ → Row)
(size : ℕ)
(row : Row)
(param : Param)
:
Decidable (Row.ValidSplitParamAt get size row param)
Equations
- One or more equations did not get rendered due to their size.
The row's split code selects a single parameter (via Param.ofSplitCode?),
and the row is a valid split of its interval along that parameter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[implicit_reducible]
instance
Noperthedron.Solution.instDecidableValidSingleParamSplitAt
(get : ℕ → Row)
(size : ℕ)
(row : Row)
:
Decidable (Row.ValidSingleParamSplitAt get size row)
Equations
- One or more equations did not get rendered due to their size.
@[implicit_reducible]
instance
Noperthedron.Solution.instDecidableHasIntervalsAt
(get : ℕ → Row)
(size start : ℕ)
(intervals : List Interval)
:
Decidable (HasIntervalsAt get size start intervals)
Equations
- Noperthedron.Solution.instDecidableHasIntervalsAt get size start intervals = Noperthedron.Solution.instDecidableHasIntervalsAt._aux_1 get size start intervals
@[implicit_reducible]
instance
Noperthedron.Solution.Row.instDecidableValidFullSplitAt
(get : ℕ → Row)
(size : ℕ)
(row : Row)
:
Decidable (ValidFullSplitAt get size row)
Equations
@[implicit_reducible]
instance
Noperthedron.Solution.Row.instDecidableValidSplitAt
(get : ℕ → Row)
(size : ℕ)
(row : Row)
:
Decidable (ValidSplitAt get size row)
Equations
- Noperthedron.Solution.Row.instDecidableValidSplitAt get size row = Noperthedron.Solution.Row.instDecidableValidSplitAt._aux_1 get size row
@[implicit_reducible]
instance
Noperthedron.Solution.instDecidableValidAt
(get : ℕ → Row)
(size : ℕ)
(row : Row)
:
Decidable (Row.ValidAt get size row)
Equations
- Noperthedron.Solution.instDecidableValidAt get size row = decidable_of_iff (Noperthedron.Solution.Row.ValidSplitAt get size row ∨ row.ValidGlobal ∨ row.ValidLocal) ⋯
Equations
- Noperthedron.Solution.Row.ValidIxAt get size i = ((get i).ID = i ∧ Noperthedron.Solution.Row.ValidAt get size (get i) ∧ i < size)
Instances For
@[implicit_reducible]
Equations
Equations
- Noperthedron.Solution.RowsValidAt get size = ∀ (i : Fin size), Noperthedron.Solution.Row.ValidIxAt get size ↑i
Instances For
Equations
- iv.toReal = PoseInterval.mk iv.minPose iv.maxPose ⋯
Instances For
Equations
- row.toRealInterval = row.interval.toReal
Instances For
@[implicit_reducible]
The set of poses lying in the rational interval, defined as Set.Icc of the
min/max endpoints; agrees definitionally with iv.toReal.
Equations
- Noperthedron.Solution.instCoeIntervalSetPoseReal = { coe := fun (iv : Noperthedron.Solution.Interval) => Set.Icc iv.minPose iv.maxPose }
theorem
Noperthedron.Solution.has_intervals_concat
(get : ℕ → Row)
(size start : ℕ)
(ivs1 ivs2 : List Interval)
:
HasIntervalsAt get size start (ivs1 ++ ivs2) ↔ HasIntervalsAt get size start ivs1 ∧ HasIntervalsAt get size (start + ivs1.length) ivs2