> For the complete documentation index, see [llms.txt](https://erroldrummond.gitbook.io/halo2-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://erroldrummond.gitbook.io/halo2-tutorial/section-1/proving.md).

# Proving

Now that we have all the structure we need, how do we actually create a proof? In order to do this, we are going to make use of the provided `MockProver`. As you play around some more you will discover more in depth methods to do the proving in the `examples` folder.

Firstly we need to create an integer `k` and give it a value. Generally speaking `k` will represent the size of the circuit in that the number of rows in our columns does not exceed $$2^k$$ (so as long as `k` is large enough you're all good).

Next we need to initialise the values that are going to go into our circuit struct.&#x20;

<figure><img src="/files/ZcE4wHEVeukhG9TQqGog" alt=""><figcaption></figcaption></figure>

You will also see that we initialised a value for the expected result, `z`. Recall that in this tutorial circuit we check that the result created at the end is indeed what is expected (of course in most zk applications you probably don't want to know what result is expected, but here we are just exploring how the system works). Also recall that in order to enforce this check we ensure the computed result is the same as the value in the second row of the public inputs column, so guess where we have to put `z`!

![](/files/WpTWb9UeEUAVQmUwIT38)

Now we just have to run our prover using the provided function. We also run the prover again with a different public input column to ensure that it fails (this photo shows you the whole function so you can see everything together).

<figure><img src="/files/177h6RQEI9YmJSIrbhO1" alt=""><figcaption></figcaption></figure>

### Lab

Can you create a proof of the zk circuit you came up with and check it? Does it also fail under some expected circumstances?


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://erroldrummond.gitbook.io/halo2-tutorial/section-1/proving.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
