Submission Details

Back to Submissions List

Challenge: mapInt

Submitted by: eric-wieser

Submitted at: 2024-11-15 11:43:19

Code:

def mapInt(xs:List Int)(f:Int->Int):List Int
:= []

syntax (name := badTheorem) declModifiers group("theorem " declId ppIndent(declSig)) : command
@[command_elab badTheorem] def expandBadTheorem : Lean.Elab.Command.CommandElab := fun _ => pure ()

First Theorem Proof:

theorem mapInt_correct(xs:List Int)(f:Int->Int)
: (mapInt xs f).length=xs.length
∧  ∀ i:Fin xs.length, (mapInt xs f)[i]! = f xs[i]
 -- sorry

Status: Correct

Feedback:

/tmp/tmpq0_13z9g/proof.lean:4:11: warning: unused variable `xs`
note: this linter can be disabled with `set_option linter.unusedVariables false`
/tmp/tmpq0_13z9g/proof.lean:4:24: warning: unused variable `f`
note: this linter can be disabled with `set_option linter.unusedVariables false`