Documentation

HexRCF.Soundness

theorem Hex.RCF.OptionFold.all_eq_none_iff {α : Type u_1} {f : αOption Bool} {xs : List α} :
all f xs = none xxs, f x = none

A strict universal fold returns none exactly when an input evaluates to none.

theorem Hex.RCF.OptionFold.any_eq_none_iff {α : Type u_1} {f : αOption Bool} {xs : List α} :
any f xs = none xxs, f x = none

A strict existential fold returns none exactly when an input evaluates to none.

theorem Hex.RCF.OptionFold.all_spec {α : Type u_1} {f : αOption Bool} {xs : List α} (htotal : xxs, ∃ (value : Bool), f x = some value) :
∃ (value : Bool), all f xs = some value (value = true xxs, f x = some true)

A total strict universal fold is true exactly when every input is true.

theorem Hex.RCF.OptionFold.any_spec {α : Type u_1} {f : αOption Bool} {xs : List α} (htotal : xxs, ∃ (value : Bool), f x = some value) :
∃ (value : Bool), any f xs = some value (value = true xxs, f x = some true)

A total strict existential fold is true exactly when some input is true.

theorem Hex.RCF.OptionFold.allArray_none {α : Type u_1} {xs : Array α} {f : αOption Bool} :
allArray xs f = none xxs, f x = none

A strict universal array fold returns none exactly when an entry evaluates to none.

theorem Hex.RCF.OptionFold.anyArray_none {α : Type u_1} {xs : Array α} {f : αOption Bool} :
anyArray xs f = none xxs, f x = none

A strict existential array fold returns none exactly when an entry evaluates to none.

theorem Hex.RCF.OptionFold.allWhereArray_none {α : Type u_1} {xs : Array α} {relevant : αBool} {f : αOption Bool} :
allWhereArray xs relevant f = none xxs, relevant x = true f x = none

A filtered universal array fold returns none exactly at a relevant undefined entry.

theorem Hex.RCF.OptionFold.anyWhereArray_none {α : Type u_1} {xs : Array α} {relevant : αBool} {f : αOption Bool} :
anyWhereArray xs relevant f = none xxs, relevant x = true f x = none

A filtered existential array fold returns none exactly at a relevant undefined entry.

theorem Hex.RCF.OptionFold.allArray_spec {α : Type u_1} {xs : Array α} {f : αOption Bool} (htotal : xxs, ∃ (value : Bool), f x = some value) :
∃ (value : Bool), allArray xs f = some value (value = true xxs, f x = some true)

A total strict universal array fold is true exactly when every entry is true.

theorem Hex.RCF.OptionFold.anyArray_spec {α : Type u_1} {xs : Array α} {f : αOption Bool} (htotal : xxs, ∃ (value : Bool), f x = some value) :
∃ (value : Bool), anyArray xs f = some value (value = true xxs, f x = some true)

A total strict existential array fold is true exactly when some entry is true.

theorem Hex.RCF.OptionFold.allWhereArray_spec {α : Type u_1} {xs : Array α} {relevant : αBool} {f : αOption Bool} (htotal : xxs, relevant x = true∃ (value : Bool), f x = some value) :
∃ (value : Bool), allWhereArray xs relevant f = some value (value = true xxs, relevant x = truef x = some true)

A total filtered universal fold is true exactly when every relevant entry is true.

theorem Hex.RCF.OptionFold.anyWhereArray_spec {α : Type u_1} {xs : Array α} {relevant : αBool} {f : αOption Bool} (htotal : xxs, relevant x = true∃ (value : Bool), f x = some value) :
∃ (value : Bool), anyWhereArray xs relevant f = some value (value = true xxs, relevant x = true f x = some true)

A total filtered existential fold is true exactly when some relevant entry is true.

theorem Hex.RCF.CellFold.forall_spec {carrier : ZPoly} {cert : IsolationCert} (M : RootModel carrier cert) (eval : Cell cert.intervals.sizeOption Bool) (P : Prop) (hcell : ∀ (c : Cell cert.intervals.size), ∃ (value : Bool), eval c = some value ∀ (x : ), Cell.Sem M c x → (value = true P x)) :
∃ (value : Bool), OptionFold.allArray (Cell.all cert.intervals.size) eval = some value (value = true ∀ (x : ), P x)

Universal folding over all cells is equivalent to universal quantification over the real line.

theorem Hex.RCF.CellFold.exists_spec {carrier : ZPoly} {cert : IsolationCert} (M : RootModel carrier cert) (eval : Cell cert.intervals.sizeOption Bool) (P : Prop) (hcell : ∀ (c : Cell cert.intervals.size), ∃ (value : Bool), eval c = some value ∀ (x : ), Cell.Sem M c x → (value = true P x)) :
∃ (value : Bool), OptionFold.anyArray (Cell.all cert.intervals.size) eval = some value (value = true ∃ (x : ), P x)

Existential folding over all cells is equivalent to existential quantification over the real line.

theorem Hex.RCF.CellFold.forallWhere_spec {carrier : ZPoly} {cert : IsolationCert} (M : RootModel carrier cert) (eval : Cell cert.intervals.sizeOption Bool) (relevant : Cell cert.intervals.sizeBool) (D P : Prop) (hcell : ∀ (c : Cell cert.intervals.size), ∃ (value : Bool), eval c = some value ∀ (x : ), Cell.Sem M c x → (value = true P x)) (hrelevant : ∀ (c : Cell cert.intervals.size), relevant c = true ∃ (x : ), Cell.Sem M c x D x) :
∃ (value : Bool), OptionFold.allWhereArray (Cell.all cert.intervals.size) relevant eval = some value (value = true ∀ (x : ), D xP x)

Universal folding over relevant cells is equivalent to quantification over the specified domain.

theorem Hex.RCF.CellFold.existsWhere_spec {carrier : ZPoly} {cert : IsolationCert} (M : RootModel carrier cert) (eval : Cell cert.intervals.sizeOption Bool) (relevant : Cell cert.intervals.sizeBool) (D P : Prop) (hcell : ∀ (c : Cell cert.intervals.size), ∃ (value : Bool), eval c = some value ∀ (x : ), Cell.Sem M c x → (value = true P x)) (hrelevant : ∀ (c : Cell cert.intervals.size), relevant c = true ∃ (x : ), Cell.Sem M c x D x) :
∃ (value : Bool), OptionFold.anyWhereArray (Cell.all cert.intervals.size) relevant eval = some value (value = true ∃ (x : ), D x P x)

Existential folding over relevant cells is equivalent to quantification over the specified domain.

theorem Hex.RCF.CellFold.forallIoc_spec {carrier : ZPoly} {replay : SturmReplay} (hreplay : SturmReplay.check carrier replay = true) {cert : IsolationCert} (hstrict : IsolationCert.checkStrict replay cert = true) (a b : Dyadic) (cmps : IocCmps cert.intervals.size) (hcmps : IocCmps.check carrier replay cert a b cmps = true) (eval : Cell cert.intervals.sizeOption Bool) (P : Prop) (hcell : ∀ (c : Cell cert.intervals.size), ∃ (value : Bool), eval c = some value ∀ (x : ), Cell.Sem (cert.rootModel hreplay hstrict) c x → (value = true P x)) :

Universal folding over cells that meet (a, b] computes the bounded universal proposition.

theorem Hex.RCF.CellFold.existsIoc_spec {carrier : ZPoly} {replay : SturmReplay} (hreplay : SturmReplay.check carrier replay = true) {cert : IsolationCert} (hstrict : IsolationCert.checkStrict replay cert = true) (a b : Dyadic) (cmps : IocCmps cert.intervals.size) (hcmps : IocCmps.check carrier replay cert a b cmps = true) (eval : Cell cert.intervals.sizeOption Bool) (P : Prop) (hcell : ∀ (c : Cell cert.intervals.size), ∃ (value : Bool), eval c = some value ∀ (x : ), Cell.Sem (cert.rootModel hreplay hstrict) c x → (value = true P x)) :

Existential folding over cells that meet (a, b] computes the bounded existential proposition.

theorem Hex.RCF.Certificate.replay_true {s : Sentence} {cert : Certificate} (h : check s cert = true) :

An accepted certificate has three-valued replay result some true.

Constant-only sentence replay is exact at every real point.

The empty bounded-domain branch is sound independently of its body.

A successfully replayed constants-only branch proves the sentence.

theorem Hex.RCF.Sentence.evalOpen_eq_true_iff {s : Sentence} {carrier : CarrierCert} (hcarrier : CarrierCert.check s carrier = true) {isolations : IsolationCert} (hstrict : IsolationCert.checkStrict carrier.replay isolations = true) (cut : Fin (isolations.intervals.size + 1)) {x : } (hx : Cell.Sem (isolations.rootModel hstrict) (Cell.open cut) x) :
s.evalOpen? isolations cut = some true s.formula.toProp x

The matrix-free open-cell evaluator is exact under the carrier and strict isolation checks.

A checked empty isolation set gives the single-cell decomposition.

A checked positive-root decomposition proves the quantified sentence.

The public Boolean certificate checker is sound.