1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16import datasets.verina.verina_basic_103.task
namespace Submission
theorem solution : type_of% @UpdateElements_spec_satisfied := by
intro a h
simp only [UpdateElements_precond] at h
have h4 : 4 < a.size := by omega
have h7 : 7 < a.size := by omega
simp only [UpdateElements_postcond, UpdateElements]
refine ⟨by simp, ?_, ?_, ?_⟩
· simp [getElem!_pos, h4, h7, Array.getElem_setIfInBounds]
· simp [getElem!_pos, h4, h7, Array.getElem_setIfInBounds]
· intro i hi hi4 hi7
have e4 : (4 = i) = False := by simp; omega
have e7 : (7 = i) = False := by simp; omega
simp [getElem!_pos, hi, Array.getElem_setIfInBounds, e4, e7]
end Submission
Check it yourself
Project
verina
Commit
66b3ce5014edafb20cb26b87c681e7f31847249f
Lean
leanprover/lean4:v4.18.0
With Git and Elan installed, put the download in a fresh working directory and run this there. Use a disposable environment. Lean prints the axioms at the end. The checker allows propext, Classical.choice, and Quot.sound.
Download the receipt verifier and public key. Run python3 verify-proof.py certificate.json 0069fb22-a1de-4b5f-ba72-eaa86a52634f.lean proof-key.pem with OpenSSL 3.