import { VerityHero } from '../components/VerityHero'

<VerityHero />

## Formal verification in Lean: a small example

Here is what checking a Solidity function in Lean looks like. The function guards its input with `require(value > 7)`, so it should reject 7 and accept 8. Import `checked` from the repository's runnable fixture, [Require.sol](https://github.com/lfglabs-dev/verity/blob/main/Contracts/SolidityImportSmoke/Require.sol), and state both expectations in Lean:

```lean
example : callChecked 7 = none := by decide   -- the guard rejects 7
example : callChecked 8 = some 8 := by decide -- 8 returns 8
```

Lean rejects the file unless both hold. **This checks exactly two inputs. It is not a theorem about all values**, and a test would catch the same bug. Proofs that quantify over every input are the part testing cannot give you; [Guarantees & limits](/guarantees) shows what each kind of claim covers. The exact command sequence — pinned `solc`, the import directive, the report, the proof — is the [Import Solidity quickstart](/solidity-import). The same fixture is checked in as [Require.lean](https://github.com/lfglabs-dev/verity/blob/main/Contracts/SolidityImportSmoke/Require.lean).

## What you're trusting

A verification result rests on a short, explicit list. From most to least likely to be the problem:

1. **Your specification** — the main risk. Verity proves the code matches what you wrote, not that what you wrote is right.
2. **Verity's own pieces** — depends on your path:
   - **Import Solidity: low risk.** The importer translates your Solidity into a Lean model. It can have bugs or gaps, but they stay local to the construct involved and don't undermine the whole verification. Your deployed bytecode is your normal `solc` build.
   - **Write in Verity: moderate risk.** Verity's compiler is machine-checked for the supported fragment, with explicit assumptions. Start from `Compiler/Proofs/IRGeneration/Contract.lean` (generic whole-contract `CompilationModel -> IR` theorem for the current supported fragment).
3. **`solc` and the EVM** — very low risk. Years of production use.
4. **Lean** — very low risk. Its small kernel rechecks every proof. Bugs have been found before, but they're rare, and rarer still for one to affect a real proof.

Importing, proving and certifying compiled code are three different claims. [Guarantees & limits](/guarantees) shows what each one covers.

## Which path fits?

- **Existing Solidity you must not rewrite** — [import a function](/solidity-import) and prove a property of the imported model.
- **A new contract** — [write it in Verity](/first-contract), prove it, compile to EVM artifacts.
- **An existing contract you want as a native Verity implementation** — that is a [manual port](/guides/solidity-to-verity): a separate rewrite with its own proofs, not an automatic import.

Agents and automation: raw Markdown on every page (add `.md` to any URL), the [agent index](/llms.txt) and [agent access endpoints](/agents). Research paper: [verity.pdf](https://lfglabs.dev/papers/verity.pdf).