Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: try to prove theorem we need about predicates directly #684

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions SSA/Experimental/Bits/Fast/FiniteStateMachine.lean
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,20 @@ theorem decideIfZerosAux_correct {arity : Type _} [DecidableEq arity]
Circuit.eval_or, this, or_true]
termination_by card_compl c

def EventuallyAllZeroes {arity : Type _} (p : FSM arity) : Prop :=
∃ (k : Nat), ∀ (x : arity → BitStream) (n : Nat), p.eval x (n + k) = false

def EventuallyAllZeroesLeCard {arity : Type _} (p : FSM arity) : Prop :=
∃ k ≤ Fintype.card p.α, ∀ (args : arity → BitStream) (n : Nat), p.eval args (n + k) = false

theorem EventuallyAllZeroes_of_EventuallyAllZeroesLeCard {arity : Type _} {p : FSM arity} :
EventuallyAllZeroesLeCard p → EventuallyAllZeroes p := by
unfold EventuallyAllZeroes EventuallyAllZeroesLeCard
intros h
obtain ⟨k, _hk, h⟩:= h
exists k


theorem decideIfZeros_correct {arity : Type _} [DecidableEq arity]
(p : FSM arity) : decideIfZeros p = true ↔ ∀ n x, p.eval x n = false := by
apply decideIfZerosAux_correct
Expand Down Expand Up @@ -810,6 +824,7 @@ def Predicate.denote : Predicate α → Prop
| or p q => p.denote ∨ q.denote
-- | not p => ¬ p.denote


/--
Convert a predicate into a proposition
-/
Expand Down
Loading