Submission Details

Back to Submissions List

Challenge: solveAdd

Submitted by: m-ow

Submitted at: 2026-01-07 15:02:51

Code:

import Init.Data.Int

def solveAdd (a b:Int): Int
def solveAdd (a b : Int) : Int := b - a

First Theorem Proof:

theorem solveAdd_correct (a b: Int): a + (solveAdd a b) =b 
:= by
  rw [solveAdd]
  rw [Int.add_comm]
  exact Int.sub_add_cancel b a

Status: Incorrect

Feedback:

Compilation error for /root/CodeProofTheArena/temp/tmprqmvkmp8/proof.lean:
/root/CodeProofTheArena/temp/tmprqmvkmp8/proof.lean:6:27: error: unexpected token 'def'; expected ':=', 'where' or '|'
/root/CodeProofTheArena/temp/tmprqmvkmp8/proof.lean:7:4: error: 'solveAdd' has already been declared
/root/CodeProofTheArena/temp/tmprqmvkmp8/proof.lean:12:6: warning: declaration uses 'sorry'
/root/CodeProofTheArena/temp/tmprqmvkmp8/proof.lean:10:8: warning: declaration uses 'sorry'