task_id stringlengths 21 23 | challenge_id stringlengths 16 16 | proof_assistant stringclasses 1
value | session stringclasses 1
value | repo stringclasses 57
values | revision stringclasses 57
values | file_path stringlengths 13 92 | theory stringlengths 1 48 | variant int64 0 132 | challenge_type stringclasses 1
value | difficulty null | count null | by_centrality bool 1
class | ablation_prob float64 0.5 0.5 | min_depth int64 1 1 | max_depth int64 1 1 | leaves_only bool 1
class | min_size int64 0 0 | max_size stringclasses 1
value | min_centrality int64 0 0 | max_centrality stringclasses 1
value | seed int64 42 42 | n_proofs int64 1 173 | n_ablated int64 1 60 | holes_filled listlengths 1 60 | deleted_lemmas listlengths 1 1 | corollaries listlengths 1 1 | closure_size int64 1 172 | challenge_file_content stringlengths 133 350k | solution_file_content stringlengths 394 351k | solution_diff stringlengths 243 134k | manifest dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ablate_2d7ad8279ebb_1 | 32293b52df4e5db2 | lean | lean | github.com/leanprover/cslib | c0120dddfe75d4ab913691c0c184fc436927b19d | Cslib/Computability/Languages/MyhillNerode.lean | MyhillNerode | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 6 | 1 | [
{
"theorem_name": "IsRegular.iff_finite_nerodeQuotient",
"depth": 1,
"n_commands": 0,
"n_lines": 7,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n constructor\n · intro h\n exact IsRegular.finite_nerodeQuotient h\n · intro h\n apply IsRegular... | [
{
"name": "nerodeCongruenceDA_language_eq",
"text": "/-- The DFA constructed from the Nerode congruence `c_l` on `l` accepts `l`. -/\n@[simp, scoped grind =]\ntheorem nerodeCongruenceDA_language_eq (l : Language α) :\n language (l.NerodeCongruenceDA) = l := by\n ext x\n simp only [NerodeCongruenceDA, l... | [
{
"name": "IsRegular.iff_finite_nerodeQuotient",
"fan_in": 2,
"n_deps_direct": 2,
"n_deps_transitive": 3,
"n_lines": 12,
"n_chars": 429,
"n_subproofs": 0,
"n_tactics": 7,
"cyclomatic": 2,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 6,
"automation_only": fa... | 3 | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | @@ -69,6 +69,20 @@
variable {l : Language α}
+/-- The DFA constructed from the Nerode congruence `c_l` on `l` accepts `l`. -/
+@[simp, scoped grind =]
+theorem nerodeCongruenceDA_language_eq (l : Language α) :
+ language (l.NerodeCongruenceDA) = l := by
+ ext x
+ simp only [NerodeCongruenceDA, language, Accep... | {
"repo": "cslib",
"git_repo": "github.com/leanprover/cslib",
"revision": "c0120dddfe75d4ab913691c0c184fc436927b19d",
"lean_toolchain": "leanprover/lean4:v4.32.0-rc1",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-leaves-all)",
"ablator_flags": [
"--corollary-delete-lem... |
ablate_2d7ad8279ebb_2 | 842b2e49d9a8d5f6 | lean | lean | github.com/leanprover/cslib | c0120dddfe75d4ab913691c0c184fc436927b19d | Cslib/Computability/Languages/MyhillNerode.lean | MyhillNerode | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 6 | 2 | [
{
"theorem_name": "IsRegular.finite_nerodeQuotient",
"depth": 1,
"n_commands": 0,
"n_lines": 11,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n obtain ⟨State, hFin, M, hM⟩ := IsRegular.iff_dfa.mp h\n rw [← hM]\n apply Finite.of_surjective (fun s ↦ ... | [
{
"name": "da_nerodeCongruence_iff",
"text": "/-- The statement (two strings are related by the Nerode congruence `c_l` on `l` iff all their right\nextensions are either both in the language or both not in it) is equivalent to stating that (all\ntheir right extensions are either both accepted or rejected by... | [
{
"name": "dfa_num_state_ge",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 23,
"n_chars": 1084,
"n_subproofs": 3,
"n_tactics": 10,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 0,
"n_structural": 1,
"automation_only": false,
"max_nes... | 1 | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | @@ -83,6 +83,15 @@
· intro hx
use x, hx
+/-- The statement (two strings are related by the Nerode congruence `c_l` on `l` iff all their right
+extensions are either both in the language or both not in it) is equivalent to stating that (all
+their right extensions are either both accepted or rejected by the DF... | {
"repo": "cslib",
"git_repo": "github.com/leanprover/cslib",
"revision": "c0120dddfe75d4ab913691c0c184fc436927b19d",
"lean_toolchain": "leanprover/lean4:v4.32.0-rc1",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-leaves-all)",
"ablator_flags": [
"--corollary-delete-lem... |
ablate_2d7ad8279ebb_3 | c499f842c5195e8d | lean | lean | github.com/leanprover/cslib | c0120dddfe75d4ab913691c0c184fc436927b19d | Cslib/Computability/Languages/MyhillNerode.lean | MyhillNerode | 3 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 6 | 1 | [
{
"theorem_name": "IsRegular.iff_finite_nerodeQuotient",
"depth": 1,
"n_commands": 0,
"n_lines": 7,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n constructor\n · intro h\n exact IsRegular.finite_nerodeQuotient h\n · intro h\n apply IsRegular... | [
{
"name": "nerodeCongruenceDA_language_eq",
"text": "/-- The DFA constructed from the Nerode congruence `c_l` on `l` accepts `l`. -/\n@[simp, scoped grind =]\ntheorem nerodeCongruenceDA_language_eq (l : Language α) :\n language (l.NerodeCongruenceDA) = l := by\n ext x\n simp only [NerodeCongruenceDA, l... | [
{
"name": "dfa_num_state_min",
"fan_in": 0,
"n_deps_direct": 2,
"n_deps_transitive": 5,
"n_lines": 17,
"n_chars": 895,
"n_subproofs": 4,
"n_tactics": 12,
"cyclomatic": 2,
"n_automation": 6,
"n_rewrites": 1,
"n_structural": 2,
"automation_only": false,
"max_nes... | 5 | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | @@ -69,6 +69,20 @@
variable {l : Language α}
+/-- The DFA constructed from the Nerode congruence `c_l` on `l` accepts `l`. -/
+@[simp, scoped grind =]
+theorem nerodeCongruenceDA_language_eq (l : Language α) :
+ language (l.NerodeCongruenceDA) = l := by
+ ext x
+ simp only [NerodeCongruenceDA, language, Accep... | {
"repo": "cslib",
"git_repo": "github.com/leanprover/cslib",
"revision": "c0120dddfe75d4ab913691c0c184fc436927b19d",
"lean_toolchain": "leanprover/lean4:v4.32.0-rc1",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-leaves-all)",
"ablator_flags": [
"--corollary-delete-lem... |
ablate_2d7ad8279ebb_4 | 7d5a9829ad5f9864 | lean | lean | github.com/leanprover/cslib | c0120dddfe75d4ab913691c0c184fc436927b19d | Cslib/Computability/Languages/MyhillNerode.lean | MyhillNerode | 4 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 6 | 1 | [
{
"theorem_name": "unique_minimal",
"depth": 1,
"n_commands": 0,
"n_lines": 20,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n obtain ⟨rfl, hc⟩ := hm\n have := Language.IsRegular.iff_finite_nerodeQuotient.mp hr\n let φ : State → Quotient ((language... | [
{
"name": "stateCongruence_le_nerodeCongruence",
"text": "/-- The Nerode congruence is the most coarse state congruence given a language. -/\ntheorem stateCongruence_le_nerodeCongruence {x y : List α}\n (h : (StateCongruence M).r x y) : ((language M).NerodeCongruence).r x y := by\n intro z\n grind [h z... | [
{
"name": "unique_minimal",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 25,
"n_chars": 1266,
"n_subproofs": 7,
"n_tactics": 20,
"cyclomatic": 2,
"n_automation": 4,
"n_rewrites": 0,
"n_structural": 9,
"automation_only": false,
"max_nesti... | 1 | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | /-
Copyright (c) 2026 Akhilesh Balaji. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Akhilesh Balaji, Ching-Tsun Chou
-/
module
public import Cslib.Computability.Languages.RegularLanguage
public import Mathlib.SetTheory.Cardinal.NatCard
/-! # Myhill-Nerode Theorem
... | @@ -143,6 +143,14 @@
variable {M : FinAcc State α}
+/-- The Nerode congruence is the most coarse state congruence given a language. -/
+theorem stateCongruence_le_nerodeCongruence {x y : List α}
+ (h : (StateCongruence M).r x y) : ((language M).NerodeCongruence).r x y := by
+ intro z
+ grind [h z, language, A... | {
"repo": "cslib",
"git_repo": "github.com/leanprover/cslib",
"revision": "c0120dddfe75d4ab913691c0c184fc436927b19d",
"lean_toolchain": "leanprover/lean4:v4.32.0-rc1",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-leaves-all)",
"ablator_flags": [
"--corollary-delete-lem... |
ablate_bc6bd2652fcf_2 | e579515e3cde8eb0 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/FromBytesWide.lean | FromBytesWide | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 8 | 1 | [
{
"theorem_name": "words_wide_prefix_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 9,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n intro t ht\n induction t with\n | zero => simp\n | succ n ih =>\n rw [Finset.sum_range_succ, ih (by omega),\n ... | [
{
"name": "word_of_bytes_64_shifted",
"text": "/-- One block of 8 bytes shifted by `2^(64*j)` equals 8 flat byte terms. -/\nprivate theorem word_of_bytes_64_shifted\n (b : Array U8 64#usize) (j : Nat) :\n word_of_bytes_64 b j * 2 ^ (64 * j)\n = ∑ k ∈ Finset.range 8, 2 ^ (8 * (8 * j + k)) * b[8 * ... | [
{
"name": "from_bytes_wide_spec",
"fan_in": 0,
"n_deps_direct": 3,
"n_deps_transitive": 8,
"n_lines": 136,
"n_chars": 7459,
"n_subproofs": 24,
"n_tactics": 127,
"cyclomatic": 5,
"n_automation": 26,
"n_rewrites": 14,
"n_structural": 15,
"automation_only": false,
... | 8 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Backend.Serial.... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Backend.Serial.... | @@ -210,6 +210,17 @@
∑ j ∈ Finset.range 8,
words[j]!.val * 2 ^ (64 * j)
+/-- One block of 8 bytes shifted by `2^(64*j)` equals 8 flat byte terms. -/
+private theorem word_of_bytes_64_shifted
+ (b : Array U8 64#usize) (j : Nat) :
+ word_of_bytes_64 b j * 2 ^ (64 * j)
+ = ∑ k ∈ Finset.range 8, 2 ^ (8... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_3d8444a743e1_0 | 1f3dddaed49e650c | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/AsMontgomery.lean | AsMontgomery | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "as_montgomery_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 15,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold as_montgomery\n let* ⟨ m, m_post1, m_post2, m_post3 ⟩ ← montgomery_mul_spec\n · exact RR_lt\n · -- u < R (fro... | [
{
"name": "RR_lt",
"text": "theorem RR_lt : ∀ i < 5, constants.RR[i]!.val < 2 ^ 62 := by\n unfold constants.RR\n decide\n\n",
"fan_in": 1,
"n_lines": 5,
"n_chars": 95,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural":... | [
{
"name": "as_montgomery_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 31,
"n_chars": 1400,
"n_subproofs": 5,
"n_tactics": 17,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 3,
"n_structural": 5,
"automation_only": false,
"max_n... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Oliver Butterley, Theo Ehrenborg
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Scalar.Sca... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Oliver Butterley, Theo Ehrenborg
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Scalar.Sca... | @@ -22,6 +22,10 @@
set_option exponentiation.threshold 260
+theorem RR_lt : ∀ i < 5, constants.RR[i]!.val < 2 ^ 62 := by
+ unfold constants.RR
+ decide
+
/-- **Spec theorem**
Specification for
@@ -39,7 +43,7 @@
Scalar52_as_Nat m < L ⦄ := by
unfold as_montgomery
let* ⟨ m, m_post1, m_post2, m_post... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_0 | b79e6472a5b04362 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 2 | [
{
"theorem_name": "sqrt_m1_sq_modEq",
"depth": 1,
"n_commands": 0,
"n_lines": 2,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n simp [Nat.ModEq, SQRT_M1_val_spec]",
"n_chars": 40,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": 1,
... | [
{
"name": "SQRT_M1_val_spec",
"text": "/-- The square of `SQRT_M1_val` reduces to `p - 1` modulo `p`. -/\nprivate theorem SQRT_M1_val_spec : (Field51_as_Nat SQRT_M1_val) ^ 2 % p = p - 1 := by\n unfold SQRT_M1_val constants.SQRT_M1_raw; decide\n\n",
"fan_in": 2,
"n_lines": 5,
"n_chars": 204,
... | [
{
"name": "sqrt_m1_sq_modEq",
"fan_in": 4,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 6,
"n_chars": 197,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": true,
"max_nesting... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -51,6 +51,10 @@
/-- The SQRT_M1 constant as a plain FieldElement51 (alias for `constants.SQRT_M1_raw`). -/
def SQRT_M1_val : field.FieldElement51 := constants.SQRT_M1_raw
+/-- The square of `SQRT_M1_val` reduces to `p - 1` modulo `p`. -/
+private theorem SQRT_M1_val_spec : (Field51_as_Nat SQRT_M1_val) ^ 2 % p = ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_1 | 62cb6c1331460227 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "to_bytes_zero_of_Field51_as_Nat_zero",
"depth": 1,
"n_commands": 0,
"n_lines": 23,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n classical\n obtain ⟨ru, hu, hru_mod, hru_lt⟩ := spec_imp_exists (to_bytes_spec u)\n rw [← modEq_zer... | [
{
"name": "zero_mod_lt_zero",
"text": "/-- A value below `p` that is congruent to `0` modulo `p` must be exactly `0`. -/\nprivate lemma zero_mod_lt_zero {u p : ℕ} (hu_lt : u < p) (hu_mod : u ≡ 0 [MOD p]) :\n u = 0 := by\n rw [Nat.ModEq] at hu_mod\n simp only [Nat.zero_mod] at hu_mod\n have : u % p = u... | [
{
"name": "to_bytes_zero_of_Field51_as_Nat_zero",
"fan_in": 2,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 29,
"n_chars": 1319,
"n_subproofs": 6,
"n_tactics": 24,
"cyclomatic": 2,
"n_automation": 4,
"n_rewrites": 3,
"n_structural": 7,
"automation_only":... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -112,11 +112,43 @@
exact (Nat.ModEq.symm h1).trans h2
simpa only [Nat.ModEq] using huv_mod
+/-- A value below `p` that is congruent to `0` modulo `p` must be exactly `0`. -/
+private lemma zero_mod_lt_zero {u p : ℕ} (hu_lt : u < p) (hu_mod : u ≡ 0 [MOD p]) :
+ u = 0 := by
+ rw [Nat.ModEq] at hu_mod
+ ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_2 | 8e15c3574cfa14ec | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 2 | [
{
"theorem_name": "field51_as_Nat_conditional_assign",
"depth": 1,
"n_commands": 0,
"n_lines": 16,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h : c.val = 1#u8\n · simp only [h, ↓reduceIte]\n refine field51_as_Nat_eq_of_pointwise_eq ?... | [
{
"name": "field51_as_Nat_eq_of_pointwise_eq",
"text": "/-- Whole-element `Field51_as_Nat` equality from pointwise limb-value equality. -/\nprivate theorem field51_as_Nat_eq_of_pointwise_eq\n {x y : field.FieldElement51}\n (hxy : ∀ i < 5, x[i]!.val = y[i]!.val) :\n Field51_as_Nat x = Field51_as_Nat... | [
{
"name": "field51_as_Nat_conditional_assign",
"fan_in": 5,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 24,
"n_chars": 926,
"n_subproofs": 2,
"n_tactics": 16,
"cyclomatic": 1,
"n_automation": 6,
"n_rewrites": 0,
"n_structural": 4,
"automation_only": fal... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -395,6 +395,16 @@
have := Nat.mod_two_eq_zero_or_one (b % p)
omega
+/-- Whole-element `Field51_as_Nat` equality from pointwise limb-value equality. -/
+private theorem field51_as_Nat_eq_of_pointwise_eq
+ {x y : field.FieldElement51}
+ (hxy : ∀ i < 5, x[i]!.val = y[i]!.val) :
+ Field51_as_Nat x =... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_3 | 6283718f320fbbfb | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 3 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 2 | [
{
"theorem_name": "field51_as_Nat_conditional_assign",
"depth": 1,
"n_commands": 0,
"n_lines": 16,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h : c.val = 1#u8\n · simp only [h, ↓reduceIte]\n refine field51_as_Nat_eq_of_pointwise_eq ?... | [
{
"name": "field51_as_Nat_eq_of_pointwise_eq",
"text": "/-- Whole-element `Field51_as_Nat` equality from pointwise limb-value equality. -/\nprivate theorem field51_as_Nat_eq_of_pointwise_eq\n {x y : field.FieldElement51}\n (hxy : ∀ i < 5, x[i]!.val = y[i]!.val) :\n Field51_as_Nat x = Field51_as_Nat... | [
{
"name": "field51_as_Nat_conditional_assign_eq_right",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 2,
"n_lines": 11,
"n_chars": 439,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 0,
"n_structural": 0,
"automation_on... | 2 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -395,6 +395,16 @@
have := Nat.mod_two_eq_zero_or_one (b % p)
omega
+/-- Whole-element `Field51_as_Nat` equality from pointwise limb-value equality. -/
+private theorem field51_as_Nat_eq_of_pointwise_eq
+ {x y : field.FieldElement51}
+ (hxy : ∀ i < 5, x[i]!.val = y[i]!.val) :
+ Field51_as_Nat x =... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_4 | e8140ae01a10a398 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 4 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "conditional_negate_nonneg",
"depth": 1,
"n_commands": 0,
"n_lines": 15,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have hr2 :=\n field51_as_Nat_conditional_assign r1 x r2 r_is_negative r2_post\n by_cases h : r_is_negative.v... | [
{
"name": "nonneg_of_neg_mod_p",
"text": "/-- If `a + b ≡ 0 [MOD p]` and `a mod p` is odd, then `b mod p` is even (uses oddness of `p`). -/\nprivate theorem nonneg_of_neg_mod_p (a b : ℕ)\n (h_sum : (a + b) % p = 0) (h_a_odd : a % p % 2 = 1) :\n b % p % 2 = 0 := by\n have hp_pos : 0 < p := by unfold p... | [
{
"name": "conditional_negate_nonneg",
"fan_in": 4,
"n_deps_direct": 2,
"n_deps_transitive": 3,
"n_lines": 24,
"n_chars": 1071,
"n_subproofs": 5,
"n_tactics": 15,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 2,
"n_structural": 1,
"automation_only": false,
... | 3 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -364,6 +364,37 @@
have r := r.trans this
simp [r]
+/-- If `a + b ≡ 0 [MOD p]` and `a mod p` is odd, then `b mod p` is even (uses oddness of `p`). -/
+private theorem nonneg_of_neg_mod_p (a b : ℕ)
+ (h_sum : (a + b) % p = 0) (h_a_odd : a % p % 2 = 1) :
+ b % p % 2 = 0 := by
+ have hp_pos : 0 < p :=... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_5 | b1c624ae88b368bf | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 5 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "check_eq_v_of_sqrt_ratio_data",
"depth": 1,
"n_commands": 0,
"n_lines": 35,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n apply check_post1.trans\n have := fe5_post1.mul_left (Field51_as_Nat v)\n apply this.trans\n have := r_po... | [
{
"name": "sqrt_ratio_collect",
"text": "/-- Algebraic identity used in sqrt_ratio_i: collecting powers of u and v. -/\nprivate theorem sqrt_ratio_collect (u v e : Nat) :\n v * (u ^ 2 * (v ^ (2 + 1)) ^ 2 *\n (u ^ (e * 2) * v ^ (((2 + 1) * 2 + 1) * (e * 2)))) =\n u ^ (2 + e * 2) * v ^ (14 * e + 7)... | [
{
"name": "check_eq_v_of_sqrt_ratio_data",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 63,
"n_chars": 2453,
"n_subproofs": 20,
"n_tactics": 35,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 10,
"n_structural": 4,
"automation_only": fals... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -35,6 +35,12 @@
attribute [-simp] Int.reducePow Nat.reducePow
+/-- Algebraic identity used in sqrt_ratio_i: collecting powers of u and v. -/
+private theorem sqrt_ratio_collect (u v e : Nat) :
+ v * (u ^ 2 * (v ^ (2 + 1)) ^ 2 *
+ (u ^ (e * 2) * v ^ (((2 + 1) * 2 + 1) * (e * 2)))) =
+ u ^ (2 + e * 2) ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_6 | 90d54ecf124b41e2 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 6 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 4 | [
{
"theorem_name": "nat_sqrt_m1_sq_of_add_modeq_zero",
"depth": 1,
"n_commands": 0,
"n_lines": 21,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h_sqrt_eq : (Field51_as_Nat SQRT_M1_val) ^ 2 % p = p - 1 :=\n SQRT_M1_val_spec\n have h_sqrt_mod... | [
{
"name": "sqrt_m1_sq_modEq",
"text": "/-- `SQRT_M1_val` squared is congruent to `p - 1` modulo `p`. -/\nprivate theorem sqrt_m1_sq_modEq :\n Field51_as_Nat SQRT_M1_val ^ 2 ≡ p - 1 [MOD p] := by\n simp [Nat.ModEq, SQRT_M1_val_spec]\n\n",
"fan_in": 4,
"n_lines": 6,
"n_chars": 197,
"n_subp... | [
{
"name": "solve_second_choice_true_choice3_false",
"fan_in": 0,
"n_deps_direct": 9,
"n_deps_transitive": 16,
"n_lines": 123,
"n_chars": 5522,
"n_subproofs": 27,
"n_tactics": 103,
"cyclomatic": 4,
"n_automation": 20,
"n_rewrites": 12,
"n_structural": 20,
"automati... | 16 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -62,6 +62,11 @@
rw [Nat.modEq_zero_iff_dvd] at h ⊢
exact prime_25519.dvd_of_dvd_pow h
+/-- `SQRT_M1_val` squared is congruent to `p - 1` modulo `p`. -/
+private theorem sqrt_m1_sq_modEq :
+ Field51_as_Nat SQRT_M1_val ^ 2 ≡ p - 1 [MOD p] := by
+ simp [Nat.ModEq, SQRT_M1_val_spec]
+
/-- If `a + b ≡ 0 [MOD... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_037bb141f968_7 | 0352570472a09dac | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/SqrtRatioi.lean | SqrtRatioi | 7 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "solve_second_choice_false_choice3_false",
"depth": 1,
"n_commands": 0,
"n_lines": 212,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have r1_eq_r : Field51_as_Nat r1 = Field51_as_Nat r :=\n field51_as_Nat_eq_of_post r r1 r1_pos... | [
{
"name": "modEq_zero_of_pow_modEq_zero",
"text": "/-- If a power is zero modulo the prime `p`, then the base itself is zero modulo `p`. -/\nprivate theorem modEq_zero_of_pow_modEq_zero {a k : ℕ}\n (h : a ^ k ≡ 0 [MOD p]) :\n a ≡ 0 [MOD p] := by\n rw [Nat.modEq_zero_iff_dvd] at h ⊢\n exact prime_255... | [
{
"name": "solve_second_choice_false_choice3_false",
"fan_in": 0,
"n_deps_direct": 9,
"n_deps_transitive": 14,
"n_lines": 237,
"n_chars": 10874,
"n_subproofs": 74,
"n_tactics": 228,
"cyclomatic": 6,
"n_automation": 32,
"n_rewrites": 43,
"n_structural": 38,
"automa... | 14 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve... | @@ -55,6 +55,13 @@
private theorem SQRT_M1_val_spec : (Field51_as_Nat SQRT_M1_val) ^ 2 % p = p - 1 := by
unfold SQRT_M1_val constants.SQRT_M1_raw; decide
+/-- If a power is zero modulo the prime `p`, then the base itself is zero modulo `p`. -/
+private theorem modEq_zero_of_pow_modEq_zero {a k : ℕ}
+ (h : a ^ ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_27a6b9c6a4fb_0 | 760a56a50bc0ab44 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/ToBytes.lean | ToBytes | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 5 | 1 | [
{
"theorem_name": "byte_packing_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 20,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold bytes_match_limbs_52 at hb\n obtain ⟨hs0, hs1, hs2, hs3, hs4, hs5, hs6, hs7, hs8, hs9, hs10, hs11, hs12,\n ... | [
{
"name": "decompose_limb_shift4",
"text": "/-- Decompose a 52-bit limb shifted left by 4: 4-bit nibble plus 6 little-endian bytes. -/\nprivate theorem decompose_limb_shift4 (x : U64) (h : x.val < 2 ^ 52) :\n x.val <<< 4 % 2 ^ 8\n + 2 ^ 8 * (x.val >>> 4 % 2 ^ 8)\n + 2 ^ 16 * (x.val >>> 12 % 2 ^... | [
{
"name": "byte_packing_eq",
"fan_in": 1,
"n_deps_direct": 4,
"n_deps_transitive": 4,
"n_lines": 29,
"n_chars": 1516,
"n_subproofs": 8,
"n_tactics": 20,
"cyclomatic": 1,
"n_automation": 8,
"n_rewrites": 2,
"n_structural": 1,
"automation_only": false,
"max_nest... | 4 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Lim Jin Xing, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-! # Spec theorem
Specificatio... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Lim Jin Xing, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-! # Spec theorem
Specificatio... | @@ -54,6 +54,19 @@
bvify 64 at *
bv_decide
+/-- Decompose a 52-bit limb shifted left by 4: 4-bit nibble plus 6 little-endian bytes. -/
+private theorem decompose_limb_shift4 (x : U64) (h : x.val < 2 ^ 52) :
+ x.val <<< 4 % 2 ^ 8
+ + 2 ^ 8 * (x.val >>> 4 % 2 ^ 8)
+ + 2 ^ 16 * (x.val >>> 12 % 2 ^ 8)
... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_916c46b8c3bd_0 | 183d967ac1799c7d | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/SquareMultiply.lean | SquareMultiply | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "square_multiply_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 21,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold montgomery_invert.square_multiply\n let* ⟨ loop_res, h_loop_math, h_loop_bound, h_loop_canonical ⟩ ← square_m... | [
{
"name": "square_multiply_loop_spec",
"text": "/-- Spec theorem for\n`curve25519_dalek::scalar::Scalar52::montgomery_invert::square_multiply_loop`\n• No panic for canonical input `y` (limbs `< 2 ^ 52`, value `< L`) — self-maintaining since\n `montgomery_square` always produces canonical output\n• After `k... | [
{
"name": "square_multiply_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 38,
"n_chars": 2006,
"n_subproofs": 3,
"n_tactics": 24,
"cyclomatic": 1,
"n_automation": 6,
"n_rewrites": 8,
"n_structural": 2,
"automation_only": false,
"max... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Scalar.Scalar52.MontgomeryMul
import Curv... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Scalar.Scalar52.MontgomeryMul
import Curv... | @@ -20,6 +20,59 @@
open curve25519_dalek.backend.serial.u64.scalar.Scalar52
namespace curve25519_dalek.scalar.Scalar52
+/-- Spec theorem for
+`curve25519_dalek::scalar::Scalar52::montgomery_invert::square_multiply_loop`
+• No panic for canonical input `y` (limbs `< 2 ^ 52`, value `< L`) — self-maintaining since
+ ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_35d7d4ffcb1e_0 | e582946c408295a7 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/SquareInternal.lean | SquareInternal | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 4 | 1 | [
{
"theorem_name": "bounds_sq",
"depth": 1,
"n_commands": 0,
"n_lines": 1,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " bounds_mul hx hx",
"n_chars": 17,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
"n_rewr... | [
{
"name": "bounds_mul",
"text": "/-- Helper: x * y < 2^124 -/\nprivate theorem bounds_mul {x y : Nat} (hx : x < 2 ^ 62) (hy : y < 2 ^ 62) :\n x * y < 2^124 := by\n nlinarith [hx, hy]\n\n",
"fan_in": 1,
"n_lines": 6,
"n_chars": 152,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": ... | [
{
"name": "bounds_sq",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 4,
"n_chars": 147,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": false,
"max_nesting": 1
... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Alessandro D'Angelo, Liao Zhang
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Tactics
import Curve25519Dalek.Specs.... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Alessandro D'Angelo, Liao Zhang
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Tactics
import Curve25519Dalek.Specs.... | @@ -21,8 +21,13 @@
set_option exponentiation.threshold 416
attribute [-simp] Int.reducePow Nat.reducePow
+/-- Helper: x * y < 2^124 -/
+private theorem bounds_mul {x y : Nat} (hx : x < 2 ^ 62) (hy : y < 2 ^ 62) :
+ x * y < 2^124 := by
+ nlinarith [hx, hy]
+
/-- Helper: x * x < 2^124 (Special case for squares) ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_35d7d4ffcb1e_1 | 8bbba0dc6f97cb8a | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/SquareInternal.lean | SquareInternal | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 4 | 1 | [
{
"theorem_name": "square_internal_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 67,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold square_internal backend.serial.u64.scalar.Scalar52.Insts.CoreOpsIndexIndexUsizeU64.index\n step*\n · -- Main... | [
{
"name": "bounds_mul2",
"text": "/-- Helper: 2 * x * y < 2^125 -/\nprivate theorem bounds_mul2 {x y : Nat} (hx : x < 2 ^ 62) (hy : y < 2 ^ 62) :\n 2 * x * y < 2^125 := by\n nlinarith [hx, hy]\n\n",
"fan_in": 1,
"n_lines": 6,
"n_chars": 161,
"n_subproofs": 0,
"n_tactics": 2,
"cyc... | [
{
"name": "square_internal_spec",
"fan_in": 0,
"n_deps_direct": 3,
"n_deps_transitive": 4,
"n_lines": 78,
"n_chars": 4111,
"n_subproofs": 0,
"n_tactics": 80,
"cyclomatic": 5,
"n_automation": 17,
"n_rewrites": 7,
"n_structural": 24,
"automation_only": false,
"m... | 4 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Alessandro D'Angelo, Liao Zhang
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Tactics
import Curve25519Dalek.Specs.... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Alessandro D'Angelo, Liao Zhang
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Tactics
import Curve25519Dalek.Specs.... | @@ -29,6 +29,11 @@
/-- Helper: x * x < 2^124 (Special case for squares) -/
private theorem bounds_sq {x : Nat} (hx : x < 2 ^ 62) : x * x < 2^124 := bounds_mul hx hx
+/-- Helper: 2 * x * y < 2^125 -/
+private theorem bounds_mul2 {x y : Nat} (hx : x < 2 ^ 62) (hy : y < 2 ^ 62) :
+ 2 * x * y < 2^125 := by
+ nlinar... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_84ddca3cf61c_0 | 4913d4fcc849d005 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/AsRadix16.lean | AsRadix16 | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 12 | 1 | [
{
"theorem_name": "inv_step",
"depth": 1,
"n_commands": 0,
"n_lines": 26,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h2i1 : 2 * (i + 1) = 2 * i + 1 + 1 := by ring\n rw [h2i1, Finset.sum_range_succ, show 2 * i + 1 = 2 * i + 0 + 1 from by rin... | [
{
"name": "nibble_identity",
"text": "private lemma nibble_identity (b i : ℕ) :\n (↑(b % 16) : ℤ) * (16 : ℤ) ^ (2 * i) + (↑(b / 16) : ℤ) * (16 : ℤ) ^ (2 * i + 1) =\n ↑b * (256 : ℤ) ^ i := by\n have h256 : (16 : ℤ) ^ (2 * i) = (256 : ℤ) ^ i := by\n rw [pow_mul]\n ring_nf\n have h16 : (16 : ℤ) ^... | [
{
"name": "inv_step",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 38,
"n_chars": 1867,
"n_subproofs": 6,
"n_tactics": 28,
"cyclomatic": 1,
"n_automation": 9,
"n_rewrites": 10,
"n_structural": 4,
"automation_only": false,
"max_nesting": ... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | @@ -102,6 +102,21 @@
def I8x64_as_Radix16 (digits : Array I8 64#usize) : ℤ :=
∑ i ∈ Finset.range 64, (16 : ℤ)^i * (digits[i]!).val
+private lemma nibble_identity (b i : ℕ) :
+ (↑(b % 16) : ℤ) * (16 : ℤ) ^ (2 * i) + (↑(b / 16) : ℤ) * (16 : ℤ) ^ (2 * i + 1) =
+ ↑b * (256 : ℤ) ^ i := by
+ have h256 : (16 : ℤ)... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_84ddca3cf61c_1 | eef32c90c3d36996 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/AsRadix16.lean | AsRadix16 | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 12 | 1 | [
{
"theorem_name": "as_radix_16_loop0_spec_strong",
"depth": 1,
"n_commands": 0,
"n_lines": 104,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold as_radix_16_loop0\n split\n case isTrue hlt =>\n have hi' : i.val < 32 := by scalar_tac\n un... | [
{
"name": "bounds_step",
"text": "private lemma bounds_step\n (output a : Array I8 64#usize) (i : ℕ)\n (i4 i7 : I8)\n (hi4_pos : (0 : ℤ) ≤ i4.val) (hi4_le : i4.val ≤ 15)\n (hi7_pos : (0 : ℤ) ≤ i7.val) (hi7_le : i7.val ≤ 15)\n (ha_even : (a)[2 * i]! = i4)\n (ha_odd : (a)[2 * i + 1]! = i7)\n... | [
{
"name": "as_radix_16_loop0_spec_strong",
"fan_in": 1,
"n_deps_direct": 3,
"n_deps_transitive": 4,
"n_lines": 118,
"n_chars": 4729,
"n_subproofs": 34,
"n_tactics": 108,
"cyclomatic": 2,
"n_automation": 36,
"n_rewrites": 16,
"n_structural": 13,
"automation_only": ... | 4 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | @@ -180,6 +180,25 @@
rw [ha_later j hj1 hj2]
exact h_tail j (by omega) hj2
+private lemma bounds_step
+ (output a : Array I8 64#usize) (i : ℕ)
+ (i4 i7 : I8)
+ (hi4_pos : (0 : ℤ) ≤ i4.val) (hi4_le : i4.val ≤ 15)
+ (hi7_pos : (0 : ℤ) ≤ i7.val) (hi7_le : i7.val ≤ 15)
+ (ha_even : (a)[2 * i]! = i4)
... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_84ddca3cf61c_2 | c57075f6446201a5 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/AsRadix16.lean | AsRadix16 | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 12 | 1 | [
{
"theorem_name": "as_radix_16_loop0_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 3,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": "\n as_radix_16_loop0_spec_strong self output i hi h_inv h_tail\n h_bounds",
"n_chars": 75,
"n_subproofs": 0,
... | [
{
"name": "as_radix_16_loop0_spec_strong",
"text": "private theorem as_radix_16_loop0_spec_strong\n (self : Scalar)\n (output : Array I8 64#usize)\n (i : Usize)\n (hi : i.val ≤ 32)\n (h_inv : ∑ j ∈ Finset.range (2 * i.val), (16 : ℤ) ^ j * (output[j]!).val =\n ↑(∑ k ∈ Finset.range ... | [
{
"name": "as_radix_16_loop0_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 5,
"n_lines": 55,
"n_chars": 2637,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": false,
"ma... | 5 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | @@ -199,6 +199,123 @@
· have hj_eq : j = 2 * i + 1 := by omega
subst hj_eq; rw [ha_odd]; exact ⟨hi7_pos, hi7_le⟩
+private theorem as_radix_16_loop0_spec_strong
+ (self : Scalar)
+ (output : Array I8 64#usize)
+ (i : Usize)
+ (hi : i.val ≤ 32)
+ (h_inv : ∑ j ∈ Finset.range (2 * i.val), (16 :... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_84ddca3cf61c_3 | 92b9f22239a95828 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/AsRadix16.lean | AsRadix16 | 3 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 12 | 2 | [
{
"theorem_name": "lo_bounds_step",
"depth": 1,
"n_commands": 0,
"n_lines": 3,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h := recenter_in_range d\n omega",
"n_chars": 43,
"n_subproofs": 1,
"n_tactics": 3,
"cyclomatic": 1,
... | [
{
"name": "recenter_in_range",
"text": "private lemma recenter_in_range (d : ℤ) :\n -8 ≤ d - (d + 8) / 16 * 16 ∧ d - (d + 8) / 16 * 16 ≤ 7 := by\n omega\n\n",
"fan_in": 2,
"n_lines": 5,
"n_chars": 124,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": 1,
"n_automation": 1,
... | [
{
"name": "lo_bounds_step",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 8,
"n_chars": 194,
"n_subproofs": 1,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": false,
"max_nesting"... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | @@ -374,6 +374,10 @@
(d + 8) / 16 = 0 ∨ (d + 8) / 16 = 1 := by
omega
+private lemma recenter_in_range (d : ℤ) :
+ -8 ≤ d - (d + 8) / 16 * 16 ∧ d - (d + 8) / 16 * 16 ≤ 7 := by
+ omega
+
private lemma next_digit_bounded (d' carry : ℤ)
(hd_lo : 0 ≤ d') (hd_hi : d' ≤ 15)
(hc : carry = 0 ∨ carry = 1... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_84ddca3cf61c_4 | 0d3877847e94e1d2 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/AsRadix16.lean | AsRadix16 | 4 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 12 | 1 | [
{
"theorem_name": "as_radix_16_loop1_spec_strong",
"depth": 1,
"n_commands": 0,
"n_lines": 94,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold as_radix_16_loop1\n split\n case isTrue hlt =>\n have hi' : i.val < 63 := by scalar_tac\n hav... | [
{
"name": "lo_bounds_prefix_step",
"text": "private lemma lo_bounds_prefix_step\n (output a : Array I8 64#usize) (i : ℕ)\n (i4 : I8)\n (hi4_lo : -8 ≤ (i4 : I8).val) (hi4_hi : (i4 : I8).val ≤ 7)\n (ha_curr : a[i]! = i4)\n (ha_other : ∀ j, j ≠ i → j ≠ i + 1 → (a[j]! : I8).val = (output[j]!).val... | [
{
"name": "as_radix_16_loop1_spec_strong",
"fan_in": 1,
"n_deps_direct": 8,
"n_deps_transitive": 8,
"n_lines": 126,
"n_chars": 5146,
"n_subproofs": 31,
"n_tactics": 105,
"cyclomatic": 2,
"n_automation": 32,
"n_rewrites": 16,
"n_structural": 22,
"automation_only": ... | 6 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | @@ -490,6 +490,24 @@
rw [ha_other j (by omega) (by omega)]
exact h_tail j (by omega) hj2
+private lemma lo_bounds_prefix_step
+ (output a : Array I8 64#usize) (i : ℕ)
+ (i4 : I8)
+ (hi4_lo : -8 ≤ (i4 : I8).val) (hi4_hi : (i4 : I8).val ≤ 7)
+ (ha_curr : a[i]! = i4)
+ (ha_other : ∀ j, j ≠ i → j ≠ i... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_84ddca3cf61c_5 | dc7c7a0b207caa2d | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/AsRadix16.lean | AsRadix16 | 5 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 12 | 1 | [
{
"theorem_name": "as_radix_16_loop1_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 2,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": "\n as_radix_16_loop1_spec_strong output i V hi h_val h_lo h_curr h_tail",
"n_chars": 71,
"n_subproofs": 0,
"n_... | [
{
"name": "as_radix_16_loop1_spec_strong",
"text": "/-- **Stronger loop 1 spec** tracking all invariant components together:\n\n Invariants maintained at loop-counter `i`:\n 1. `I8x64_as_Radix16 output = V` (value preserved throughout).\n 2. `∀ j < i, −8 ≤ output[j].val ∧ output[j].val < 8` (recent... | [
{
"name": "as_radix_16_loop1_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 9,
"n_lines": 58,
"n_chars": 2754,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": false,
"ma... | 7 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve25519_dalek::scalar::Scalar::as_radi... | @@ -508,6 +508,131 @@
/-! ## The Main Inductive Proof (Strong Form) -/
+/-- **Stronger loop 1 spec** tracking all invariant components together:
+
+ Invariants maintained at loop-counter `i`:
+ 1. `I8x64_as_Radix16 output = V` (value preserved throughout).
+ 2. `∀ j < i, −8 ≤ output[j].val ∧ output[j].val... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_11c3ba99abc7_2 | 811dfc6fbf612a33 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/MontgomeryReduce.lean | MontgomeryReduce | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 9 | 1 | [
{
"theorem_name": "montgomery_reduce_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 344,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold montgomery_reduce\n unfold Insts.CoreOpsIndexIndexUsizeU64.index\n try simp only [step_simps]\n let* ⟨ i... | [
{
"name": "a8_bound_of_canonical",
"text": "/-- From `Scalar52_wide_as_Nat a < R * L`, derive `a[8]!.val < 2^97`.\n Keeps all exponents ≤ 416 (within threshold) by rewriting `2^260 * 2^253 = 2^416 * 2^97`. -/\nprivate lemma a8_bound_of_canonical (a : Aeneas.Std.Array U128 9#usize)\n (h_canonical : Sca... | [
{
"name": "montgomery_reduce_spec",
"fan_in": 0,
"n_deps_direct": 9,
"n_deps_transitive": 11,
"n_lines": 352,
"n_chars": 19508,
"n_subproofs": 89,
"n_tactics": 458,
"cyclomatic": 6,
"n_automation": 133,
"n_rewrites": 139,
"n_structural": 143,
"automation_only": fa... | 9 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.ExternallyVerified
import Curve25519Dalek.Specs.... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.ExternallyVerified
import Curve25519Dalek.Specs.... | @@ -186,6 +186,26 @@
_ = 2^76 * 2^52 := by norm_num
exact ⟨h_w_val, h_carry_val, h_carry_bound, h_w_bound⟩
+/-- From `Scalar52_wide_as_Nat a < R * L`, derive `a[8]!.val < 2^97`.
+ Keeps all exponents ≤ 416 (within threshold) by rewriting `2^260 * 2^253 = 2^416 * 2^97`. -/
+private lemma a8_bound_of_ca... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_6df863f3116d_0 | d831570f95e52c10 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/ReadLeU64Into.lean | ReadLeU64Into | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 9 | 1 | [
{
"theorem_name": "chunk_sum_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n induction n with\n | zero => simp\n | succ n ih =>\n rw [chunk_step_identity src n, ih, Finset.sum_range_succ]",
"n_c... | [
{
"name": "chunk_step_identity",
"text": "private lemma chunk_step_identity (src : Slice U8) (k : ℕ) :\n ∑ j ∈ Finset.range (8 * (k + 1)), (src.val[j]!).val * 2 ^ (8 * j) =\n ∑ j ∈ Finset.range (8 * k), (src.val[j]!).val * 2 ^ (8 * j) +\n U8Slice_chunk_as_U64 src k * 2 ^ (64 * k) := by\n have h_sp... | [
{
"name": "chunk_sum_eq",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 9,
"n_chars": 320,
"n_subproofs": 0,
"n_tactics": 5,
"cyclomatic": 2,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_nesting": ... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve... | @@ -60,12 +60,30 @@
def U64Slice_as_Nat (dst : Slice U64) (n : ℕ) : ℕ :=
∑ k ∈ Finset.range n, (dst.val[k]!).val * 2 ^ (64 * k)
+private lemma chunk_step_identity (src : Slice U8) (k : ℕ) :
+ ∑ j ∈ Finset.range (8 * (k + 1)), (src.val[j]!).val * 2 ^ (8 * j) =
+ ∑ j ∈ Finset.range (8 * k), (src.val[j]!).val ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_6df863f3116d_1 | bb7dc34f62dd9508 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/ReadLeU64Into.lean | ReadLeU64Into | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 9 | 1 | [
{
"theorem_name": "from_le_bytes_val_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 17,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n apply spec_mono (core.num.U64.from_le_bytes.step_spec bytes)\n intro result hbv\n have h_val : result.val = (BitV... | [
{
"name": "fromLEBytes_toNat_list",
"text": "private lemma fromLEBytes_toNat_list (l : List Byte) :\n (BitVec.fromLEBytes l).toNat =\n ∑ j ∈ Finset.range l.length, (l[j]!).toNat * 2 ^ (8 * j) := by\n induction l with\n | nil => simp [BitVec.fromLEBytes]\n | cons b l ih =>\n unfold BitVec.fromLEB... | [
{
"name": "from_le_bytes_val_spec",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 29,
"n_chars": 1088,
"n_subproofs": 4,
"n_tactics": 19,
"cyclomatic": 1,
"n_automation": 6,
"n_rewrites": 3,
"n_structural": 4,
"automation_only": false,
"m... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve... | @@ -96,6 +96,53 @@
Finset.sum_congr rfl (fun k hk => by rw [h_inv k (Finset.mem_range.mp hk)])]
exact (chunk_sum_eq src n).symm
+private lemma fromLEBytes_toNat_list (l : List Byte) :
+ (BitVec.fromLEBytes l).toNat =
+ ∑ j ∈ Finset.range l.length, (l[j]!).toNat * 2 ^ (8 * j) := by
+ induction l with
+ ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_6df863f3116d_2 | 41bd0b1b16b959ff | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/ReadLeU64Into.lean | ReadLeU64Into | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 9 | 1 | [
{
"theorem_name": "read_le_u64_into_combined_value",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n apply spec_mono (read_le_u64_into_spec src dst n hn h_src_len)\n intro result ⟨_, h_nat⟩\n exact h_nat",
... | [
{
"name": "read_le_u64_into_spec",
"text": "/-- **Spec theorem for `curve25519_dalek::scalar::read_le_u64_into`**\n• The function always succeeds whenever `src.len = 8 * n`.\n• **Element correctness**: `∀ k < n, result[k].val = U8Slice_chunk_as_U64 src k`.\n• **Combined-value preservation**: `U64Slice_as_Na... | [
{
"name": "read_le_u64_into_combined_value",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 16,
"n_chars": 720,
"n_subproofs": 0,
"n_tactics": 4,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 3,
"automation_only": false,... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
/-!
# Spec theorem for `curve... | @@ -336,6 +336,26 @@
∑ j ∈ Finset.range (8 * n), (src.val[j]!).val * 2 ^ (8 * j) ⦄ :=
read_le_u64_into_loop_spec_strong src dst i n hn h_src_len hi h_inv
+/-- **Spec theorem for `curve25519_dalek::scalar::read_le_u64_into`**
+• The function always succeeds whenever `src.len = 8 * n`.
+• **Element correctn... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_37000725e3a1_11 | 5a459d15fff802ee | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Montgomery/MontgomeryPoint/ElligatorEncode.lean | ElligatorEncode | 11 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 2 | [
{
"theorem_name": "fe1_inv_of_mod_mul",
"depth": 1,
"n_commands": 0,
"n_lines": 13,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have hb_ne : (d1_val : CurveField) ≠ 0 := by\n intro h1\n apply h_nonzero\n have : d1_val ≡ 0 [MOD p] := by rw... | [
{
"name": "modEq_one_iff",
"text": "private theorem modEq_one_iff (a : ℕ) : a ≡ 1 [MOD p] ↔ a % p = 1 := by\n simp only [Nat.ModEq]\n have : 1 % p = 1 := by unfold p; decide\n rw [this]\n\n",
"fan_in": 2,
"n_lines": 6,
"n_chars": 157,
"n_subproofs": 1,
"n_tactics": 5,
"cyclomatic"... | [
{
"name": "elligator_encode_spec",
"fan_in": 0,
"n_deps_direct": 8,
"n_deps_transitive": 21,
"n_lines": 262,
"n_chars": 12953,
"n_subproofs": 40,
"n_tactics": 234,
"cyclomatic": 10,
"n_automation": 43,
"n_rewrites": 31,
"n_structural": 28,
"automation_only": false... | 21 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.FunsExternal
import Curve25519Dalek.Aux
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Mo... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.FunsExternal
import Curve25519Dalek.Aux
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Mo... | @@ -57,6 +57,11 @@
private theorem modEq_zero_iff (a n : ℕ) : a ≡ 0 [MOD n] ↔ a % n = 0 := by simp [Nat.ModEq]
+private theorem modEq_one_iff (a : ℕ) : a ≡ 1 [MOD p] ↔ a % p = 1 := by
+ simp only [Nat.ModEq]
+ have : 1 % p = 1 := by unfold p; decide
+ rw [this]
+
private theorem mod_mul_mod (a b : ℕ) : (a % p)... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_88a1a1412f4a_0 | e776769d330e778b | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/ProjectiveNielsPoint/ConditionalAssign.lean | ConditionalAssign | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "conditional_assign_point",
"depth": 1,
"n_commands": 0,
"n_lines": 33,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n let* ⟨ r, r_post1, r_post2, r_post3, r_post4 ⟩ ← conditional_assign_spec\n -- Case-split on the Choice's `valid`... | [
{
"name": "conditional_assign_spec",
"text": "/-- **Spec theorem**\n\nSpecification for\n`curve25519_dalek::backend::serial::curve_models::ProjectiveNielsPoint::conditional_assign`.\n• No panic (always returns successfully)\n• Given inputs:\n • a ProjectiveNielsPoint `self` with coordinates (Y_plus_X, Y_mi... | [
{
"name": "conditional_assign_point",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 50,
"n_chars": 2489,
"n_subproofs": 11,
"n_tactics": 37,
"cyclomatic": 6,
"n_automation": 7,
"n_rewrites": 3,
"n_structural": 7,
"automation_only": false,
... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Aux
import Curve255... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Aux
import Curve255... | @@ -36,6 +36,37 @@
namespace curve25519_dalek.backend.serial.curve_models.ProjectiveNielsPoint.Insts
namespace SubtleConditionallySelectable
+/-- **Spec theorem**
+
+Specification for
+`curve25519_dalek::backend::serial::curve_models::ProjectiveNielsPoint::conditional_assign`.
+• No panic (always returns successful... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c1d5adc8ffff_0 | 830a92ae060d905a | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Window/LookupTable/From.lean | From | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 2 | 1 | [
{
"theorem_name": "from_loop_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 103,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold from_loop\n obtain ⟨o, iter1, h_next, h_none_branch, h_some_branch⟩ :=\n scalar.Scalar.Insts.SubtleConditionall... | [
{
"name": "Array_PNP_8_update_spec",
"text": "/-- Two-conjunct wrapper around `Array.update_spec` for `ProjectiveNielsPoint` arrays of length 8.\nProvides:\n• `arr'[k]! = arr[k]!` for indices `k ≠ j.val`,\n• `arr'[j.val]! = v` at the updated index. -/\n@[step]\nprivate lemma Array_PNP_8_update_spec (arr : A... | [
{
"name": "from_loop_spec",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 126,
"n_chars": 6362,
"n_subproofs": 25,
"n_tactics": 102,
"cyclomatic": 2,
"n_automation": 16,
"n_rewrites": 22,
"n_structural": 23,
"automation_only": false,
"max... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Edwards.Cu... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Edwards.Cu... | @@ -42,6 +42,27 @@
instance : Inhabited ProjectiveNielsPoint where
default := ⟨default, default, default, default⟩
+/-- Two-conjunct wrapper around `Array.update_spec` for `ProjectiveNielsPoint` arrays of length 8.
+Provides:
+• `arr'[k]! = arr[k]!` for indices `k ≠ j.val`,
+• `arr'[j.val]! = v` at the updated in... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c1d5adc8ffff_1 | 16ebeca913787770 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Window/LookupTable/From.lean | From | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 2 | 1 | [
{
"theorem_name": "from_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 22,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold «from»\n simp only [step_simps]\n let* ⟨ pnp, pnp_post1, pnp_post2, pnp_post3, pnp_post4, pnp_post5, pnp_post6, pnp_pos... | [
{
"name": "from_loop_spec",
"text": "/-- Loop spec for `from_loop`: given a `points` array whose prefix `[0, iter.start.val]`\n(i.e. `iter.start.val + 1` entries) already holds `[P, 2P, ..., (iter.start.val + 1)P]` as\nvalid `ProjectiveNielsPoint`s, the loop extends the prefix to cover all 8 indices.\n\nLoo... | [
{
"name": "from_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 2,
"n_lines": 33,
"n_chars": 1435,
"n_subproofs": 4,
"n_tactics": 24,
"cyclomatic": 1,
"n_automation": 10,
"n_rewrites": 4,
"n_structural": 3,
"automation_only": false,
"max_nesting":... | 2 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Edwards.Cu... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Edwards.Cu... | @@ -63,6 +63,131 @@
· simp only [Array.getElem!_Nat_eq, Array.set_val_eq]
exact List.getElem!_set arr.val j.val v (by scalar_tac)
+/-- Loop spec for `from_loop`: given a `points` array whose prefix `[0, iter.start.val]`
+(i.e. `iter.start.val + 1` entries) already holds `[P, 2P, ..., (iter.start.val + 1)P]` a... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_26cf7a5347f1_0 | 00646e4153ca30a5 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/CompletedPoint/Add.lean | Add | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "add_spec'",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold Shared0FieldElement51.Insts.CoreOpsArithAddSharedAFieldElement51FieldElement51.add\n obtain ⟨w, hw_ok, hw, hw0 ⟩:= add_as... | [
{
"name": "add_assign_spec'",
"text": "/-- **Helper for `curve25519_dalek::backend::serial::curve_models::CompletedPoint::add`**\n• No panic (always returns successfully)\n• Given inputs:\n • an EdwardsPoint `self` with coordinates (X, Y, Z, T), and\n • a ProjectiveNielsPoint `other` with coordinates (Y_p... | [
{
"name": "add_spec'",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 10,
"n_chars": 436,
"n_subproofs": 1,
"n_tactics": 4,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_nesting": 2
... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | @@ -46,11 +46,52 @@
open curve25519_dalek.Shared0FieldElement51.Insts.CoreOpsArithAddSharedAFieldElement51FieldElement51
namespace curve25519_dalek.backend.serial.curve_models.CompletedPoint
+/-- **Helper for `curve25519_dalek::backend::serial::curve_models::CompletedPoint::add`**
+• No panic (always returns succes... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_26cf7a5347f1_1 | 8059f9421b36cbe6 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/CompletedPoint/Add.lean | Add | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "add_spec_52_52",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold Shared0FieldElement51.Insts.CoreOpsArithAddSharedAFieldElement51FieldElement51.add\n obtain ⟨w, hw_ok, hw_eq, hw_bou... | [
{
"name": "add_assign_spec_52_52",
"text": "/-- Tighter add_assign spec: (< 2^52) + (< 2^52) → < 2^53 -/\ntheorem add_assign_spec_52_52 (a b : Array U64 5#usize)\n (ha : ∀ i < 5, a[i]!.val < 2 ^ 52)\n (hb : ∀ i < 5, b[i]!.val < 2 ^ 52) :\n ∃ result, add_assign a b = ok result ∧\n (∀ i < 5, (resu... | [
{
"name": "add_spec_52_52",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 11,
"n_chars": 525,
"n_subproofs": 1,
"n_tactics": 4,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_nesting... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | @@ -46,12 +46,38 @@
open curve25519_dalek.Shared0FieldElement51.Insts.CoreOpsArithAddSharedAFieldElement51FieldElement51
namespace curve25519_dalek.backend.serial.curve_models.CompletedPoint
+/-- Tighter add_assign spec: (< 2^52) + (< 2^52) → < 2^53 -/
+theorem add_assign_spec_52_52 (a b : Array U64 5#usize)
+ (... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_26cf7a5347f1_2 | 60e8d5c76dc48811 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/CompletedPoint/Add.lean | Add | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "add_spec_53_52",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold Shared0FieldElement51.Insts.CoreOpsArithAddSharedAFieldElement51FieldElement51.add\n obtain ⟨w, hw_ok, hw_eq, hw_bou... | [
{
"name": "add_assign_spec_53_52",
"text": "/-- Tighter add_assign spec: (< 2^53) + (< 2^52) → < 2^54 -/\ntheorem add_assign_spec_53_52 (a b : Array U64 5#usize)\n (ha : ∀ i < 5, a[i]!.val < 2 ^ 53)\n (hb : ∀ i < 5, b[i]!.val < 2 ^ 52) :\n ∃ result, add_assign a b = ok result ∧\n (∀ i < 5, (resu... | [
{
"name": "add_spec_53_52",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 15,
"n_chars": 743,
"n_subproofs": 1,
"n_tactics": 4,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_nesting... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | @@ -46,12 +46,38 @@
open curve25519_dalek.Shared0FieldElement51.Insts.CoreOpsArithAddSharedAFieldElement51FieldElement51
namespace curve25519_dalek.backend.serial.curve_models.CompletedPoint
+/-- Tighter add_assign spec: (< 2^53) + (< 2^52) → < 2^54 -/
+theorem add_assign_spec_53_52 (a b : Array U64 5#usize)
+ (... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_26cf7a5347f1_3 | edf4556b1225eabc | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/CompletedPoint/Add.lean | Add | 3 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "add_spec_algebraic",
"depth": 1,
"n_commands": 0,
"n_lines": 92,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n -- Simplify to get direct expressions for c.X, c.Y, c.T\n have hX_F' : c.X.toField = (self.Y.toField + self.X.toField)... | [
{
"name": "add_Y_coord_factored",
"text": "/-- Factor the Y coordinate of the completed point:\n Y' = (Y1+X1)*YpX + (Y1-X1)*YmX = 2*Z1*Z2*(y1*y2 + x1*x2). -/\nprivate lemma add_Y_coord_factored\n (cY YpX YmX X1 Y1 Z1 Z2 x1 y1 x2 y2 : CurveField)\n (hY_F' : cY = (Y1 + X1) * YpX + (Y1 - X1) * YmX)\n ... | [
{
"name": "add_spec_aux_54_52_53_52",
"fan_in": 1,
"n_deps_direct": 5,
"n_deps_transitive": 19,
"n_lines": 83,
"n_chars": 4461,
"n_subproofs": 4,
"n_tactics": 38,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
... | 18 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | @@ -383,6 +383,16 @@
cX = 2 * Z1 * Z2 * (x1 * y2 + y1 * x2) := by
rw [hX_F', hYpX, hYmX, hX1, hY1]; ring
+/-- Factor the Y coordinate of the completed point:
+ Y' = (Y1+X1)*YpX + (Y1-X1)*YmX = 2*Z1*Z2*(y1*y2 + x1*x2). -/
+private lemma add_Y_coord_factored
+ (cY YpX YmX X1 Y1 Z1 Z2 x1 y1 x2 y2 : CurveFi... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_26cf7a5347f1_4 | aed9e41e57f6516b | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/CompletedPoint/Add.lean | Add | 4 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 22 | 1 | [
{
"theorem_name": "add_spec_algebraic",
"depth": 1,
"n_commands": 0,
"n_lines": 92,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n -- Simplify to get direct expressions for c.X, c.Y, c.T\n have hX_F' : c.X.toField = (self.Y.toField + self.X.toField)... | [
{
"name": "add_X_coord_factored",
"text": "/-- Factor the X coordinate of the completed point:\n X' = (Y1+X1)*YpX - (Y1-X1)*YmX = 2*Z1*Z2*(x1*y2 + y1*x2). -/\nprivate lemma add_X_coord_factored\n (cX YpX YmX X1 Y1 Z1 Z2 x1 y1 x2 y2 : CurveField)\n (hX_F' : cX = (Y1 + X1) * YpX - (Y1 - X1) * YmX)\n ... | [
{
"name": "add_spec_algebraic",
"fan_in": 1,
"n_deps_direct": 11,
"n_deps_transitive": 11,
"n_lines": 129,
"n_chars": 6959,
"n_subproofs": 34,
"n_tactics": 84,
"cyclomatic": 1,
"n_automation": 11,
"n_rewrites": 2,
"n_structural": 4,
"automation_only": false,
"... | 11 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong, Oliver Butterley
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.S... | @@ -373,6 +373,16 @@
· simp only [hx]; field_simp [hZ_ne]
· simp only [hy]; field_simp [hZ_ne]
+/-- Factor the X coordinate of the completed point:
+ X' = (Y1+X1)*YpX - (Y1-X1)*YmX = 2*Z1*Z2*(x1*y2 + y1*x2). -/
+private lemma add_X_coord_factored
+ (cX YpX YmX X1 Y1 Z1 Z2 x1 y1 x2 y2 : CurveField)
+ (h... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_7ad06acc5e14_0 | 2e7f3b41fd7754a2 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Edwards/EdwardsPoint/Eq.lean | Eq | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "eq_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 24,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold eq\n step*\n · have := h_self_valid.X_bounds\n grind\n · have := h_self_valid.Y_bounds\n grind\n · have := h_self... | [
{
"name": "Choice.eq_one",
"text": "/-- If `c.val = 1`, then `c = Choice.one` (by proof irrelevance on the `valid` field). -/\n@[simp]\ntheorem Choice.eq_one (c : subtle.Choice) : c.val = 1#u8 → c = Choice.one := by\n intro h; cases c; simp_all only [Choice.one]\n\n",
"fan_in": 1,
"n_lines": 6,
... | [
{
"name": "eq_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 34,
"n_chars": 1042,
"n_subproofs": 7,
"n_tactics": 24,
"cyclomatic": 2,
"n_automation": 7,
"n_rewrites": 4,
"n_structural": 4,
"automation_only": false,
"max_nesting": 8
... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Montgomery.Curve
import Curve25519Dalek.Specs.Ed... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Montgomery.Curve
import Curve25519Dalek.Specs.Ed... | @@ -30,6 +30,11 @@
namespace curve25519_dalek
+/-- If `c.val = 1`, then `c = Choice.one` (by proof irrelevance on the `valid` field). -/
+@[simp]
+theorem Choice.eq_one (c : subtle.Choice) : c.val = 1#u8 → c = Choice.one := by
+ intro h; cases c; simp_all only [Choice.one]
+
end curve25519_dalek
namespace cur... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_28a0ddee9d23_0 | a88b5bb143dd7454 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/ScalarMul/VariableBase/Mul.lean | Mul | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "mul_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 45,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold mul\n -- 1. Build lookup table [P, 2P, ..., 8P].\n let* ⟨ lookup_table, h_table_valid, h_table_point ⟩ ←\n window.Loo... | [
{
"name": "scalar_digit_63_le_8",
"text": "/-- Local bound-tightening lemma: given the weak spec output of `as_radix_16`\n(with the `s_63 ≤ 16` postcondition) plus the scalar invariant `U8x32_as_Nat < 2^255`,\nderive the tighter bound `s_63 ≤ 8` needed by `select_spec`.\n\nArgument: `s_63 * 16^63 + ∑_{i<63}... | [
{
"name": "mul_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 58,
"n_chars": 3110,
"n_subproofs": 6,
"n_tactics": 33,
"cyclomatic": 1,
"n_automation": 2,
"n_rewrites": 7,
"n_structural": 1,
"automation_only": false,
"max_nesting": 6... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Specs.Backend.S... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Specs.Backend.S... | @@ -32,6 +32,56 @@
namespace curve25519_dalek.backend.serial.scalar_mul.variable_base
+/-- Local bound-tightening lemma: given the weak spec output of `as_radix_16`
+(with the `s_63 ≤ 16` postcondition) plus the scalar invariant `U8x32_as_Nat < 2^255`,
+derive the tighter bound `s_63 ≤ 8` needed by `select_spec`.
... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c1271bc3ddd5_0 | c81a36558c02638c | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Window/LookupTable/Select.lean | Select | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 2 | 1 | [
{
"theorem_name": "select_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 151,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold select\n simp only [step_simps]\n let* ⟨ hx ⟩ ← massert_spec\n let* ⟨ i, i_post ⟩ ← IScalar.cast.step_spec\n let* ... | [
{
"name": "select_loop_spec",
"text": "/-- **Spec theorem for the loop body of `curve25519_dalek::window::LookupTable::select`**\n• The function always succeeds (no panic) under the loop invariants (a valid\n table `[P, 2P, ..., 8P]`, `1 ≤ iter.start.val ≤ 9`, `iter.«end».val = 9`,\n `0 ≤ xabs.val ≤ 8`, a... | [
{
"name": "select_spec",
"fan_in": 0,
"n_deps_direct": 2,
"n_deps_transitive": 2,
"n_lines": 174,
"n_chars": 8614,
"n_subproofs": 35,
"n_tactics": 175,
"cyclomatic": 5,
"n_automation": 34,
"n_rewrites": 49,
"n_structural": 23,
"automation_only": false,
"max_ne... | 2 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Edwards.Cu... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dalek.Math.Edwards.Cu... | @@ -76,6 +76,160 @@
rw [h_val_eq]
omega
+/-- **Spec theorem for the loop body of `curve25519_dalek::window::LookupTable::select`**
+• The function always succeeds (no panic) under the loop invariants (a valid
+ table `[P, 2P, ..., 8P]`, `1 ≤ iter.start.val ≤ 9`, `iter.«end».val = 9`,
+ `0 ≤ xabs.val ≤ 8`,... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_0 | 6da420304a1202bb | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "mod_sq_mod_mul",
"depth": 1,
"n_commands": 0,
"n_lines": 2,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n exact (Nat.ModEq.mul_right b (mod_sq_mod a p))",
"n_chars": 52,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomati... | [
{
"name": "mod_sq_mod",
"text": "/-- Squaring after reduction modulo `p` agrees with squaring first modulo `p`. -/\ntheorem mod_sq_mod (a p : ℕ) : (a % p) ^ 2 ≡ a ^ 2 [MOD p] := by\n exact (Nat.mod_modEq a p).pow 2\n\n",
"fan_in": 1,
"n_lines": 5,
"n_chars": 186,
"n_subproofs": 0,
"n_ta... | [
{
"name": "mod_sq_mod_mul",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 5,
"n_chars": 183,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 1,
"automation_only": false,
"max_nesting"... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -139,8 +139,13 @@
open Edwards ZMod
+/-- Squaring after reduction modulo `p` agrees with squaring first modulo `p`. -/
+theorem mod_sq_mod (a p : ℕ) : (a % p) ^ 2 ≡ a ^ 2 [MOD p] := by
+ exact (Nat.mod_modEq a p).pow 2
+
/-- Square-then-multiply form of `mod_sq_mod`. -/
-theorem mod_sq_mod_mul (a b p : ℕ) : (... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_1 | 7ba29d0e66080617 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "mod_sq_mod_mul",
"depth": 1,
"n_commands": 0,
"n_lines": 2,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n exact (Nat.ModEq.mul_right b (mod_sq_mod a p))",
"n_chars": 52,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomati... | [
{
"name": "mod_sq_mod",
"text": "/-- Squaring after reduction modulo `p` agrees with squaring first modulo `p`. -/\ntheorem mod_sq_mod (a p : ℕ) : (a % p) ^ 2 ≡ a ^ 2 [MOD p] := by\n exact (Nat.mod_modEq a p).pow 2\n\n",
"fan_in": 1,
"n_lines": 5,
"n_chars": 186,
"n_subproofs": 0,
"n_ta... | [
{
"name": "mod_sq_mod_mul_eq",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 2,
"n_lines": 6,
"n_chars": 181,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_nesti... | 2 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -139,8 +139,13 @@
open Edwards ZMod
+/-- Squaring after reduction modulo `p` agrees with squaring first modulo `p`. -/
+theorem mod_sq_mod (a p : ℕ) : (a % p) ^ 2 ≡ a ^ 2 [MOD p] := by
+ exact (Nat.mod_modEq a p).pow 2
+
/-- Square-then-multiply form of `mod_sq_mod`. -/
-theorem mod_sq_mod_mul (a b p : ℕ) : (... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_2 | 7d7537f2b6be31ac | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "sq_mod_eq_mod_sq",
"depth": 1,
"n_commands": 0,
"n_lines": 2,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": "\n mod_sq_mod_eq a p",
"n_chars": 20,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
... | [
{
"name": "mod_sq_mod_eq",
"text": "/-- Equality form of `mod_sq_mod`. -/\ntheorem mod_sq_mod_eq (a p : ℕ) : ((a % p) ^ 2) % p = (a ^ 2) % p := by\n exact (Nat.mod_modEq a p).pow 2\n\n",
"fan_in": 1,
"n_lines": 5,
"n_chars": 147,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": 1,
... | [
{
"name": "sq_mod_eq_mod_sq",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 5,
"n_chars": 129,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": false,
"max_nestin... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -139,8 +139,13 @@
open Edwards ZMod
+/-- Equality form of `mod_sq_mod`. -/
+theorem mod_sq_mod_eq (a p : ℕ) : ((a % p) ^ 2) % p = (a ^ 2) % p := by
+ exact (Nat.mod_modEq a p).pow 2
+
/-- Alias for `mod_sq_mod_eq`. -/
-theorem sq_mod_eq_mod_sq (a p : ℕ) : ((a % p) ^ 2) % p = (a ^ 2) % p := sorry
+theorem sq_m... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_3 | 74eb83317a61448b | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 3 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "sqrt_m1_sq",
"depth": 1,
"n_commands": 0,
"n_lines": 8,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold sqrt_m1\n have h : (((19681161376707505956807079304988542015446066515923890162744021073123829784752\n ^ 2 : ℕ)) :... | [
{
"name": "p_sub_one_cast",
"text": "lemma p_sub_one_cast : (↑(p - 1) : ZMod p) = -1 := by\n rw [Nat.cast_sub (by decide : 1 ≤ p), ZMod.natCast_self, zero_sub, Nat.cast_one]\n\n",
"fan_in": 1,
"n_lines": 4,
"n_chars": 142,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic": 1,
"n_au... | [
{
"name": "sqrt_m1_sq",
"fan_in": 1,
"n_deps_direct": 2,
"n_deps_transitive": 2,
"n_lines": 11,
"n_chars": 431,
"n_subproofs": 1,
"n_tactics": 8,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 2,
"n_structural": 1,
"automation_only": false,
"max_nesting": 8... | 2 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -144,6 +144,9 @@
def sqrt_m1 : ZMod p :=
19681161376707505956807079304988542015446066515923890162744021073123829784752
+lemma p_sub_one_cast : (↑(p - 1) : ZMod p) = -1 := by
+ rw [Nat.cast_sub (by decide : 1 ≤ p), ZMod.natCast_self, zero_sub, Nat.cast_one]
+
lemma ringChar_ne_two : ringChar (ZMod p) ≠ 2 := b... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_4 | 36b60565e6786c1c | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 4 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "sqrt_m1_sq",
"depth": 1,
"n_commands": 0,
"n_lines": 8,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold sqrt_m1\n have h : (((19681161376707505956807079304988542015446066515923890162744021073123829784752\n ^ 2 : ℕ)) :... | [
{
"name": "sqrt_m1_sq_nat",
"text": "private lemma sqrt_m1_sq_nat :\n 19681161376707505956807079304988542015446066515923890162744021073123829784752 ^ 2 % p =\n p - 1 := by\n decide\n\n",
"fan_in": 1,
"n_lines": 6,
"n_chars": 149,
"n_subproofs": 0,
"n_tactics": 2,
"cyclomatic":... | [
{
"name": "sqrt_m1_not_square",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 3,
"n_lines": 41,
"n_chars": 1563,
"n_subproofs": 12,
"n_tactics": 33,
"cyclomatic": 2,
"n_automation": 12,
"n_rewrites": 10,
"n_structural": 9,
"automation_only": false,
"ma... | 3 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -166,12 +166,18 @@
mul_pow, half_pow_neg ha0 ha, half_pow_neg hb0 hb]
norm_num
+private lemma sqrt_m1_sq_nat :
+ 19681161376707505956807079304988542015446066515923890162744021073123829784752 ^ 2 % p =
+ p - 1 := by
+ decide
+
/-- `sqrt_m1` really is a square root of `-1` in `ZMod p`. -/
lemma sq... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_5 | f3bf31385fdbe9f0 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 5 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "sqrt_ad_minus_one_ne_zero",
"depth": 1,
"n_commands": 0,
"n_lines": 7,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n intro h\n have h_sq : sqrt_ad_minus_one^2 = 0 := by rw [h]; ring\n rw [sqrt_ad_minus_one_sq] at h_sq\n dsimp o... | [
{
"name": "sqrt_ad_minus_one_sq",
"text": "/-- Key Property: `sqrt_ad_minus_one` is actually the square root of `-d - 1`. -/\nlemma sqrt_ad_minus_one_sq : sqrt_ad_minus_one^2 = -d - 1 := by decide\n\n",
"fan_in": 1,
"n_lines": 4,
"n_chars": 154,
"n_subproofs": 0,
"n_tactics": 1,
"cyc... | [
{
"name": "sqrt_ad_minus_one_ne_zero",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 10,
"n_chars": 269,
"n_subproofs": 1,
"n_tactics": 8,
"cyclomatic": 1,
"n_automation": 2,
"n_rewrites": 2,
"n_structural": 1,
"automation_only": false,
"... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -230,10 +230,19 @@
Since a = -1, this is sqrt(-d - 1). -/
def sqrt_ad_minus_one : ZMod p := sqrt_ad_minus_one_val
+/-- Key Property: `sqrt_ad_minus_one` is actually the square root of `-d - 1`. -/
+lemma sqrt_ad_minus_one_sq : sqrt_ad_minus_one^2 = -d - 1 := by decide
+
attribute [irreducible] sqrt_ad_minus_one... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_6 | 5bc4f7fedf4fce0d | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 6 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "abs_edwards_val_even'",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h := is_negative_abs_edwards x\n unfold is_negative at h\n rw [beq_eq_false_iff_ne] at h\n omega",
"n_cha... | [
{
"name": "is_negative_abs_edwards",
"text": "/-- `abs_edwards` always produces a non-negative (even parity) value. -/\nlemma is_negative_abs_edwards (x : ZMod p) : is_negative (abs_edwards x) = false := by\n unfold abs_edwards\n split_ifs with h\n · -- x is negative (odd parity): result is -x\n unfol... | [
{
"name": "abs_edwards_val_even'",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 8,
"n_chars": 253,
"n_subproofs": 1,
"n_tactics": 5,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 2,
"n_structural": 0,
"automation_only": false,
"max_n... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -246,8 +246,32 @@
def abs_edwards (x : ZMod p) : ZMod p :=
if is_negative x then -x else x
+/-- `abs_edwards` always produces a non-negative (even parity) value. -/
+lemma is_negative_abs_edwards (x : ZMod p) : is_negative (abs_edwards x) = false := by
+ unfold abs_edwards
+ split_ifs with h
+ · -- x is neg... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_7 | bff617d867599dc8 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 7 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "abs_edwards_val_even'",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h := is_negative_abs_edwards x\n unfold is_negative at h\n rw [beq_eq_false_iff_ne] at h\n omega",
"n_cha... | [
{
"name": "is_negative_abs_edwards",
"text": "/-- `abs_edwards` always produces a non-negative (even parity) value. -/\nlemma is_negative_abs_edwards (x : ZMod p) : is_negative (abs_edwards x) = false := by\n unfold abs_edwards\n split_ifs with h\n · -- x is negative (odd parity): result is -x\n unfol... | [
{
"name": "abs_edwards_val_even",
"fan_in": 2,
"n_deps_direct": 1,
"n_deps_transitive": 2,
"n_lines": 6,
"n_chars": 189,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": false,
"max_ne... | 2 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -246,8 +246,32 @@
def abs_edwards (x : ZMod p) : ZMod p :=
if is_negative x then -x else x
+/-- `abs_edwards` always produces a non-negative (even parity) value. -/
+lemma is_negative_abs_edwards (x : ZMod p) : is_negative (abs_edwards x) = false := by
+ unfold abs_edwards
+ split_ifs with h
+ · -- x is neg... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_8 | d81f95d503eb9ce7 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 8 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 3 | [
{
"theorem_name": "eq_abs_edwards_of_sq_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 14,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h_sq' : a ^ 2 = (abs_edwards b) ^ 2 := by rw [h_sq, abs_edwards_sq]\n have hab : (abs_edwards b).val % 2 = 0... | [
{
"name": "abs_edwards_sq",
"text": "/-- Square property of the absolute value function.\nSince `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/\nlemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by\n unfold abs_edwards\n split_ifs <;> ring\n\n",
"fan_in": 3,
"n_l... | [
{
"name": "eq_abs_edwards_of_sq_eq",
"fan_in": 1,
"n_deps_direct": 2,
"n_deps_transitive": 4,
"n_lines": 20,
"n_chars": 888,
"n_subproofs": 5,
"n_tactics": 15,
"cyclomatic": 2,
"n_automation": 1,
"n_rewrites": 4,
"n_structural": 2,
"automation_only": false,
"m... | 4 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -246,6 +246,12 @@
def abs_edwards (x : ZMod p) : ZMod p :=
if is_negative x then -x else x
+/-- Square property of the absolute value function.
+Since `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/
+lemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by
+ unfold abs_edwards
+... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_9 | fcc29350e62f87a9 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 9 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 3 | [
{
"theorem_name": "eq_abs_edwards_of_sq_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 14,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h_sq' : a ^ 2 = (abs_edwards b) ^ 2 := by rw [h_sq, abs_edwards_sq]\n have hab : (abs_edwards b).val % 2 = 0... | [
{
"name": "abs_edwards_sq",
"text": "/-- Square property of the absolute value function.\nSince `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/\nlemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by\n unfold abs_edwards\n split_ifs <;> ring\n\n",
"fan_in": 3,
"n_l... | [
{
"name": "abs_edwards_eq_of_sq_eq_sq",
"fan_in": 0,
"n_deps_direct": 3,
"n_deps_transitive": 5,
"n_lines": 6,
"n_chars": 315,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 1,
"n_structural": 0,
"automation_only": false,
"... | 5 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -246,6 +246,12 @@
def abs_edwards (x : ZMod p) : ZMod p :=
if is_negative x then -x else x
+/-- Square property of the absolute value function.
+Since `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/
+lemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by
+ unfold abs_edwards
+... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_10 | 8f089a286a8072d0 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 10 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "abs_edwards_eq_of_sq_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rcases sq_eq_sq_iff_eq_or_eq_neg.mp h with h_eq | h_neg\n · rw [h_eq]\n · rw [h_neg, abs_edwards_neg]",
"n_ch... | [
{
"name": "abs_edwards_neg",
"text": "/-- `abs_edwards` is invariant under negation: `abs_edwards (-x) = abs_edwards x`. -/\nlemma abs_edwards_neg (x : ZMod p) : abs_edwards (-x) = abs_edwards x := by\n by_cases hx : x = 0\n · simp [hx]\n · unfold abs_edwards is_negative\n have h_neg_val : (-x : ZMod ... | [
{
"name": "abs_edwards_eq_of_sq_eq",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 8,
"n_chars": 274,
"n_subproofs": 0,
"n_tactics": 4,
"cyclomatic": 2,
"n_automation": 0,
"n_rewrites": 2,
"n_structural": 1,
"automation_only": false,
"max... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -246,12 +246,32 @@
def abs_edwards (x : ZMod p) : ZMod p :=
if is_negative x then -x else x
+/-- `abs_edwards` is invariant under negation: `abs_edwards (-x) = abs_edwards x`. -/
+lemma abs_edwards_neg (x : ZMod p) : abs_edwards (-x) = abs_edwards x := by
+ by_cases hx : x = 0
+ · simp [hx]
+ · unfold abs_e... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_11 | 963399a53ad38575 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 11 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 3 | [
{
"theorem_name": "eq_abs_edwards_of_sq_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 14,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h_sq' : a ^ 2 = (abs_edwards b) ^ 2 := by rw [h_sq, abs_edwards_sq]\n have hab : (abs_edwards b).val % 2 = 0... | [
{
"name": "abs_edwards_sq",
"text": "/-- Square property of the absolute value function.\nSince `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/\nlemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by\n unfold abs_edwards\n split_ifs <;> ring\n\n",
"fan_in": 3,
"n_l... | [
{
"name": "sqrt_checked_spec",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 15,
"n_chars": 633,
"n_subproofs": 2,
"n_tactics": 12,
"cyclomatic": 1,
"n_automation": 2,
"n_rewrites": 3,
"n_structural": 5,
"automation_only": false,
"max_nes... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -246,6 +246,12 @@
def abs_edwards (x : ZMod p) : ZMod p :=
if is_negative x then -x else x
+/-- Square property of the absolute value function.
+Since `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/
+lemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by
+ unfold abs_edwards
+... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_12 | 39c14eb5ef375646 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 12 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 3 | [
{
"theorem_name": "eq_abs_edwards_of_sq_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 14,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h_sq' : a ^ 2 = (abs_edwards b) ^ 2 := by rw [h_sq, abs_edwards_sq]\n have hab : (abs_edwards b).val % 2 = 0... | [
{
"name": "abs_edwards_sq",
"text": "/-- Square property of the absolute value function.\nSince `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/\nlemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by\n unfold abs_edwards\n split_ifs <;> ring\n\n",
"fan_in": 3,
"n_l... | [
{
"name": "inv_sqrt_checked_spec'",
"fan_in": 2,
"n_deps_direct": 3,
"n_deps_transitive": 4,
"n_lines": 8,
"n_chars": 397,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_... | 4 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -246,6 +246,12 @@
def abs_edwards (x : ZMod p) : ZMod p :=
if is_negative x then -x else x
+/-- Square property of the absolute value function.
+Since `abs_edwards x` is either `x` or `-x`, its square is always `x^2`. -/
+lemma abs_edwards_sq (x : ZMod p) : (abs_edwards x)^2 = x^2 := by
+ unfold abs_edwards
+... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_13 | 27d346d3e5b052fc | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 13 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "inv_sqrt_checked_spec'",
"depth": 1,
"n_commands": 0,
"n_lines": 3,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [inv_sqrt_checked_unfold arg hne] at h\n exact inv_sqrt_spec_abstract sqrt_checked (fun x h hb => sqrt_checked_s... | [
{
"name": "sqrt_checked_spec",
"text": "/-- Spec: If `sqrt_checked` returns true, the result is a valid square root. -/\ntheorem sqrt_checked_spec (u : ZMod p) {r : ZMod p} {b : Bool} :\n sqrt_checked u = (r, b) → b = true → r^2 = u := by\n intro h_call h_true\n unfold sqrt_checked at h_call\n split_ifs... | [
{
"name": "inv_sqrt_checked_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 5,
"n_lines": 7,
"n_chars": 338,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_n... | 5 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -265,6 +265,20 @@
let y := Classical.choose h_ix
(abs_edwards y, false)
+/-- Spec: If `sqrt_checked` returns true, the result is a valid square root. -/
+theorem sqrt_checked_spec (u : ZMod p) {r : ZMod p} {b : Bool} :
+ sqrt_checked u = (r, b) → b = true → r^2 = u := by
+ intro h_call h_true
+ unfold... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_14 | d6bb54bd4bf5e7c3 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 14 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 2 | [
{
"theorem_name": "inv_sqrt_checked_spec'",
"depth": 1,
"n_commands": 0,
"n_lines": 3,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [inv_sqrt_checked_unfold arg hne] at h\n exact inv_sqrt_spec_abstract sqrt_checked (fun x h hb => sqrt_checked_s... | [
{
"name": "inv_sqrt_checked_unfold",
"text": "/-- For `u ≠ 0`, `inv_sqrt_checked u` equals `(sqrt_checked u)` with first component inverted. -/\nprivate lemma inv_sqrt_checked_unfold (u : ZMod p) (hu : u ≠ 0) :\n inv_sqrt_checked u = (sqrt_checked u).map (·⁻¹) id := by\n delta inv_sqrt_checked; rw [if_n... | [
{
"name": "inv_sqrt_checked_snd",
"fan_in": 1,
"n_deps_direct": 2,
"n_deps_transitive": 2,
"n_lines": 6,
"n_chars": 260,
"n_subproofs": 0,
"n_tactics": 1,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": false,
"max_ne... | 2 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -267,6 +267,11 @@
else (sqrt_checked u).map (·⁻¹) id -- return `sqrt_checked u` but invert the first component.
-- The alternative using `let` here causes a nightmare later when working with the definition.
+/-- For `u ≠ 0`, `inv_sqrt_checked u` equals `(sqrt_checked u)` with first component inverted. -/
+pr... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2ac0febe8cd2_15 | 47b24e73ee649d41 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Basic.lean | Basic | 15 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "inv_sqrt_checked_sq_mul",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have h_ws : (inv_sqrt_checked u).2 = true := by\n rw [inv_sqrt_checked_snd u hne]\n exact (sqrt_checked_iff_i... | [
{
"name": "sqrt_checked_iff_isSquare",
"text": "/-- Spec: `sqrt_checked` returns true iff the input is a square. -/\ntheorem sqrt_checked_iff_isSquare (u : ZMod p) {r : ZMod p} {b : Bool} :\n sqrt_checked u = (r, b) → (b = true ↔ IsSquare u) := by\n intro h_call\n unfold sqrt_checked at h_call\n split_i... | [
{
"name": "inv_sqrt_checked_sq_mul",
"fan_in": 0,
"n_deps_direct": 3,
"n_deps_transitive": 8,
"n_lines": 10,
"n_chars": 427,
"n_subproofs": 1,
"n_tactics": 5,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 2,
"automation_only": false,
"ma... | 8 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley
-/
import Aeneas
import Curve25519Dalek.Types
import Mathlib.Algebra.Field.ZMod
import Mathlib.NumberTheory.LegendreSymbol.Basic
import ... | @@ -279,6 +279,17 @@
obtain ⟨-, hb⟩ := Prod.mk.inj h_call
exact absurd h_true (by rw [← hb]; decide)
+/-- Spec: `sqrt_checked` returns true iff the input is a square. -/
+theorem sqrt_checked_iff_isSquare (u : ZMod p) {r : ZMod p} {b : Bool} :
+ sqrt_checked u = (r, b) → (b = true ↔ IsSquare u) := by
+ in... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_3b57fc9ec2ac_0 | 972d97c9f9c44913 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Montgomery/ProjectivePoint/DifferentialAddAndDouble.lean | DifferentialAddAndDouble | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "differential_add_and_double_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 339,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold differential_add_and_double\n obtain ⟨P_affine, Q_affine, hnon_p, hnon_q, hp_neq_q, hp_a, hq_a,\... | [
{
"name": "not_eq_T_point",
"text": "lemma not_eq_T_point (P : ProjectivePoint)\n (P_affine : FieldElement51)\n (hP_valid : P.IsValid)\n (P_a : P_affine.toField = P.U.toField / P.W.toField)\n (non_eq_T : P_affine.toField ≠ 0) :\n P.U.toField ≠ 0 := by\n intro h\n apply non_eq_T\n rw [P_a]\... | [
{
"name": "differential_add_and_double_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 362,
"n_chars": 15705,
"n_subproofs": 63,
"n_tactics": 339,
"cyclomatic": 15,
"n_automation": 103,
"n_rewrites": 64,
"n_structural": 49,
"automation_o... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Liao Zhang, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Montgomery.Representation
import Curve25519Dalek.Math... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Liao Zhang, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Montgomery.Representation
import Curve25519Dalek.Math... | @@ -51,6 +51,20 @@
let U := P.U.toField; let W := P.W.toField; let u := U / W
IsSquare (u ^ 3 + Curve25519.A * u ^ 2 + u)
+lemma not_eq_T_point (P : ProjectivePoint)
+ (P_affine : FieldElement51)
+ (hP_valid : P.IsValid)
+ (P_a : P_affine.toField = P.U.toField / P.W.toField)
+ (non_eq_T : P_affi... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_91a892464876_0 | 89a7167d734a5084 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Edwards/EdwardsPoint/ToAffine.lean | ToAffine | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "to_affine_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 60,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n -- Derive < 2^54 bounds from IsValid (which gives < 2^53)\n have hX : ∀ i < 5, self.X[i]!.val < 2 ^ 54 :=\n fun i hi =>... | [
{
"name": "to_affine_spec'",
"text": "/-- **Spec theorem for `curve25519_dalek::edwards::EdwardsPoint::to_affine`**\n• The function always succeeds (no panic) when the input limbs satisfy `< 2 ^ 54`\n• If `Z ≡ 0 (mod p)`: `x ≡ 0 (mod p)` and `y ≡ 0 (mod p)`\n• If `Z ≢ 0 (mod p)`: `x * Z ≡ X (mod p)` and `y ... | [
{
"name": "to_affine_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 71,
"n_chars": 2942,
"n_subproofs": 22,
"n_tactics": 61,
"cyclomatic": 1,
"n_automation": 14,
"n_rewrites": 10,
"n_structural": 12,
"automation_only": false,
"max_n... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dal... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519Dal... | @@ -30,6 +30,59 @@
namespace curve25519_dalek.edwards.EdwardsPoint
/-- **Spec theorem for `curve25519_dalek::edwards::EdwardsPoint::to_affine`**
+• The function always succeeds (no panic) when the input limbs satisfy `< 2 ^ 54`
+• If `Z ≡ 0 (mod p)`: `x ≡ 0 (mod p)` and `y ≡ 0 (mod p)`
+• If `Z ≢ 0 (mod p)`: `x * Z... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_069c0519982e_0 | ae0d165bf3ce0a13 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/IsZero.lean | IsZero | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "is_zero_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 45,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold is_zero\n step as ⟨bytes, h_to_bytes_mod, h_to_bytes_lt⟩\n simp only [lift, bind_tc_ok] at ⊢\n have h_mod : Hold (U... | [
{
"name": "array_eq_of_to_slice_eq",
"text": "/-- Arrays are equal if their slices are equal. -/\nlemma array_eq_of_to_slice_eq {α : Type} {n : Usize} {h1 h2 : Array α n}\n (h : h1.to_slice = h2.to_slice) :\n h1 = h2 := by\n simp only [Array.to_slice] at h\n cases h1; cases h2\n simp only at h\n c... | [
{
"name": "is_zero_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 55,
"n_chars": 2486,
"n_subproofs": 10,
"n_tactics": 45,
"cyclomatic": 3,
"n_automation": 5,
"n_rewrites": 12,
"n_structural": 9,
"automation_only": false,
"max_nesti... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Backend.Serial.U64.... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Backend.Serial.U64.... | @@ -23,6 +23,16 @@
open Aeneas Aeneas.Std Result Aeneas.Std.WP
+/-- Arrays are equal if their slices are equal. -/
+lemma array_eq_of_to_slice_eq {α : Type} {n : Usize} {h1 h2 : Array α n}
+ (h : h1.to_slice = h2.to_slice) :
+ h1 = h2 := by
+ simp only [Array.to_slice] at h
+ cases h1; cases h2
+ simp onl... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_30ee8b92da37_7 | f9e2b0719ee02b38 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Ristretto/RistrettoPoint/ElligatorRistrettoFlavor.lean | ElligatorRistrettoFlavor | 7 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 20 | 1 | [
{
"theorem_name": "elligator_ristretto_flavor_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 396,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold elligator_ristretto_flavor\n let* ⟨ i, i_post1, i_post2, i_post3 ⟩ ← SQRT_M1_spec\n let* ⟨ d, d_... | [
{
"name": "elligator_completed_point_valid",
"text": "/-- Package the full `CompletedPoint.IsValid` proof for the Elligator completed point. -/\nprivate lemma elligator_completed_point_valid\n (s one c r N_s D i s_prime s_prime_neg s_prime1 s1 s_sq c2 N_t cp_X cp_Y cp_Z cp_T fe s_plus_s :\n FieldEle... | [
{
"name": "elligator_ristretto_flavor_spec",
"fan_in": 0,
"n_deps_direct": 8,
"n_deps_transitive": 20,
"n_lines": 401,
"n_chars": 20034,
"n_subproofs": 86,
"n_tactics": 449,
"cyclomatic": 8,
"n_automation": 37,
"n_rewrites": 78,
"n_structural": 34,
"automation_onl... | 20 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.FunsExternal
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519D... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Alessandro D'Angelo
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.FunsExternal
import Curve25519Dalek.Math.Edwards.Representation
import Curve25519D... | @@ -590,6 +590,237 @@
· unfold toField
rw [cond_f51_eq c2_post h_nsq]
+/-- Package the full `CompletedPoint.IsValid` proof for the Elligator completed point. -/
+private lemma elligator_completed_point_valid
+ (s one c r N_s D i s_prime s_prime_neg s_prime1 s1 s_sq c2 N_t cp_X cp_Y cp_Z cp_T fe s_plus_... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2f32d1deccf7_0 | 592b840fedc48a81 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Field/FieldElement51/FromBytes.lean | FromBytes | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 6 | 1 | [
{
"theorem_name": "load8_at_eq_shift",
"depth": 1,
"n_commands": 0,
"n_lines": 32,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n set lower := ∑ k ∈ Finset.range i, bytes[k]!.val * 2 ^ (8 * k) with hlower_def\n set middle := ∑ j ∈ Finset.range 8, by... | [
{
"name": "sum_split_three",
"text": "/-- Sum of `f` over `range 32` decomposes into three blocks around `i..i+8`. -/\nprivate lemma sum_split_three (f : Nat → Nat) (i : Nat) (hi : i + 8 ≤ 32) :\n ∑ k ∈ Finset.range 32, f k =\n (∑ k ∈ Finset.range i, f k)\n + (∑ k ∈ Finset.range 8, f (i + k))\n... | [
{
"name": "load8_at_eq_shift",
"fan_in": 1,
"n_deps_direct": 2,
"n_deps_transitive": 2,
"n_lines": 38,
"n_chars": 2297,
"n_subproofs": 7,
"n_tactics": 35,
"cyclomatic": 1,
"n_automation": 18,
"n_rewrites": 10,
"n_structural": 4,
"automation_only": false,
"max_... | 2 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Aux
import Curve25519Dalek.ExternallyVerified
/-! # Spec theorem for `curve25519_dale... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Aux
import Curve25519Dalek.ExternallyVerified
/-! # Spec theorem for `curve25519_dale... | @@ -115,11 +115,51 @@
rw [Finset.sum_range_succ, show (8 * (n + 1) : Nat) = 8 * n + 8 from by ring, pow_add]
nlinarith
+/-- Sum of `f` over `range 32` decomposes into three blocks around `i..i+8`. -/
+private lemma sum_split_three (f : Nat → Nat) (i : Nat) (hi : i + 8 ≤ 32) :
+ ∑ k ∈ Finset.range 32, f k... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_2f32d1deccf7_1 | 1f836f93ce57fa91 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Field/FieldElement51/FromBytes.lean | FromBytes | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 6 | 1 | [
{
"theorem_name": "from_bytes_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 78,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold from_bytes\n let* ⟨ _, shift_post1, _ ⟩ ← U64.ShiftLeft_IScalar_spec\n let* ⟨ mask, mask_post1, _ ⟩ ← U64.sub_spe... | [
{
"name": "limb_eq_aux",
"text": "/-- The shift+mask formula reducing `(B / 2^k) % 2^64 / 2^s % 2^51` to `B / 2^(k+s) % 2^51`.\nRequires `s + 51 ≤ 64` so the inner mod doesn't lose bits. -/\nprivate lemma limb_eq_aux (B k s : Nat) (hs : s + 51 ≤ 64) :\n (B / 2 ^ k) % 2 ^ 64 / 2 ^ s % 2 ^ 51 = B / 2 ^ (k ... | [
{
"name": "from_bytes_spec",
"fan_in": 0,
"n_deps_direct": 4,
"n_deps_transitive": 6,
"n_lines": 90,
"n_chars": 5008,
"n_subproofs": 15,
"n_tactics": 76,
"cyclomatic": 3,
"n_automation": 29,
"n_rewrites": 10,
"n_structural": 6,
"automation_only": false,
"max_n... | 6 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Aux
import Curve25519Dalek.ExternallyVerified
/-! # Spec theorem for `curve25519_dale... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Aux
import Curve25519Dalek.ExternallyVerified
/-! # Spec theorem for `curve25519_dale... | @@ -161,6 +161,15 @@
Nat.div_eq_of_lt hlow_lt, Nat.zero_add, Nat.add_mul_mod_self_left]
exact (Nat.mod_eq_of_lt hmid_lt).symm
+/-- The shift+mask formula reducing `(B / 2^k) % 2^64 / 2^s % 2^51` to `B / 2^(k+s) % 2^51`.
+Requires `s + 51 ≤ 64` so the inner mod doesn't lose bits. -/
+private lemma limb_eq_aux ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_db011dd5057b_0 | c1116332fd7481b1 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/CompletedPoint/AsProjective.lean | AsProjective | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 4 | 1 | [
{
"theorem_name": "as_projective_isValid_and_toPoint",
"depth": 1,
"n_commands": 0,
"n_lines": 32,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n -- Prove proj.Z.toField ≠ 0\n have hpZ_ne : proj.Z.toField ≠ 0 := by\n rw [hZ_F]\n apply mul_ne_z... | [
{
"name": "as_projective_on_curve",
"text": "/-- Prove the projective on-curve equation from the completed on-curve equation.\n Given that `proj.X = q.X * q.T`, `proj.Y = q.Y * q.Z`, `proj.Z = q.Z * q.T`,\n the projective curve equation `a * X'² * Z'² + Y'² * Z'² = Z'⁴ + d * X'² * Y'²`\n follows fr... | [
{
"name": "as_projective_isValid_and_toPoint",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 47,
"n_chars": 2068,
"n_subproofs": 5,
"n_tactics": 29,
"cyclomatic": 2,
"n_automation": 2,
"n_rewrites": 3,
"n_structural": 4,
"automation_only": fa... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Field.FieldElement51.Mul
im... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Field.FieldElement51.Mul
im... | @@ -108,6 +108,25 @@
push_cast at h
exact h
+/-- Prove the projective on-curve equation from the completed on-curve equation.
+ Given that `proj.X = q.X * q.T`, `proj.Y = q.Y * q.Z`, `proj.Z = q.Z * q.T`,
+ the projective curve equation `a * X'² * Z'² + Y'² * Z'² = Z'⁴ + d * X'² * Y'²`
+ follows fr... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_db011dd5057b_1 | 141c8ea5d11866b6 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/CurveModels/CompletedPoint/AsProjective.lean | AsProjective | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 4 | 1 | [
{
"theorem_name": "as_projective_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 16,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n -- Extract bounds from validity\n have h_qX_bounds : ∀ i < 5, (q.X[i]!).val < 2 ^ 54 := hq_valid.X_valid\n have h_qY_... | [
{
"name": "as_projective_lift_to_field_eqs",
"text": "/-- Lift the three modular arithmetic results from `as_projective_spec_aux` to\n field equalities in `CurveField`. Each modular relation `a % p = b % p`\n is lifted via `lift_mod_eq` and then simplified via `push_cast`. -/\nprivate lemma as_project... | [
{
"name": "as_projective_spec",
"fan_in": 0,
"n_deps_direct": 3,
"n_deps_transitive": 4,
"n_lines": 28,
"n_chars": 1353,
"n_subproofs": 5,
"n_tactics": 12,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 0,
"n_structural": 3,
"automation_only": false,
"max_n... | 4 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Field.FieldElement51.Mul
im... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Field.FieldElement51.Mul
im... | @@ -81,6 +81,33 @@
3. `as_projective_isValid_and_toPoint`: Combined validity and point equality proof
-/
+/-- Lift the three modular arithmetic results from `as_projective_spec_aux` to
+ field equalities in `CurveField`. Each modular relation `a % p = b % p`
+ is lifted via `lift_mod_eq` and then simplified v... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_76e285e50c04_0 | 4d33971fda37f6ba | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Backend/Serial/U64/Scalar/Scalar52/Square.lean | Square | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "square_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 31,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold square\n let* ⟨ a, a_post1, a_post2 ⟩ ← square_internal_spec\n let* ⟨ aa, aa_post1, aa_post2, aa_post3 ⟩ ← montgomery... | [
{
"name": "cancelR",
"text": "private theorem cancelR {a b : ℕ} (h : a * R ≡ b * R [MOD L]) : a ≡ b [MOD L] := by\n have hcoprime : Nat.Coprime R L := by\n unfold R L Nat.Coprime\n simp\n have h1 := Nat.Coprime.symm hcoprime\n exact Nat.ModEq.cancel_right_of_coprime h1 h\n\n/- End of helper lemmas/... | [
{
"name": "square_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 47,
"n_chars": 2561,
"n_subproofs": 6,
"n_tactics": 35,
"cyclomatic": 1,
"n_automation": 6,
"n_rewrites": 10,
"n_structural": 5,
"automation_only": false,
"max_nesting... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Scalar.Scalar52.SquareInternal
import Curve25... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Backend.Serial.U64.Scalar.Scalar52.SquareInternal
import Curve25... | @@ -25,6 +25,15 @@
/- Helper lemmas/theorems -/
-- Helper theorem to cancel R [mod L] on right (same as in Mul.lean)
+private theorem cancelR {a b : ℕ} (h : a * R ≡ b * R [MOD L]) : a ≡ b [MOD L] := by
+ have hcoprime : Nat.Coprime R L := by
+ unfold R L Nat.Coprime
+ simp
+ have h1 := Nat.Coprime.symm hcop... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_89729956145e_0 | 2dede624f28da00f | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Ristretto/CompressedRistretto/Decompress.lean | Decompress | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "decompress_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 128,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold decompress\n step as ⟨s_canon, s_neg, s, h1⟩\n obtain ⟨h_tight, h_valid, h_field, h_enc, h_neg_iff, h_bridge⟩ :=... | [
{
"name": "decompress_step1_val_eq",
"text": "/-- When `decompress_step1` returns `some val`, `val` equals the field element `s.toField`\n computed by step_1. This follows from the uniqueness of the output value. -/\nprivate lemma decompress_step1_val_eq (c : CompressedRistretto)\n (s : backend.serial... | [
{
"name": "decompress_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 144,
"n_chars": 6993,
"n_subproofs": 16,
"n_tactics": 123,
"cyclomatic": 8,
"n_automation": 31,
"n_rewrites": 11,
"n_structural": 34,
"automation_only": false,
"ma... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Ristretto.Representation
import Curve25519Dalek.Specs.Ristretto.... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Ristretto.Representation
import Curve25519Dalek.Specs.Ristretto.... | @@ -24,6 +24,21 @@
open Edwards curve25519_dalek.ristretto
namespace curve25519_dalek.ristretto.CompressedRistretto
+/-- When `decompress_step1` returns `some val`, `val` equals the field element `s.toField`
+ computed by step_1. This follows from the uniqueness of the output value. -/
+private lemma decompress_... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_510e43d03e5f_0 | 928966324d1a320a | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Field/FieldElement51/PowP58.lean | PowP58 | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 1 | 1 | [
{
"theorem_name": "pow_p58_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 11,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold pow_p58\n -- aeneas#963 drift: `as`-pattern now binds the (t19, t3) pair flat instead of wrapped,\n -- so the previo... | [
{
"name": "pow_p58_exp_def",
"text": "/-- Unfolding lemma for `pow_p58_exp`, exposing its underlying value `2^252 - 3`.\nNeeded because `pow_p58_exp` is marked irreducible below, which blocks definitional\nunfolding in tactics such as `rw`. -/\ntheorem pow_p58_exp_def : pow_p58_exp = 2 ^ 252 - 3 := rfl\n\n"... | [
{
"name": "pow_p58_spec",
"fan_in": 0,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 22,
"n_chars": 1171,
"n_subproofs": 2,
"n_tactics": 9,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 3,
"n_structural": 1,
"automation_only": false,
"max_nesting"... | 1 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Field.FieldElement51.Pow22501
import Curve2551... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Dablander, Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Specs.Field.FieldElement51.Pow22501
import Curve2551... | @@ -27,6 +27,11 @@
/-- The exponent `(p-5)/8 = 2^252 - 3`, used in the pow_p58 computation. -/
def pow_p58_exp : Nat := 2 ^ 252 - 3
+/-- Unfolding lemma for `pow_p58_exp`, exposing its underlying value `2^252 - 3`.
+Needed because `pow_p58_exp` is marked irreducible below, which blocks definitional
+unfolding in ta... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_0 | 151d6c242d158ba0 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "a_plus_d",
"depth": 1,
"n_commands": 0,
"n_lines": 6,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have ha : Edwards.Ed25519.a = -1 := by rfl\n rw [ha, d_eq]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\... | [
{
"name": "d_eq",
"text": "lemma d_eq : (Edwards.Ed25519.d : CurveField) = -121665 / 121666 := by\n have hd : Edwards.Ed25519.d = d := by decide\n rw [hd]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 2,
"n_lines": 8,
"n_chars": 208,
"n_sub... | [
{
"name": "a_plus_d",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 8,
"n_chars": 235,
"n_subproofs": 2,
"n_tactics": 6,
"cyclomatic": 1,
"n_automation": 4,
"n_rewrites": 1,
"n_structural": 0,
"automation_only": false,
"max_nesting": 2
... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -199,10 +199,27 @@
open curve25519_dalek.montgomery
open curve25519_dalek.edwards
-lemma a_plus_d : (Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d = - 243331/121666 := sorry
+lemma d_eq : (Edwards.Ed25519.d : CurveField) = -121665 / 121666 := by
+ have hd : Edwards.Ed25519.d = d := by decide
+ rw [hd]
+ ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_1 | abc50365c9fa2444 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 1 | [
{
"theorem_name": "adA",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide",
"n_chars": 107,
"n_sub... | [
{
"name": "a_plus_d",
"text": "lemma a_plus_d : (Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d = - 243331/121666 := by\n have ha : Edwards.Ed25519.a = -1 := by rfl\n rw [ha, d_eq]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 1,
"n_lines": 8,... | [
{
"name": "adA",
"fan_in": 3,
"n_deps_direct": 2,
"n_deps_transitive": 3,
"n_lines": 8,
"n_chars": 243,
"n_subproofs": 1,
"n_tactics": 5,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 1,
"n_structural": 0,
"automation_only": false,
"max_nesting": 2
}
] | 3 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -206,6 +206,13 @@
field_simp [this]
decide
+lemma a_plus_d : (Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d = - 243331/121666 := by
+ have ha : Edwards.Ed25519.a = -1 := by rfl
+ rw [ha, d_eq]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma a_sub_d : (Edwards.... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_2 | 30d04fe48c010012 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 2 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "adA",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide",
"n_chars": 107,
"n_sub... | [
{
"name": "a_sub_d",
"text": "lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by\n have ha : Edwards.Ed25519.a = -1 := by rfl\n rw [ha, d_eq]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 2,
"n_lines": 8,
"n... | [
{
"name": "adB",
"fan_in": 10,
"n_deps_direct": 1,
"n_deps_transitive": 2,
"n_lines": 7,
"n_chars": 185,
"n_subproofs": 1,
"n_tactics": 5,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 1,
"n_structural": 0,
"automation_only": false,
"max_nesting": 2
}
] | 2 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -213,10 +213,25 @@
field_simp [this]
decide
+lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by
+ have ha : Edwards.Ed25519.a = -1 := by rfl
+ rw [ha, d_eq]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma adA : 2 * ((Edwards.Ed25... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_3 | 2b3f422e38c4b966 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 3 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "adA",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide",
"n_chars": 107,
"n_sub... | [
{
"name": "a_sub_d",
"text": "lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by\n have ha : Edwards.Ed25519.a = -1 := by rfl\n rw [ha, d_eq]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 2,
"n_lines": 8,
"n... | [
{
"name": "inver_Ad",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 4,
"n_lines": 8,
"n_chars": 197,
"n_subproofs": 1,
"n_tactics": 6,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 1,
"n_structural": 0,
"automation_only": false,
"max_nesting": 4
... | 4 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -213,10 +213,25 @@
field_simp [this]
decide
+lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by
+ have ha : Edwards.Ed25519.a = -1 := by rfl
+ rw [ha, d_eq]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma adA : 2 * ((Edwards.Ed25... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_4 | 7f450af28007a5ab | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 4 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 3 | [
{
"theorem_name": "inver_Ad",
"depth": 1,
"n_commands": 0,
"n_lines": 6,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [← adA]\n have : (Edwards.Ed25519.a - Edwards.Ed25519.d) ≠ 0 := by\n decide\n field_simp\n decide",
"n_chars": 112,
... | [
{
"name": "adA",
"text": "lemma adA : 2 * ((Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d) /\n (Edwards.Ed25519.a - Edwards.Ed25519.d) = Curve25519.A := by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 3,
"n_lines":... | [
{
"name": "roots_B_d",
"fan_in": 3,
"n_deps_direct": 4,
"n_deps_transitive": 9,
"n_lines": 7,
"n_chars": 279,
"n_subproofs": 0,
"n_tactics": 4,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 0,
"n_structural": 0,
"automation_only": true,
"max_nesting": 2
... | 5 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -220,6 +220,13 @@
field_simp [this]
decide
+lemma adA : 2 * ((Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d) /
+ (Edwards.Ed25519.a - Edwards.Ed25519.d) = Curve25519.A := by
+ rw [a_plus_d, a_sub_d]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma adB : (4 / ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_5 | fa5a473b77c4f0a6 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 5 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 1 | [
{
"theorem_name": "on_curves_M",
"depth": 1,
"n_commands": 0,
"n_lines": 33,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have eq := e.on_curve\n have huy := montgomery_edwards_inverse hy\n set u := (1 + e.y) / (1 - e.y) with hu\n set v := (1 + ... | [
{
"name": "montgomery_edwards_inverse",
"text": "lemma montgomery_edwards_inverse {y : CurveField} (hy1 : y ≠ 1) :\n let u := (1 + y) / (1 - y)\n y = (u - 1) / (u + 1) := by\n intro u\n have num_eq : u - 1 = (1 + y - (1 - y)) / (1 - y) := by\n field_simp [hy1]\n agrind\n have num_simplified :... | [
{
"name": "on_curves_M",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 43,
"n_chars": 1792,
"n_subproofs": 15,
"n_tactics": 45,
"cyclomatic": 1,
"n_automation": 20,
"n_rewrites": 7,
"n_structural": 6,
"automation_only": false,
"max_nestin... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -264,6 +264,37 @@
revert this
decide
+lemma montgomery_edwards_inverse {y : CurveField} (hy1 : y ≠ 1) :
+ let u := (1 + y) / (1 - y)
+ y = (u - 1) / (u + 1) := by
+ intro u
+ have num_eq : u - 1 = (1 + y - (1 - y)) / (1 - y) := by
+ field_simp [hy1]
+ agrind
+ have num_simplified : u - 1 = (2 ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_6 | fa48be0a1c5d2fca | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 6 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 3 | [
{
"theorem_name": "inver_Ad",
"depth": 1,
"n_commands": 0,
"n_lines": 6,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [← adA]\n have : (Edwards.Ed25519.a - Edwards.Ed25519.d) ≠ 0 := by\n decide\n field_simp\n decide",
"n_chars": 112,
... | [
{
"name": "adA",
"text": "lemma adA : 2 * ((Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d) /\n (Edwards.Ed25519.a - Edwards.Ed25519.d) = Curve25519.A := by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 3,
"n_lines":... | [
{
"name": "on_MontgomeryCurves",
"fan_in": 5,
"n_deps_direct": 3,
"n_deps_transitive": 9,
"n_lines": 12,
"n_chars": 360,
"n_subproofs": 1,
"n_tactics": 5,
"cyclomatic": 1,
"n_automation": 2,
"n_rewrites": 1,
"n_structural": 0,
"automation_only": false,
"max_ne... | 6 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -220,6 +220,13 @@
field_simp [this]
decide
+lemma adA : 2 * ((Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d) /
+ (Edwards.Ed25519.a - Edwards.Ed25519.d) = Curve25519.A := by
+ rw [a_plus_d, a_sub_d]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma adB : (4 / ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_7 | d57d170262ba47b8 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 7 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "id_4",
"depth": 1,
"n_commands": 0,
"n_lines": 8,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n intro h\n apply non_eq₀\n have : u * Curve25519.A * 2 * (1 + u ^ 2) + 1 + u ^ 2 * 6 + u ^ 4\n = Curve25519.A * u * 2 + Curve255... | [
{
"name": "id_2",
"text": "lemma id_2 {u v : CurveField}\n (equation : v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u) :\n (-(Curve25519.A + 2) * u ^ 2 * (u + 1) ^ 2 * -1 + v ^ 2 * (u - 1) ^ 2) =\n u * (Curve25519.A * u * 2 + Curve25519.A * u ^ 3 * 2 + 1 + u ^ 2 * 6 + u ^ 4) := by\n linear_combination (... | [
{
"name": "id_4",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 13,
"n_chars": 505,
"n_subproofs": 2,
"n_tactics": 8,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 0,
"n_structural": 2,
"automation_only": false,
"max_nesting": 6
}
] | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -357,10 +357,23 @@
have := on_MontgomeryCurves e hy hx
simp_all only [ne_eq, zero_mul, add_zero, one_mul]
+lemma id_2 {u v : CurveField}
+ (equation : v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u) :
+ (-(Curve25519.A + 2) * u ^ 2 * (u + 1) ^ 2 * -1 + v ^ 2 * (u - 1) ^ 2) =
+ u * (Curve25519.A * u * 2 + ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_8 | e766c1154074abe6 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 8 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 6 | [
{
"theorem_name": "zero_iff",
"depth": 1,
"n_commands": 0,
"n_lines": 6,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n constructor\n · intro he\n rw [he]\n rfl\n · apply zeroY",
"n_chars": 68,
"n_subproofs": 0,
"n_tactics": 6,
... | [
{
"name": "zeroY",
"text": "theorem zeroY (e : Edwards.Point Edwards.Ed25519)\n (h : e.y = 1) :\n e = 0 := by\n cases e with\n | mk x y h_curve =>\n subst h\n simp only [one_pow, mul_one] at h_curve\n have hx2 : x ^ 2 = 0 :=\n (mul_eq_zero.mp (show (Edwards.Ed25519.a - Edwards.Ed25519.... | [
{
"name": "zero_iff",
"fan_in": 2,
"n_deps_direct": 1,
"n_deps_transitive": 1,
"n_lines": 8,
"n_chars": 145,
"n_subproofs": 0,
"n_tactics": 6,
"cyclomatic": 2,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 3,
"automation_only": false,
"max_nesting": 4
... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -369,12 +369,26 @@
let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
.some (x := u) (y := v) (h := nonsingular_on_curves_M e hy hx)
+theorem zeroY (e : Edwards.Point Edwards.Ed25519)
+ (h : e.y = 1) :
+ e = 0 := by
+ cases e with
+ | mk x y h_curve =>
+ subst h
+ simp only... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_9 | ba616603c4ec3aec | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 9 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 6 | [
{
"theorem_name": "neg_fromEdwards",
"depth": 1,
"n_commands": 0,
"n_lines": 36,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h : e = 0\n · simp [h, map_zero]\n · unfold fromEdwards\n rw [zero_iff] at h\n simp only [Edwards.neg_y, ... | [
{
"name": "map_zero",
"text": "theorem map_zero : fromEdwards 0 = 0 := by\n unfold fromEdwards\n simp only [Edwards.zero_y, ↓reduceDIte]\n\n",
"fan_in": 6,
"n_lines": 5,
"n_chars": 109,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
... | [
{
"name": "neg_fromEdwards",
"fan_in": 2,
"n_deps_direct": 3,
"n_deps_transitive": 14,
"n_lines": 39,
"n_chars": 1939,
"n_subproofs": 3,
"n_tactics": 36,
"cyclomatic": 1,
"n_automation": 10,
"n_rewrites": 12,
"n_structural": 1,
"automation_only": false,
"max_n... | 10 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -369,6 +369,10 @@
let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
.some (x := u) (y := v) (h := nonsingular_on_curves_M e hy hx)
+theorem map_zero : fromEdwards 0 = 0 := by
+ unfold fromEdwards
+ simp only [Edwards.zero_y, ↓reduceDIte]
+
theorem zeroY (e : Edwards.Point Edwards.Ed2... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_10 | eb220abef3d8678f | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 10 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 3 | [
{
"theorem_name": "inver_Ad",
"depth": 1,
"n_commands": 0,
"n_lines": 6,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [← adA]\n have : (Edwards.Ed25519.a - Edwards.Ed25519.d) ≠ 0 := by\n decide\n field_simp\n decide",
"n_chars": 112,
... | [
{
"name": "adA",
"text": "lemma adA : 2 * ((Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d) /\n (Edwards.Ed25519.a - Edwards.Ed25519.d) = Curve25519.A := by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 3,
"n_lines":... | [
{
"name": "edwards_one_sub_y_sq_mul_x_sq_eq",
"fan_in": 2,
"n_deps_direct": 2,
"n_deps_transitive": 6,
"n_lines": 11,
"n_chars": 438,
"n_subproofs": 2,
"n_tactics": 6,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 2,
"n_structural": 0,
"automation_only": false... | 6 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -220,6 +220,13 @@
field_simp [this]
decide
+lemma adA : 2 * ((Edwards.Ed25519.a : CurveField) + Edwards.Ed25519.d) /
+ (Edwards.Ed25519.a - Edwards.Ed25519.d) = Curve25519.A := by
+ rw [a_plus_d, a_sub_d]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma adB : (4 / ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_11 | 4dadb5f4372c307b | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 11 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 4 | [
{
"theorem_name": "roots_B_d",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n simp only [pow2_roots_B, adB, neg_mul]\n simp only [A_add_2, inver_Ad_eq, neg_sub]\n decide",
"n_chars": 97,
"n_subproo... | [
{
"name": "A_add_2",
"text": "lemma A_add_2 : 486664 = Curve25519.A + 2 := by\n unfold Curve25519.A\n decide\n\n",
"fan_in": 4,
"n_lines": 5,
"n_chars": 80,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 0,
"au... | [
{
"name": "x_sq_mul_linear_factor_eq",
"fan_in": 1,
"n_deps_direct": 3,
"n_deps_transitive": 10,
"n_lines": 12,
"n_chars": 518,
"n_subproofs": 1,
"n_tactics": 6,
"cyclomatic": 1,
"n_automation": 2,
"n_rewrites": 2,
"n_structural": 0,
"automation_only": false,
... | 7 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -233,6 +233,10 @@
field_simp [this]
decide
+lemma A_add_2 : 486664 = Curve25519.A + 2 := by
+ unfold Curve25519.A
+ decide
+
lemma B_d_relation : IsSquare (4 / ((Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d)) := by
rw [adB]
apply ((@legendreSym.eq_one_iff p _ (-486664)) (by decide)).mp
@@ -42... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_12 | 0abe158165c3bc32 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 12 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 4 | [
{
"theorem_name": "roots_B_d",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n simp only [pow2_roots_B, adB, neg_mul]\n simp only [A_add_2, inver_Ad_eq, neg_sub]\n decide",
"n_chars": 97,
"n_subproo... | [
{
"name": "A_add_2",
"text": "lemma A_add_2 : 486664 = Curve25519.A + 2 := by\n unfold Curve25519.A\n decide\n\n",
"fan_in": 4,
"n_lines": 5,
"n_chars": 80,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 0,
"au... | [
{
"name": "montgomery_inv_u_eq",
"fan_in": 1,
"n_deps_direct": 3,
"n_deps_transitive": 10,
"n_lines": 18,
"n_chars": 781,
"n_subproofs": 2,
"n_tactics": 6,
"cyclomatic": 1,
"n_automation": 3,
"n_rewrites": 2,
"n_structural": 0,
"automation_only": false,
"max_n... | 7 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -233,6 +233,10 @@
field_simp [this]
decide
+lemma A_add_2 : 486664 = Curve25519.A + 2 := by
+ unfold Curve25519.A
+ decide
+
lemma B_d_relation : IsSquare (4 / ((Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d)) := by
rw [adB]
apply ((@legendreSym.eq_one_iff p _ (-486664)) (by decide)).mp
@@ -42... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_13 | aedd300b20601772 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 13 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 6 | [
{
"theorem_name": "neg_fromEdwards",
"depth": 1,
"n_commands": 0,
"n_lines": 36,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h : e = 0\n · simp [h, map_zero]\n · unfold fromEdwards\n rw [zero_iff] at h\n simp only [Edwards.neg_y, ... | [
{
"name": "map_zero",
"text": "theorem map_zero : fromEdwards 0 = 0 := by\n unfold fromEdwards\n simp only [Edwards.zero_y, ↓reduceDIte]\n\n",
"fan_in": 6,
"n_lines": 5,
"n_chars": 109,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
... | [
{
"name": "fromEdwards_add_of_snd_x_eq_zero",
"fan_in": 1,
"n_deps_direct": 6,
"n_deps_transitive": 16,
"n_lines": 39,
"n_chars": 1687,
"n_subproofs": 6,
"n_tactics": 34,
"cyclomatic": 2,
"n_automation": 18,
"n_rewrites": 4,
"n_structural": 2,
"automation_only": f... | 12 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -380,6 +380,10 @@
let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
.some (x := u) (y := v) (h := nonsingular_on_curves_M e hy hx)
+theorem map_zero : fromEdwards 0 = 0 := by
+ unfold fromEdwards
+ simp only [Edwards.zero_y, ↓reduceDIte]
+
theorem zeroY (e : Edwards.Point Edwards.Ed2... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_14 | 005fe1519dc04e98 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 14 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 6 | [
{
"theorem_name": "neg_fromEdwards",
"depth": 1,
"n_commands": 0,
"n_lines": 36,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h : e = 0\n · simp [h, map_zero]\n · unfold fromEdwards\n rw [zero_iff] at h\n simp only [Edwards.neg_y, ... | [
{
"name": "map_zero",
"text": "theorem map_zero : fromEdwards 0 = 0 := by\n unfold fromEdwards\n simp only [Edwards.zero_y, ↓reduceDIte]\n\n",
"fan_in": 6,
"n_lines": 5,
"n_chars": 109,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
... | [
{
"name": "fromEdwards_add_of_sum_y_eq_one",
"fan_in": 2,
"n_deps_direct": 3,
"n_deps_transitive": 15,
"n_lines": 10,
"n_chars": 324,
"n_subproofs": 2,
"n_tactics": 6,
"cyclomatic": 1,
"n_automation": 0,
"n_rewrites": 2,
"n_structural": 0,
"automation_only": false... | 11 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -369,6 +369,10 @@
let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
.some (x := u) (y := v) (h := nonsingular_on_curves_M e hy hx)
+theorem map_zero : fromEdwards 0 = 0 := by
+ unfold fromEdwards
+ simp only [Edwards.zero_y, ↓reduceDIte]
+
theorem zeroY (e : Edwards.Point Edwards.Ed2... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_15 | 15059629cbf1c0ce | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 15 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "adA",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide",
"n_chars": 107,
"n_sub... | [
{
"name": "a_sub_d",
"text": "lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by\n have ha : Edwards.Ed25519.a = -1 := by rfl\n rw [ha, d_eq]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 2,
"n_lines": 8,
"n... | [
{
"name": "birational_map_symm",
"fan_in": 4,
"n_deps_direct": 1,
"n_deps_transitive": 6,
"n_lines": 28,
"n_chars": 765,
"n_subproofs": 1,
"n_tactics": 19,
"cyclomatic": 5,
"n_automation": 14,
"n_rewrites": 0,
"n_structural": 4,
"automation_only": false,
"max_... | 2 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -213,10 +213,25 @@
field_simp [this]
decide
+lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by
+ have ha : Edwards.Ed25519.a = -1 := by rfl
+ rw [ha, d_eq]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma adA : 2 * ((Edwards.Ed25... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_16 | 60946b45d5941e2d | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 16 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "adA",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [a_plus_d, a_sub_d]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide",
"n_chars": 107,
"n_sub... | [
{
"name": "a_sub_d",
"text": "lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by\n have ha : Edwards.Ed25519.a = -1 := by rfl\n rw [ha, d_eq]\n have : (121666 : CurveField) ≠ 0 := by decide\n field_simp [this]\n decide\n\n",
"fan_in": 2,
"n_lines": 8,
"n... | [
{
"name": "fromEdwards_add_of_sum_x_eq_zero_of_sum_y_eq_neg_one_of_y_ne_neg_y",
"fan_in": 1,
"n_deps_direct": 7,
"n_deps_transitive": 11,
"n_lines": 95,
"n_chars": 4114,
"n_subproofs": 20,
"n_tactics": 84,
"cyclomatic": 2,
"n_automation": 40,
"n_rewrites": 9,
"n_struc... | 5 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -213,10 +213,25 @@
field_simp [this]
decide
+lemma a_sub_d : (Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d = - 1/121666 := by
+ have ha : Edwards.Ed25519.a = -1 := by rfl
+ rw [ha, d_eq]
+ have : (121666 : CurveField) ≠ 0 := by decide
+ field_simp [this]
+ decide
+
lemma adA : 2 * ((Edwards.Ed25... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_17 | e68ddf8dbb6cd371 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 17 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 1 | [
{
"theorem_name": "edwards_neg_iff_montgomery_neg",
"depth": 1,
"n_commands": 0,
"n_lines": 3,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [← injective_fromEdwards, condition_Neg]\n all_goals simp_all",
"n_chars": 72,
"n_subproofs": 0,... | [
{
"name": "condition_Neg",
"text": "lemma condition_Neg (e₁ e₂ : Edwards.Point Edwards.Ed25519)\n (hy1 : 1 - e₂.y ≠ 0) (hy2 : 1 - e₁.y ≠ 0) (hy3 : 1 + e₂.y ≠ 0)\n (hx1 : e₁.x ≠ 0) (hx2 : e₂.x ≠ 0) :\n ((1 + e₁.y) / (1 - e₁.y) = (1 + e₂.y) / (1 - e₂.y) ∧ e₁.x = -e₂.x) ↔\n ((1 + e₁.y) / (1 - e₁.y)... | [
{
"name": "fromEdwards_add_of_sum_x_eq_zero_of_sum_y_eq_neg_one",
"fan_in": 1,
"n_deps_direct": 1,
"n_deps_transitive": 12,
"n_lines": 40,
"n_chars": 1728,
"n_subproofs": 7,
"n_tactics": 29,
"cyclomatic": 3,
"n_automation": 8,
"n_rewrites": 3,
"n_structural": 7,
"... | 6 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -369,6 +369,28 @@
let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
.some (x := u) (y := v) (h := nonsingular_on_curves_M e hy hx)
+lemma condition_Neg (e₁ e₂ : Edwards.Point Edwards.Ed25519)
+ (hy1 : 1 - e₂.y ≠ 0) (hy2 : 1 - e₁.y ≠ 0) (hy3 : 1 + e₂.y ≠ 0)
+ (hx1 : e₁.x ≠ 0) (hx2 ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_18 | ccd00fce8acc501d | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 18 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 5 | [
{
"theorem_name": "nonsingular_on_curves_M",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [Montgomery.nonsingular_iff, WeierstrassCurve.Affine.equation_iff, MontgomeryCurveCurve25519]\n have := on_Mont... | [
{
"name": "on_MontgomeryCurves",
"text": "theorem on_MontgomeryCurves (e : Edwards.Point Edwards.Ed25519)\n (hy : e.y ≠ 1)\n (hx : e.x ≠ 0) :\n let u := (1 + e.y) / (1 - e.y)\n let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)\n v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u := by\n have... | [
{
"name": "fromEdwards_u_add_of_eq",
"fan_in": 1,
"n_deps_direct": 6,
"n_deps_transitive": 13,
"n_lines": 146,
"n_chars": 6526,
"n_subproofs": 28,
"n_tactics": 129,
"cyclomatic": 1,
"n_automation": 47,
"n_rewrites": 17,
"n_structural": 4,
"automation_only": false,... | 9 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -337,11 +337,25 @@
field_simp [hd_ne]
ring
+theorem on_MontgomeryCurves (e : Edwards.Point Edwards.Ed25519)
+ (hy : e.y ≠ 1)
+ (hx : e.x ≠ 0) :
+ let u := (1 + e.y) / (1 - e.y)
+ let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
+ v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u := by
+ hav... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_19 | 7c8c61266886a151 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 19 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 5 | [
{
"theorem_name": "nonsingular_on_curves_M",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [Montgomery.nonsingular_iff, WeierstrassCurve.Affine.equation_iff, MontgomeryCurveCurve25519]\n have := on_Mont... | [
{
"name": "on_MontgomeryCurves",
"text": "theorem on_MontgomeryCurves (e : Edwards.Point Edwards.Ed25519)\n (hy : e.y ≠ 1)\n (hx : e.x ≠ 0) :\n let u := (1 + e.y) / (1 - e.y)\n let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)\n v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u := by\n have... | [
{
"name": "fromEdwards_u_add_of_eq_y",
"fan_in": 2,
"n_deps_direct": 2,
"n_deps_transitive": 15,
"n_lines": 23,
"n_chars": 907,
"n_subproofs": 1,
"n_tactics": 7,
"cyclomatic": 2,
"n_automation": 3,
"n_rewrites": 0,
"n_structural": 2,
"automation_only": false,
... | 11 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -337,11 +337,25 @@
field_simp [hd_ne]
ring
+theorem on_MontgomeryCurves (e : Edwards.Point Edwards.Ed25519)
+ (hy : e.y ≠ 1)
+ (hx : e.x ≠ 0) :
+ let u := (1 + e.y) / (1 - e.y)
+ let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
+ v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u := by
+ hav... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_20 | cb9aa84143b6f5db | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 20 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 1 | [
{
"theorem_name": "fromEdwards_u_add_of_eq",
"depth": 1,
"n_commands": 0,
"n_lines": 129,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n simp only [Edwards.add_y, heqy]\n set u := (1 + e₂.y) / (1 - e₂.y) with hu\n set v := Curve25519.roots_B * (1 +... | [
{
"name": "id_1",
"text": "lemma id_1 {u v : CurveField}\n (equation : v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u) :\n (-((Curve25519.A + 2) * u ^ 2) + v ^ 2) * (u + 1) ^ 2 =\n u * ((u * (u * 3 + 2 * Curve25519.A) + 1) ^ 2 - 4 * v ^ 2 * Curve25519.A - 8 * u * v ^ 2) := by\n linear_combination ((u + ... | [
{
"name": "fromEdwards_v_add_of_eq",
"fan_in": 1,
"n_deps_direct": 9,
"n_deps_transitive": 19,
"n_lines": 99,
"n_chars": 4317,
"n_subproofs": 20,
"n_tactics": 74,
"cyclomatic": 1,
"n_automation": 32,
"n_rewrites": 15,
"n_structural": 5,
"automation_only": false,
... | 15 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -357,6 +357,12 @@
have := on_MontgomeryCurves e hy hx
simp_all only [ne_eq, zero_mul, add_zero, one_mul]
+lemma id_1 {u v : CurveField}
+ (equation : v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u) :
+ (-((Curve25519.A + 2) * u ^ 2) + v ^ 2) * (u + 1) ^ 2 =
+ u * ((u * (u * 3 + 2 * Curve25519.A) + 1) ^ 2 ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_21 | 8b958f3cde9a20e2 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 21 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "id_4",
"depth": 1,
"n_commands": 0,
"n_lines": 8,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n intro h\n apply non_eq₀\n have : u * Curve25519.A * 2 * (1 + u ^ 2) + 1 + u ^ 2 * 6 + u ^ 4\n = Curve25519.A * u * 2 + Curve255... | [
{
"name": "id_2",
"text": "lemma id_2 {u v : CurveField}\n (equation : v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u) :\n (-(Curve25519.A + 2) * u ^ 2 * (u + 1) ^ 2 * -1 + v ^ 2 * (u - 1) ^ 2) =\n u * (Curve25519.A * u * 2 + Curve25519.A * u ^ 3 * 2 + 1 + u ^ 2 * 6 + u ^ 4) := by\n linear_combination (... | [
{
"name": "fromEdwards_v_add_of_eq_y",
"fan_in": 1,
"n_deps_direct": 2,
"n_deps_transitive": 20,
"n_lines": 30,
"n_chars": 1397,
"n_subproofs": 1,
"n_tactics": 7,
"cyclomatic": 2,
"n_automation": 3,
"n_rewrites": 0,
"n_structural": 2,
"automation_only": false,
... | 16 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -363,6 +363,12 @@
u * ((u * (u * 3 + 2 * Curve25519.A) + 1) ^ 2 - 4 * v ^ 2 * Curve25519.A - 8 * u * v ^ 2) := by
linear_combination ((u + 1) ^ 2 + u * (4 * Curve25519.A + 8 * u)) * equation
+lemma id_2 {u v : CurveField}
+ (equation : v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u) :
+ (-(Curve25519.A + 2... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_22 | 5611bf03c87338a1 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 22 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 4 | [
{
"theorem_name": "roots_B_d",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n simp only [pow2_roots_B, adB, neg_mul]\n simp only [A_add_2, inver_Ad_eq, neg_sub]\n decide",
"n_chars": 97,
"n_subproo... | [
{
"name": "A_add_2",
"text": "lemma A_add_2 : 486664 = Curve25519.A + 2 := by\n unfold Curve25519.A\n decide\n\n",
"fan_in": 4,
"n_lines": 5,
"n_chars": 80,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 0,
"au... | [
{
"name": "aux_poly_sub",
"fan_in": 1,
"n_deps_direct": 4,
"n_deps_transitive": 10,
"n_lines": 24,
"n_chars": 1336,
"n_subproofs": 4,
"n_tactics": 17,
"cyclomatic": 1,
"n_automation": 4,
"n_rewrites": 3,
"n_structural": 1,
"automation_only": false,
"max_nestin... | 6 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -233,6 +233,10 @@
field_simp [this]
decide
+lemma A_add_2 : 486664 = Curve25519.A + 2 := by
+ unfold Curve25519.A
+ decide
+
lemma B_d_relation : IsSquare (4 / ((Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d)) := by
rw [adB]
apply ((@legendreSym.eq_one_iff p _ (-486664)) (by decide)).mp
@@ -26... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_23 | df4ad3cfe3222cdd | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 23 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 4 | [
{
"theorem_name": "roots_B_d",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n simp only [pow2_roots_B, adB, neg_mul]\n simp only [A_add_2, inver_Ad_eq, neg_sub]\n decide",
"n_chars": 97,
"n_subproo... | [
{
"name": "A_add_2",
"text": "lemma A_add_2 : 486664 = Curve25519.A + 2 := by\n unfold Curve25519.A\n decide\n\n",
"fan_in": 4,
"n_lines": 5,
"n_chars": 80,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
"n_structural": 0,
"au... | [
{
"name": "aux_poly_add",
"fan_in": 1,
"n_deps_direct": 4,
"n_deps_transitive": 10,
"n_lines": 27,
"n_chars": 1368,
"n_subproofs": 4,
"n_tactics": 19,
"cyclomatic": 1,
"n_automation": 4,
"n_rewrites": 3,
"n_structural": 1,
"automation_only": false,
"max_nestin... | 6 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -233,6 +233,10 @@
field_simp [this]
decide
+lemma A_add_2 : 486664 = Curve25519.A + 2 := by
+ unfold Curve25519.A
+ decide
+
lemma B_d_relation : IsSquare (4 / ((Edwards.Ed25519.a : CurveField) - Edwards.Ed25519.d)) := by
rw [adB]
apply ((@legendreSym.eq_one_iff p _ (-486664)) (by decide)).mp
@@ -26... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_24 | 1369a26c9cc0b81e | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 24 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 1 | [
{
"theorem_name": "on_curves_M",
"depth": 1,
"n_commands": 0,
"n_lines": 33,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have eq := e.on_curve\n have huy := montgomery_edwards_inverse hy\n set u := (1 + e.y) / (1 - e.y) with hu\n set v := (1 + ... | [
{
"name": "montgomery_edwards_inverse",
"text": "lemma montgomery_edwards_inverse {y : CurveField} (hy1 : y ≠ 1) :\n let u := (1 + y) / (1 - y)\n y = (u - 1) / (u + 1) := by\n intro u\n have num_eq : u - 1 = (1 + y - (1 - y)) / (1 - y) := by\n field_simp [hy1]\n agrind\n have num_simplified :... | [
{
"name": "fromEdwards_u_add_of_y_ne",
"fan_in": 2,
"n_deps_direct": 6,
"n_deps_transitive": 19,
"n_lines": 68,
"n_chars": 2891,
"n_subproofs": 11,
"n_tactics": 47,
"cyclomatic": 1,
"n_automation": 14,
"n_rewrites": 4,
"n_structural": 7,
"automation_only": false,
... | 13 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -274,6 +274,37 @@
decide
-- Prove that the Montgomery to Edwards conversion inverts the Edwards to Montgomery conversion
+lemma montgomery_edwards_inverse {y : CurveField} (hy1 : y ≠ 1) :
+ let u := (1 + y) / (1 - y)
+ y = (u - 1) / (u + 1) := by
+ intro u
+ have num_eq : u - 1 = (1 + y - (1 - y)) / (1... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_25 | 6de0c9e5075c5600 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 25 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 5 | [
{
"theorem_name": "nonsingular_on_curves_M",
"depth": 1,
"n_commands": 0,
"n_lines": 4,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n rw [Montgomery.nonsingular_iff, WeierstrassCurve.Affine.equation_iff, MontgomeryCurveCurve25519]\n have := on_Mont... | [
{
"name": "on_MontgomeryCurves",
"text": "theorem on_MontgomeryCurves (e : Edwards.Point Edwards.Ed25519)\n (hy : e.y ≠ 1)\n (hx : e.x ≠ 0) :\n let u := (1 + e.y) / (1 - e.y)\n let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)\n v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u := by\n have... | [
{
"name": "fromEdwards_v_add_of_y_ne",
"fan_in": 1,
"n_deps_direct": 7,
"n_deps_transitive": 21,
"n_lines": 94,
"n_chars": 4491,
"n_subproofs": 19,
"n_tactics": 69,
"cyclomatic": 1,
"n_automation": 23,
"n_rewrites": 8,
"n_structural": 5,
"automation_only": false,
... | 15 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -347,11 +347,25 @@
field_simp [hd_ne]
ring
+theorem on_MontgomeryCurves (e : Edwards.Point Edwards.Ed25519)
+ (hy : e.y ≠ 1)
+ (hx : e.x ≠ 0) :
+ let u := (1 + e.y) / (1 - e.y)
+ let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
+ v ^ 2 = u ^ 3 + Curve25519.A * u ^ 2 + u := by
+ hav... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_26 | 418d9dac7d2af9f1 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 26 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 6 | [
{
"theorem_name": "neg_fromEdwards",
"depth": 1,
"n_commands": 0,
"n_lines": 36,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h : e = 0\n · simp [h, map_zero]\n · unfold fromEdwards\n rw [zero_iff] at h\n simp only [Edwards.neg_y, ... | [
{
"name": "map_zero",
"text": "theorem map_zero : fromEdwards 0 = 0 := by\n unfold fromEdwards\n simp only [Edwards.zero_y, ↓reduceDIte]\n\n",
"fan_in": 6,
"n_lines": 5,
"n_chars": 109,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
... | [
{
"name": "fromEdwards_add_of_x_ne_zero",
"fan_in": 1,
"n_deps_direct": 12,
"n_deps_transitive": 39,
"n_lines": 54,
"n_chars": 3055,
"n_subproofs": 6,
"n_tactics": 52,
"cyclomatic": 1,
"n_automation": 26,
"n_rewrites": 5,
"n_structural": 7,
"automation_only": fals... | 31 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -485,6 +485,10 @@
let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
.some (x := u) (y := v) (h := nonsingular_on_curves_M e hy hx)
+theorem map_zero : fromEdwards 0 = 0 := by
+ unfold fromEdwards
+ simp only [Edwards.zero_y, ↓reduceDIte]
+
theorem zeroY (e : Edwards.Point Edwards.Ed2... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_27 | b7307bd572e2ffc2 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 27 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 6 | [
{
"theorem_name": "neg_fromEdwards",
"depth": 1,
"n_commands": 0,
"n_lines": 36,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h : e = 0\n · simp [h, map_zero]\n · unfold fromEdwards\n rw [zero_iff] at h\n simp only [Edwards.neg_y, ... | [
{
"name": "map_zero",
"text": "theorem map_zero : fromEdwards 0 = 0 := by\n unfold fromEdwards\n simp only [Edwards.zero_y, ↓reduceDIte]\n\n",
"fan_in": 6,
"n_lines": 5,
"n_chars": 109,
"n_subproofs": 0,
"n_tactics": 3,
"cyclomatic": 1,
"n_automation": 1,
"n_rewrites": 1,
... | [
{
"name": "fromEdwards_add_of_x_eq_zero",
"fan_in": 1,
"n_deps_direct": 4,
"n_deps_transitive": 17,
"n_lines": 17,
"n_chars": 921,
"n_subproofs": 0,
"n_tactics": 13,
"cyclomatic": 4,
"n_automation": 4,
"n_rewrites": 0,
"n_structural": 3,
"automation_only": false,
... | 13 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -369,6 +369,10 @@
let v := Curve25519.roots_B * (1 + e.y) / ((1 - e.y) * e.x)
.some (x := u) (y := v) (h := nonsingular_on_curves_M e hy hx)
+theorem map_zero : fromEdwards 0 = 0 := by
+ unfold fromEdwards
+ simp only [Edwards.zero_y, ↓reduceDIte]
+
theorem zeroY (e : Edwards.Point Edwards.Ed2... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_28 | bf1b10659c90b810 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 28 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "fromEdwards_add_of_x_ne_zero",
"depth": 1,
"n_commands": 0,
"n_lines": 48,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h1 : e₁.y = 1\n · exact absurd (zeroY e₁ h1 ▸ rfl) non_e1_x\n · by_cases h2 : e₂.y = 1\n · exac... | [
{
"name": "exceptEdwardsPoint",
"text": "theorem exceptEdwardsPoint {e : Edwards.Point Edwards.Ed25519}\n (h : 1 + e.y = 0) :\n e.x = 0 := by\n have hy : e.y = -1 := by agrind\n have h_curve := e.on_curve\n have ha : Edwards.Ed25519.a = -1 := rfl\n rw [ha, hy] at h_curve\n have h_factor : e.x ^ 2... | [
{
"name": "add_fromEdwards",
"fan_in": 1,
"n_deps_direct": 8,
"n_deps_transitive": 54,
"n_lines": 35,
"n_chars": 1708,
"n_subproofs": 5,
"n_tactics": 27,
"cyclomatic": 2,
"n_automation": 4,
"n_rewrites": 1,
"n_structural": 6,
"automation_only": false,
"max_nes... | 46 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -517,6 +517,20 @@
rfl
· apply zeroY
+theorem exceptEdwardsPoint {e : Edwards.Point Edwards.Ed25519}
+ (h : 1 + e.y = 0) :
+ e.x = 0 := by
+ have hy : e.y = -1 := by agrind
+ have h_curve := e.on_curve
+ have ha : Edwards.Ed25519.a = -1 := rfl
+ rw [ha, hy] at h_curve
+ have h_factor : e.x ^ 2 * ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_29 | df5c738de570c4b7 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 29 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 2 | [
{
"theorem_name": "fromEdwards_add_of_x_ne_zero",
"depth": 1,
"n_commands": 0,
"n_lines": 48,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n by_cases h1 : e₁.y = 1\n · exact absurd (zeroY e₁ h1 ▸ rfl) non_e1_x\n · by_cases h2 : e₂.y = 1\n · exac... | [
{
"name": "exceptEdwardsPoint",
"text": "theorem exceptEdwardsPoint {e : Edwards.Point Edwards.Ed25519}\n (h : 1 + e.y = 0) :\n e.x = 0 := by\n have hy : e.y = -1 := by agrind\n have h_curve := e.on_curve\n have ha : Edwards.Ed25519.a = -1 := rfl\n rw [ha, hy] at h_curve\n have h_factor : e.x ^ 2... | [
{
"name": "comm_mul_fromEdwards",
"fan_in": 0,
"n_deps_direct": 2,
"n_deps_transitive": 55,
"n_lines": 9,
"n_chars": 267,
"n_subproofs": 0,
"n_tactics": 6,
"cyclomatic": 2,
"n_automation": 2,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_n... | 47 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -517,6 +517,20 @@
rfl
· apply zeroY
+theorem exceptEdwardsPoint {e : Edwards.Point Edwards.Ed25519}
+ (h : 1 + e.y = 0) :
+ e.x = 0 := by
+ have hy : e.y = -1 := by agrind
+ have h_curve := e.on_curve
+ have ha : Edwards.Ed25519.a = -1 := rfl
+ rw [ha, hy] at h_curve
+ have h_factor : e.x ^ 2 * ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_c46c9d0a77f5_30 | 2092154f552b6444 | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Math/Montgomery/Representation.lean | Representation | 30 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 48 | 1 | [
{
"theorem_name": "toEdwards_on_curve",
"depth": 1,
"n_commands": 0,
"n_lines": 5,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have ha : Edwards.Ed25519.a = -1 := rfl\n have hd : (d : ZMod p) = Edwards.Ed25519.d := rfl\n rw [ha, ← hd]\n exact m... | [
{
"name": "montgomery_helper",
"text": "lemma montgomery_helper {F : Type*} [Field F] (d y x_sq : F)\n (h_den : d * y ^ 2 + 1 ≠ 0)\n (h_x : x_sq = (y ^ 2 - 1) * (d * y ^ 2 + 1)⁻¹) :\n -1 * x_sq + y ^ 2 = 1 + d * x_sq * y ^ 2 := by\n rw [h_x]; apply (mul_right_inj' h_den).mp; field_simp [h_den]\n ... | [
{
"name": "toEdwards_on_curve",
"fan_in": 0,
"n_deps_direct": 2,
"n_deps_transitive": 2,
"n_lines": 11,
"n_chars": 615,
"n_subproofs": 2,
"n_tactics": 5,
"cyclomatic": 1,
"n_automation": 2,
"n_rewrites": 1,
"n_structural": 1,
"automation_only": false,
"max_nes... | 1 | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | /-
Copyright 2025 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alessandro D'Angelo, Oliver Butterley, Hoang Le Truong
-/
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Math.Edwards.Curve
import Curve25519Dalek.Math.Edwards.Repr... | @@ -78,6 +78,13 @@
· rw [← inv_pow]; exact IsSquare.sq (y⁻¹)
exact Edwards.d_not_square h_d_sq
+lemma montgomery_helper {F : Type*} [Field F] (d y x_sq : F)
+ (h_den : d * y ^ 2 + 1 ≠ 0)
+ (h_x : x_sq = (y ^ 2 - 1) * (d * y ^ 2 + 1)⁻¹) :
+ -1 * x_sq + y ^ 2 = 1 + d * x_sq * y ^ 2 := by
+ rw [h_x... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_0fa2228e14e1_0 | 88667220e893b90a | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/FromU16.lean | FromU16 | 0 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 5 | 2 | [
{
"theorem_name": "U16_ofDigits_toLEBytes",
"depth": 1,
"n_commands": 0,
"n_lines": 15,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n have hmap :\n ((x.bv.toLEBytes.map (@UScalar.mk UScalarTy.U8)).map (·.val))\n = x.bv.toLEBytes.map (fun... | [
{
"name": "hmap",
"text": "private lemma hmap (bs : List U8) (h_len : bs.length = 2) :\n bs.map (·.val) = List.ofFn (fun i : Fin 2 => (bs[i]!).val) := by\n apply List.ext_getElem\n · simp [h_len]\n · intro i hi _\n simp only [List.getElem_map, List.getElem_ofFn]\n congr 1\n grind\n\n",
"f... | [
{
"name": "U16_ofDigits_toLEBytes",
"fan_in": 1,
"n_deps_direct": 2,
"n_deps_transitive": 2,
"n_lines": 19,
"n_chars": 771,
"n_subproofs": 2,
"n_tactics": 15,
"cyclomatic": 1,
"n_automation": 4,
"n_rewrites": 1,
"n_structural": 2,
"automation_only": false,
"ma... | 2 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Scalar.Scalar.FromU128
/-!
# Spec th... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Scalar.Scalar.FromU128
/-!
# Spec th... | @@ -33,7 +33,21 @@
private lemma U16_ofDigits_toLEBytes (x : U16) :
Nat.ofDigits (2^8)
- ((x.bv.toLEBytes.map (@UScalar.mk UScalarTy.U8)).map (·.val)) = x.val := sorry
+ ((x.bv.toLEBytes.map (@UScalar.mk UScalarTy.U8)).map (·.val)) = x.val := by
+ have hmap :
+ ((x.bv.toLEBytes.map (@UScalar.mk ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
ablate_0fa2228e14e1_1 | 9ddca7d1ddc4c6ec | lean | lean | github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify | b9fae801a9e47ac522ea6455a28b78e1d1e1fda5 | Curve25519Dalek/Specs/Scalar/Scalar/FromU16.lean | FromU16 | 1 | lemma_delete | null | null | false | 0.5 | 1 | 1 | false | 0 | inf | 0 | inf | 42 | 5 | 1 | [
{
"theorem_name": "from_spec",
"depth": 1,
"n_commands": 0,
"n_lines": 24,
"is_leaf": true,
"centrality": 0,
"method": "deleted-dep",
"proof_text": " by\n unfold «from» core.array.Array.index_mut core.ops.index.IndexMutSlice Array.from_slice\n simp only [step_simps]\n let* ⟨ x_byt... | [
{
"name": "U8x32_as_Nat_setSlice_zero",
"text": "private lemma U8x32_as_Nat_setSlice_zero (bs : List U8) (h_len : bs.length = 2) :\n U8x32_as_Nat ⟨(List.replicate 32 (0#u8)).setSlice! 0 bs, by simp⟩ =\n Nat.ofDigits (2^8) (bs.map (·.val)) := by\n rw [U8x32_as_Nat_setSlice_zeroI _ h_len, hmap]\n exac... | [
{
"name": "from_spec",
"fan_in": 0,
"n_deps_direct": 2,
"n_deps_transitive": 5,
"n_lines": 34,
"n_chars": 1681,
"n_subproofs": 3,
"n_tactics": 24,
"cyclomatic": 1,
"n_automation": 5,
"n_rewrites": 5,
"n_structural": 0,
"automation_only": false,
"max_nesting": ... | 5 | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Scalar.Scalar.FromU128
/-!
# Spec th... | /-
Copyright 2026 The Beneficial AI Foundation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hoang Le Truong
-/
import Curve25519Dalek.Funs
import Curve25519Dalek.Math.Basic
import Curve25519Dalek.Aux
import Curve25519Dalek.Specs.Scalar.Scalar.FromU128
/-!
# Spec th... | @@ -64,6 +64,12 @@
congr 1
grind
+private lemma U8x32_as_Nat_setSlice_zero (bs : List U8) (h_len : bs.length = 2) :
+ U8x32_as_Nat ⟨(List.replicate 32 (0#u8)).setSlice! 0 bs, by simp⟩ =
+ Nat.ofDigits (2^8) (bs.map (·.val)) := by
+ rw [U8x32_as_Nat_setSlice_zeroI _ h_len, hmap]
+ exact h_len
+
/-- ... | {
"repo": "curve25519-dalek-lean-verify",
"git_repo": "github.com/Beneficial-AI-Foundation/curve25519-dalek-lean-verify",
"revision": "b9fae801a9e47ac522ea6455a28b78e1d1e1fda5",
"lean_toolchain": "leanprover/lean4:v4.30.0-rc2",
"proof_assistant": "lean",
"ablator": "ablators/lean (corollary-delete-lemmas-le... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.