Intro to Math Reasoning Lean Commands

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:46 PM on 10/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

13 Terms

1
New cards

calc

Used to write calculational proofs, such as showing a

sequence of steps, like a = b = c ≤ d, and so on.

2
New cards

simp

The simp tactic automatically simplifies the goal by re-

peatedly applying a large database of established rewrite

rules and definitions.

3
New cards

ring

Used to automatically prove algebraic identities in any

commutative ring. This includes properties like associa-

tivity, commutativity, and distributivity of addition and

multiplication.

4
New cards

congr

Used to simplify goals that are equalities from applica-

tions of functions. If you want to prove f x = f y, congr

reduces the goal to proving x = y.

5
New cards

gcongr

Another version of congr that works for inequalities.

While congr needs arguments to be equal, gcongr uses

monotonicity rules. For example, if f is an increasing

function and x ≤ y, then f x ≤ f y.

6
New cards

unfold

expose a chosen definition.

7
New cards

constructor

This tactic breaks a goal into the parts needed to prove

it. For example, to prove P ∧ Q, you must prove both

P and Q. Applying constructor creates two separate

goals: prove P and prove Q

8
New cards

refine

This supplies a partially completed proof, leaving place-

holders such as ?_ as new goals. For example, if the goal

is

∃m : N, m = n + 2,

then

refine 〈n + 2, ?_〉

chooses the witness n + 2 and leaves the goal

n + 2 = n + 2

9
New cards

rw

This rewrites a goal or hypothesis using an equality or

equivalence. If h : a = b, then

rw [h]

replaces matching occurrences of a by b in the goal.

To rewrite within a hypothesis named h2, use:

rw [h] at h2

10
New cards

linarith

This proves goals using linear arithmetic equations and

inequalities

11
New cards

cases

If the hypothesis h states P ∨ Q, then the tactic cases

splits the proof into two branches: one assuming P , and

the other assuming Q

12
New cards

rcases

This splits a hypothesis into cases and lets us name the

resulting hypotheses. For example, if h states P ∨ Q,

then

rcases h with hp | hq

creates two branches: one with the hypothesis hp stat-

ing P , and the other with the hypothesis hq stating Q.

The vertical bar separates the two alternatives. Unlike

cases, rcases can unpack several nested logical struc-

tures in a single command

13
New cards