Skip to content

Conversation

@mpenciak
Copy link
Contributor

No description provided.

@mpenciak mpenciak changed the title Mp/field builtins Add necessary field builtins and proofs for Merkle example Oct 30, 2025
@iamrecursion iamrecursion added the enhancement New feature or request label Nov 6, 2025
@iamrecursion iamrecursion changed the title Add necessary field builtins and proofs for Merkle example Add builtins and proofs for the Merkle example Nov 6, 2025
@iamrecursion iamrecursion force-pushed the mp/field_builtins branch 2 times, most recently from 468a582 to ffb7706 Compare November 6, 2025 15:01
mpenciak and others added 4 commits January 14, 2026 15:55
This commit also provides `to_array_spec` which is not the same as the
`to_array_inv` that it removes. The postcondition is _far_ simpler, and
it requires far fewer input constraints to make it work. It should still
suffice, however.
* remove redudant `exact ()` and `trivial`s

* verify BE and LE decompositions

* move lemmas to Ext module and remove least useful ones

* simplify simps and fix formatting

* applyRangeConstraint builtin + bn254 proofs + from le/be

* initial unyieldy proof for pow32

* simplify pow_32 intro

* remove map_toFin_map_ofFin

* generalize mod_u32_sub_add_eq to mod_sub_add_eq

* document empty postconditions being required for steps

* reorder bits & bytes results more logically
Copy link
Collaborator

@Eduardogbg Eduardogbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess changes mostly fall into the following categories:

  • changes from my branch (which we already reviewed)
  • removal of big int (which I have no context for but i assume is related to making lampe match noir more closely)
  • builtin changes (some of which I did some of which i didn't)

i made comments about the ones i have questions about

_ = _ := by simp [Nat.pow_succ, Nat.mul_comm]

-- def ofDigitsBE {d} (v : List.Vector (Digit r) d): RadixVec r d := match d with
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess remove this?

-- · exact Fin.prop _
-- ⟩

def ofDigitsBE' (l : List (Digit r)): Nat :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we ok with this naming convention with '?

-- := lst ++ (List.replicate (len - lst.length) default)

-- @[reducible]
-- def decomposeToRadix (r : Nat) (v : Nat) (h : r > 1) : List Nat := match v with
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems interesting? I guess we could have used this for the semantics? what's your opinion @kustosz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants