[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78BCWS5C5Y9FTEFSGSXN2QP":3,"skill-same:01M78BCWS5C5Y9FTEFSGSXN2QP":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M78BCWS5C5Y9FTEFSGSXN2QP","qedgen",null,"Formally verify programs by writing Lean 4 proofs. Trigger this skill whenever the user wants to formally verify code, generate Lean 4 proofs, prove properties about algorithms or smart contracts, verify invariants, convert program logic into formal specifications, or anything involving Lean 4 and formal verification. Also trigger when the user mentions \"qedgen\", \"lean proof\", \"formal proof\", \"verify my code\", \"prove correctness\", \"formal verification\", or wants mathematical guarantees about their implementation.","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fsolana-formal-verification\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: qedgen\ndescription: Formally verify programs by writing Lean 4 proofs. Trigger this skill whenever the user wants to formally verify code, generate Lean 4 proofs, prove properties about algorithms or smart contracts, verify invariants, convert program logic into formal specifications, or anything involving Lean 4 and formal verification. Also trigger when the user mentions \"qedgen\", \"lean proof\", \"formal proof\", \"verify my code\", \"prove correctness\", \"formal verification\", or wants mathematical guarantees about their implementation.\n---\n\n# QEDGen — Agent-Driven Formal Verification\n\nYou (Claude) are the proof engineer. You read the codebase, write Lean 4 models and proofs, iterate on compiler errors, and call Leanstral (Mistral's theorem prover) only for hard sub-goals you cannot fill yourself.\n\n## Architecture\n\n```\nYou (Claude)                          Leanstral (remote model)\n  ├── Read spec \u002F source code           ├── Fill sorry markers\n  ├── Write Lean 4 models               └── Suggest tactics for hard goals\n  ├── Write theorem statements\n  ├── Write proof attempts\n  ├── Run `lake build`, read errors\n  └── Fix and iterate\n```\n\n## Step 1: Understand the program\n\nCheck for existing artifacts in this priority order:\n\n1. **spec.md exists** → Read it. An existing spec captures the author's intent, state model, invariants, and operations. Extract security goals, state model, and formal properties. Skip the scoping quiz and go directly to Step 2.\n2. **IDL exists** (`target\u002Fidl\u002F\u003Cprogram>.json`) → Run `qedgen spec --idl \u003Cpath>` to generate a draft SPEC.md with TODO markers, then refine interactively.\n3. **Neither exists** → Read the source code directly. Ask broader scoping questions.\n\n## Step 2: Scope the verification\n\nIf no spec.md was found, run a short interactive quiz — one question at a time, with checkbox options derived from the program's structure. Ask about **functionality and risks**, not implementation details.\n\n**Question 1: \"What does this program need to guarantee above all else?\"**\nOptions derived from the program's structure:\n- Authorization \u002F access control\n- Tokens are never lost \u002F correct routing\n- One-shot safety \u002F no replay\n- Arithmetic safety \u002F no overflow\n- Conservation (e.g., vault >= total claims)\n- All of the above\n\n**Question 2: \"Which scenario worries you most?\"**\nGenerate concrete risk scenarios from the program.\n\n**Question 3: \"Does the program make any assumptions that aren't enforced on-chain?\"**\n\nAsk questions **one at a time**. Wait for the user's answer before presenting the next question.\n\n## Step 3: Write SPEC.md\n\nWrite `formal_verification\u002FSPEC.md` using normative language (MUST, MUST NOT, MAY). Structure:\n\n```markdown\n# \u003CProgram Name> Verification Spec v1.0\n\n\u003C1-2 sentences describing what the program does>\n\n## 0. Security Goals\n1. **\u003CGoal name>**: \u003Cnormative statement>\n\n## 1. State Model\n\u003CState struct with field names, types, and comments>\n\u003CLifecycle diagram if applicable>\n\n## 2. Operations\n### 2.1 \u003COperation name>\n**Signers**: \u003Cwho MUST sign>\n**Preconditions**: \u003Cwhat MUST be true before>\n**Effects**: \u003Cnumbered steps>\n**Postconditions**: \u003Cwhat MUST be true after>\n\n## 3. Formal Properties\n### 3.1 \u003CCategory>\n**\u003Cproperty_id>**: For all \u003Cquantified variables>,\nif \u003Ctransition predicate> then \u003Cconclusion>.\n\n## 4. Trust Boundary\n\u003CWhat is axiomatic and why>\n\n## 5. Verification Results\n| Property | Status | Proof |\n|---|---|---|\n| ... | **Open** | |\n```\n\nPresent SPEC.md to the user and get confirmation before proceeding.\n\n## Step 4: Set up the Lean project\n\n```bash\nqedgen setup            # Ensure global Mathlib cache exists (first time: 15-45 min)\n```\n\nCreate the project structure:\n\n```\nformal_verification\u002F\n  lakefile.lean          # import lean_support and Mathlib\n  lean-toolchain         # leanprover\u002Flean4:v4.15.0\n  lean_support\u002F          # Solana axiom library (copy from qedgen)\n  Proofs.lean            # root import: import Proofs.AccessControl etc.\n  Proofs\u002F\n    AccessControl.lean\n    CpiCorrectness.lean\n    Conservation.lean\n    StateMachine.lean\n    ArithmeticSafety.lean\n```\n\n## Step 5: Write Lean proofs\n\nThis is the core step. You write Lean 4 directly — models, transitions, theorems, and proofs.\n\n### Modeling workflow\n\nFor each property in SPEC.md:\n\n1. **Define the state** as a Lean structure (map fields from source\u002Fspec)\n2. **Define the transition** as `Option StateType` (return `none` on precondition failure)\n3. **State the theorem** matching the SPEC.md property\n4. **Write the proof** using the patterns below\n5. **Run `lake build`** and iterate on errors\n\n### Support library API\n\nAfter `import QEDGen.Solana` and `open QEDGen.Solana`:\n\n**Types:**\n- `Pubkey` (= Nat), `U64` (= Nat), `U8` (= Nat)\n- `Account` — `{ key : Pubkey, authority : Pubkey, balance : Nat, writable : Bool }`\n- `Lifecycle` — `open | closed` (with DecidableEq)\n- `TransferCpi` — `{ program, «from», «to», authority, amount }`\n- `MintToCpi`, `BurnCpi`, `CloseCpi`\n\n**Constants:**\n- `TOKEN_PROGRAM_ID`, `SYSTEM_PROGRAM_ID`\n- `U8_MAX`, `U16_MAX`, `U32_MAX`, `U64_MAX`, `U128_MAX`\n\n**Functions:**\n- `findByKey : List Account → Pubkey → Option Account`\n- `findByAuthority : List Account → Pubkey → Option Account`\n- `canWrite : Pubkey → Account → Prop`\n- `transferCpiValid : TransferCpi → Prop`\n- `closes : Lifecycle → Lifecycle → Prop`\n- `valid_u64 : Nat → Prop` (and u8, u16, u32, u128)\n\n**Key lemmas:**\n- `closes_is_closed`, `closes_was_open`, `closed_irreversible`\n- `valid_u64_preserved_by_zero`, `valid_u64_preserved_by_same`\n- `find_map_update_other`, `find_map_update_same` (axioms for account list updates)\n\n### Proof patterns\n\n**Access control** — signer must match authority:\n```lean\nstructure ProgramState where\n  authority : Pubkey\n\ndef cancelTransition (s : ProgramState) (signer : Pubkey) : Option Unit :=\n  if signer = s.authority then some () else none\n\ntheorem cancel_access_control (s : ProgramState) (signer : Pubkey)\n    (h : cancelTransition s signer ≠ none) :\n    signer = s.authority := by\n  unfold cancelTransition at h\n  split_ifs at h with h_eq\n  · exact h_eq\n  · contradiction\n```\n\n**CPI correctness** — parameters match (pure `rfl`):\n```lean\ndef cancel_build_cpi (ctx : CancelContext) : TransferCpi :=\n  { program := TOKEN_PROGRAM_ID, «from» := ctx.escrow_token, «to» := ctx.dest,\n    authority := ctx.authority, amount := ctx.amount }\n\ntheorem cancel_cpi_correct (ctx : CancelContext) :\n    let cpi := cancel_build_cpi ctx\n    cpi.program = TOKEN_PROGRAM_ID ∧ cpi.«from» = ctx.escrow_token ∧\n    cpi.«to» = ctx.dest ∧ cpi.authority = ctx.authority ∧\n    cpi.amount = ctx.amount := by\n  unfold cancel_build_cpi\n  exact ⟨rfl, rfl, rfl, rfl, rfl⟩\n```\n\n**State machine** — lifecycle transitions:\n```lean\ndef cancelTransition (s : ProgramState) : Option ProgramState :=\n  if s.escrow.lifecycle = Lifecycle.open then\n    some { escrow := { s.escrow with lifecycle := Lifecycle.closed } }\n  else none\n\ntheorem cancel_closes_escrow (pre post : ProgramState)\n    (h : cancelTransition pre = some post) :\n    post.escrow.lifecycle = Lifecycle.closed := by\n  unfold cancelTransition at h\n  split_ifs at h with h_open\n  cases h\n  rfl\n```\n\n**Conservation** — invariant preserved across operations:\n```lean\ndef conservation (s : EngineState) : Prop := s.V >= s.C_tot + s.I\n\ndef depositTransition (s : EngineState) (amount : Nat) : Option EngineState :=\n  if s.V + amount \u003C= MAX_VAULT_TVL then\n    some { V := s.V + amount, C_tot := s.C_tot + amount, I := s.I }\n  else none\n\ntheorem deposit_conservation (s s' : EngineState) (amount : Nat)\n    (h_inv : conservation s)\n    (h : depositTransition s amount = some s') :\n    conservation s' := by\n  unfold depositTransition at h\n  split_ifs at h with h_le\n  · cases h\n    unfold conservation at h_inv ⊢  -- MUST unfold in BOTH hypothesis and goal\n    omega\n  · contradiction\n```\n\n**Arithmetic safety** — bounds preserved:\n```lean\ndef initializeTransition (amount taker : Nat) : Option ProgramState :=\n  if amount > 0 ∧ amount ≤ U64_MAX ∧ taker > 0 ∧ taker ≤ U64_MAX then\n    some { initializer_amount := amount, taker_amount := taker }\n  else none\n\ntheorem initialize_arithmetic_safety (amount taker : Nat) (post : ProgramState)\n    (h : initializeTransition amount taker = some post) :\n    post.initializer_amount ≤ U64_MAX ∧ post.taker_amount ≤ U64_MAX := by\n  unfold initializeTransition at h\n  split_ifs at h with h_bounds\n  cases h\n  exact ⟨h_bounds.2.1, h_bounds.2.2.2⟩\n```\n\n### Critical tactic rules\n\n| Do | Don't |\n|---|---|\n| `unfold f at h` before `split_ifs` | `simp [f] at h` before `split_ifs` (kills if-structure) |\n| `unfold pred at h_inv ⊢` for named predicates | `unfold pred` only in goal (omega can't see hypotheses) |\n| `cases h` after `split_ifs` on `some = some` | `injection h` (unnecessary, cases handles it) |\n| `omega` for linear arithmetic | `norm_num` for linear goals (omega is more reliable) |\n| `exact ⟨rfl, rfl, rfl⟩` for conjunctions of rfl | `constructor` + `rfl` + `constructor` + `rfl` (verbose) |\n| `if cond then ... else ...` without proof binding | `if h : cond then ...` when `h` is unused |\n\n### Common errors and fixes\n\n| Error | Fix |\n|---|---|\n| `omega could not prove the goal` | Unfold named predicates in hypotheses: `unfold pred at h ⊢` |\n| `no goals to be solved` | Remove redundant tactic (e.g., `· contradiction` after auto-closed branch) |\n| `unknown constant 'X'` | Check imports; add `import QEDGen.Solana.X` or `open QEDGen.Solana` |\n| `tactic 'split_ifs' failed, no if-then-else` | Use `unfold` first, not `simp` |\n| `unused variable 'h'` | Remove proof binding: `if h : cond` → `if cond` |\n\n## Step 6: Call Leanstral for hard sub-goals\n\nWhen you have a proof with `sorry` markers you cannot fill after 2-3 attempts:\n\n```bash\nqedgen fill-sorry --file formal_verification\u002FProofs\u002FHard.lean --validate\n```\n\nThis sends each `sorry` location to Leanstral with focused context. Review the result — Leanstral may introduce tactics you can learn from for future proofs.\n\nIf `fill-sorry` also fails, simplify the theorem statement or split the property into smaller lemmas.\n\n## Step 7: Verify and report\n\n```bash\ncd formal_verification && lake build\n```\n\nUpdate SPEC.md verification results table:\n- **Verified**: Theorem compiles, no `sorry`\n- **Partial**: Proof has `sorry` markers\n- **Open**: No compiling proof\n\n## Environment\n\n- **`MISTRAL_API_KEY`** — required for `fill-sorry`. Free from [console.mistral.ai](https:\u002F\u002Fconsole.mistral.ai)\n- **`QEDGEN_VALIDATION_WORKSPACE`** — optional override for global Mathlib cache location\n\n## Error handling\n\n- **First `lake build` is slow**: Mathlib compilation takes 15-45 min on first run. Subsequent builds reuse the cache.\n- **`could not resolve 'HEAD' to a commit`**: Remove `.lake\u002Fpackages\u002Fmathlib` and run `lake update`.\n- **Rate limiting (429)**: Built-in exponential backoff in `fill-sorry`.\n","# QEDGen — Agent-Driven Formal Verification\n\nYou (Claude) are the proof engineer. You read the codebase, write Lean 4 models and proofs, iterate on compiler errors, and call Leanstral (Mistral's theorem prover) only for hard sub-goals you cannot fill yourself.\n\n## Architecture\n\n```\nYou (Claude)                          Leanstral (remote model)\n  ├── Read spec \u002F source code           ├── Fill sorry markers\n  ├── Write Lean 4 models               └── Suggest tactics for hard goals\n  ├── Write theorem statements\n  ├── Write proof attempts\n  ├── Run `lake build`, read errors\n  └── Fix and iterate\n```\n\n## Step 1: Understand the program\n\nCheck for existing artifacts in this priority order:\n\n1. **spec.md exists** → Read it. An existing spec captures the author's intent, state model, invariants, and operations. Extract security goals, state model, and formal properties. Skip the scoping quiz and go directly to Step 2.\n2. **IDL exists** (`target\u002Fidl\u002F\u003Cprogram>.json`) → Run `qedgen spec --idl \u003Cpath>` to generate a draft SPEC.md with TODO markers, then refine interactively.\n3. **Neither exists** → Read the source code directly. Ask broader scoping questions.\n\n## Step 2: Scope the verification\n\nIf no spec.md was found, run a short interactive quiz — one question at a time, with checkbox options derived from the program's structure. Ask about **functionality and risks**, not implementation details.\n\n**Question 1: \"What does this program need to guarantee above all else?\"**\nOptions derived from the program's structure:\n- Authorization \u002F access control\n- Tokens are never lost \u002F correct routing\n- One-shot safety \u002F no replay\n- Arithmetic safety \u002F no overflow\n- Conservation (e.g., vault >= total claims)\n- All of the above\n\n**Question 2: \"Which scenario worries you most?\"**\nGenerate concrete risk scenarios from the program.\n\n**Question 3: \"Does the program make any assumptions that aren't enforced on-chain?\"**\n\nAsk questions **one at a time**. Wait for the user's answer before presenting the next question.\n\n## Step 3: Write SPEC.md\n\nWrite `formal_verification\u002FSPEC.md` using normative language (MUST, MUST NOT, MAY). Structure:\n\n```markdown\n# \u003CProgram Name> Verification Spec v1.0\n\n\u003C1-2 sentences describing what the program does>\n\n## 0. Security Goals\n1. **\u003CGoal name>**: \u003Cnormative statement>\n\n## 1. State Model\n\u003CState struct with field names, types, and comments>\n\u003CLifecycle diagram if applicable>\n\n## 2. Operations\n### 2.1 \u003COperation name>\n**Signers**: \u003Cwho MUST sign>\n**Preconditions**: \u003Cwhat MUST be true before>\n**Effects**: \u003Cnumbered steps>\n**Postconditions**: \u003Cwhat MUST be true after>\n\n## 3. Formal Properties\n### 3.1 \u003CCategory>\n**\u003Cproperty_id>**: For all \u003Cquantified variables>,\nif \u003Ctransition predicate> then \u003Cconclusion>.\n\n## 4. Trust Boundary\n\u003CWhat is axiomatic and why>\n\n## 5. Verification Results\n| Property | Status | Proof |\n|---|---|---|\n| ... | **Open** | |\n```\n\nPresent SPEC.md to the user and get confirmation before proceeding.\n\n## Step 4: Set up the Lean project\n\n```bash\nqedgen setup            # Ensure global Mathlib cache exists (first time: 15-45 min)\n```\n\nCreate the project structure:\n\n```\nformal_verification\u002F\n  lakefile.lean          # import lean_support and Mathlib\n  lean-toolchain         # leanprover\u002Flean4:v4.15.0\n  lean_support\u002F          # Solana axiom library (copy from qedgen)\n  Proofs.lean            # root import: import Proofs.AccessControl etc.\n  Proofs\u002F\n    AccessControl.lean\n    CpiCorrectness.lean\n    Conservation.lean\n    StateMachine.lean\n    ArithmeticSafety.lean\n```\n\n## Step 5: Write Lean proofs\n\nThis is the core step. You write Lean 4 directly — models, transitions, theorems, and proofs.\n\n### Modeling workflow\n\nFor each property in SPEC.md:\n\n1. **Define the state** as a Lean structure (map fields from source\u002Fspec)\n2. **Define the transition** as `Option StateType` (return `none` on precondition failure)\n3. **State the theorem** matching the SPEC.md property\n4. **Write the proof** using the patterns below\n5. **Run `lake build`** and iterate on errors\n\n### Support library API\n\nAfter `import QEDGen.Solana` and `open QEDGen.Solana`:\n\n**Types:**\n- `Pubkey` (= Nat), `U64` (= Nat), `U8` (= Nat)\n- `Account` — `{ key : Pubkey, authority : Pubkey, balance : Nat, writable : Bool }`\n- `Lifecycle` — `open | closed` (with DecidableEq)\n- `TransferCpi` — `{ program, «from», «to», authority, amount }`\n- `MintToCpi`, `BurnCpi`, `CloseCpi`\n\n**Constants:**\n- `TOKEN_PROGRAM_ID`, `SYSTEM_PROGRAM_ID`\n- `U8_MAX`, `U16_MAX`, `U32_MAX`, `U64_MAX`, `U128_MAX`\n\n**Functions:**\n- `findByKey : List Account → Pubkey → Option Account`\n- `findByAuthority : List Account → Pubkey → Option Account`\n- `canWrite : Pubkey → Account → Prop`\n- `transferCpiValid : TransferCpi → Prop`\n- `closes : Lifecycle → Lifecycle → Prop`\n- `valid_u64 : Nat → Prop` (and u8, u16, u32, u128)\n\n**Key lemmas:**\n- `closes_is_closed`, `closes_was_open`, `closed_irreversible`\n- `valid_u64_preserved_by_zero`, `valid_u64_preserved_by_same`\n- `find_map_update_other`, `find_map_update_same` (axioms for account list updates)\n\n### Proof patterns\n\n**Access control** — signer must match authority:\n```lean\nstructure ProgramState where\n  authority : Pubkey\n\ndef cancelTransition (s : ProgramState) (signer : Pubkey) : Option Unit :=\n  if signer = s.authority then some () else none\n\ntheorem cancel_access_control (s : ProgramState) (signer : Pubkey)\n    (h : cancelTransition s signer ≠ none) :\n    signer = s.authority := by\n  unfold cancelTransition at h\n  split_ifs at h with h_eq\n  · exact h_eq\n  · contradiction\n```\n\n**CPI correctness** — parameters match (pure `rfl`):\n```lean\ndef cancel_build_cpi (ctx : CancelContext) : TransferCpi :=\n  { program := TOKEN_PROGRAM_ID, «from» := ctx.escrow_token, «to» := ctx.dest,\n    authority := ctx.authority, amount := ctx.amount }\n\ntheorem cancel_cpi_correct (ctx : CancelContext) :\n    let cpi := cancel_build_cpi ctx\n    cpi.program = TOKEN_PROGRAM_ID ∧ cpi.«from» = ctx.escrow_token ∧\n    cpi.«to» = ctx.dest ∧ cpi.authority = ctx.authority ∧\n    cpi.amount = ctx.amount := by\n  unfold cancel_build_cpi\n  exact ⟨rfl, rfl, rfl, rfl, rfl⟩\n```\n\n**State machine** — lifecycle transitions:\n```lean\ndef cancelTransition (s : ProgramState) : Option ProgramState :=\n  if s.escrow.lifecycle = Lifecycle.open then\n    some { escrow := { s.escrow with lifecycle := Lifecycle.closed } }\n  else none\n\ntheorem cancel_closes_escrow (pre post : ProgramState)\n    (h : cancelTransition pre = some post) :\n    post.escrow.lifecycle = Lifecycle.closed := by\n  unfold cancelTransition at h\n  split_ifs at h with h_open\n  cases h\n  rfl\n```\n\n**Conservation** — invariant preserved across operations:\n```lean\ndef conservation (s : EngineState) : Prop := s.V >= s.C_tot + s.I\n\ndef depositTransition (s : EngineState) (amount : Nat) : Option EngineState :=\n  if s.V + amount \u003C= MAX_VAULT_TVL then\n    some { V := s.V + amount, C_tot := s.C_tot + amount, I := s.I }\n  else none\n\ntheorem deposit_conservation (s s' : EngineState) (amount : Nat)\n    (h_inv : conservation s)\n    (h : depositTransition s amount = some s') :\n    conservation s' := by\n  unfold depositTransition at h\n  split_ifs at h with h_le\n  · cases h\n    unfold conservation at h_inv ⊢  -- MUST unfold in BOTH hypothesis and goal\n    omega\n  · contradiction\n```\n\n**Arithmetic safety** — bounds preserved:\n```lean\ndef initializeTransition (amount taker : Nat) : Option ProgramState :=\n  if amount > 0 ∧ amount ≤ U64_MAX ∧ taker > 0 ∧ taker ≤ U64_MAX then\n    some { initializer_amount := amount, taker_amount := taker }\n  else none\n\ntheorem initialize_arithmetic_safety (amount taker : Nat) (post : ProgramState)\n    (h : initializeTransition amount taker = some post) :\n    post.initializer_amount ≤ U64_MAX ∧ post.taker_amount ≤ U64_MAX := by\n  unfold initializeTransition at h\n  split_ifs at h with h_bounds\n  cases h\n  exact ⟨h_bounds.2.1, h_bounds.2.2.2⟩\n```\n\n### Critical tactic rules\n\n| Do | Don't |\n|---|---|\n| `unfold f at h` before `split_ifs` | `simp [f] at h` before `split_ifs` (kills if-structure) |\n| `unfold pred at h_inv ⊢` for named predicates | `unfold pred` only in goal (omega can't see hypotheses) |\n| `cases h` after `split_ifs` on `some = some` | `injection h` (unnecessary, cases handles it) |\n| `omega` for linear arithmetic | `norm_num` for linear goals (omega is more reliable) |\n| `exact ⟨rfl, rfl, rfl⟩` for conjunctions of rfl | `constructor` + `rfl` + `constructor` + `rfl` (verbose) |\n| `if cond then ... else ...` without proof binding | `if h : cond then ...` when `h` is unused |\n\n### Common errors and fixes\n\n| Error | Fix |\n|---|---|\n| `omega could not prove the goal` | Unfold named predicates in hypotheses: `unfold pred at h ⊢` |\n| `no goals to be solved` | Remove redundant tactic (e.g., `· contradiction` after auto-closed branch) |\n| `unknown constant 'X'` | Check imports; add `import QEDGen.Solana.X` or `open QEDGen.Solana` |\n| `tactic 'split_ifs' failed, no if-then-else` | Use `unfold` first, not `simp` |\n| `unused variable 'h'` | Remove proof binding: `if h : cond` → `if cond` |\n\n## Step 6: Call Leanstral for hard sub-goals\n\nWhen you have a proof with `sorry` markers you cannot fill after 2-3 attempts:\n\n```bash\nqedgen fill-sorry --file formal_verification\u002FProofs\u002FHard.lean --validate\n```\n\nThis sends each `sorry` location to Leanstral with focused context. Review the result — Leanstral may introduce tactics you can learn from for future proofs.\n\nIf `fill-sorry` also fails, simplify the theorem statement or split the property into smaller lemmas.\n\n## Step 7: Verify and report\n\n```bash\ncd formal_verification && lake build\n```\n\nUpdate SPEC.md verification results table:\n- **Verified**: Theorem compiles, no `sorry`\n- **Partial**: Proof has `sorry` markers\n- **Open**: No compiling proof\n\n## Environment\n\n- **`MISTRAL_API_KEY`** — required for `fill-sorry`. Free from [console.mistral.ai](https:\u002F\u002Fconsole.mistral.ai)\n- **`QEDGEN_VALIDATION_WORKSPACE`** — optional override for global Mathlib cache location\n\n## Error handling\n\n- **First `lake build` is slow**: Mathlib compilation takes 15-45 min on first run. Subsequent builds reuse the cache.\n- **`could not resolve 'HEAD' to a commit`**: Remove `.lake\u002Fpackages\u002Fmathlib` and run `lake update`.\n- **Rate limiting (429)**: Built-in exponential backoff in `fill-sorry`.\n",{"name":5,"description":7},"main","be3de0244dc1a57e323d8160787ebb40fb64930e","public\u002Fapi\u002Fskills\u002Fsolana-formal-verification","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Solizardking\u002Fskillhub-main --skill qedgen",{"tool":39,"command":40},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill qedgen",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill qedgen","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fsolana-formal-verification\u002FSKILL.md",true,[47,53,57,61,65],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"claude.md","REFERENCE","参考文档",6953,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fsolana-formal-verification\u002Fclaude.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"metadata.json",713,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fsolana-formal-verification\u002Fmetadata.json",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"package.json",1085,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fsolana-formal-verification\u002Fpackage.json",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"README.md",3750,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fsolana-formal-verification\u002FREADME.md",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"verification.json",1859,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fsolana-formal-verification\u002Fverification.json",[70,77,84,91,98,106],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]