Zulip Chat Archive
Stream: new members
Topic: Induction on sum of parameters
Bernardo Anibal Subercaseaux Roa (Mar 25 2024 at 15:56):
Hi,
very basic question but, if I want to prove theorem F (m n : Nat): P m n
by induction on m+n
, is there a tactic or trick that allows this without changing the theorem statement or creating an auxiliary lemma? I can imagine how reformulating to theorem F (m n N: Nat) (h: m+n = N): P m n
and then doing induction on N
would work. But can this be avoided?
Eric Wieser (Mar 25 2024 at 16:03):
induction h : m + n
?
Bernardo Anibal Subercaseaux Roa (Mar 25 2024 at 16:07):
I tried
lemma euclid_algo_symmetric (m n : Nat) : euclid_algo m n = euclid_algo n m := by
induction h : m + n
but get unknown identifier 'h'
and also
tactic 'induction' failed, major premise type is not an inductive type
?m.57616
mn: ℕ
x✝: ?m.57616
⊢ euclid_algo m n = euclid_algo n m
Am I doing something wrong?
Eric Wieser (Mar 25 2024 at 16:09):
Maybe this only works with induction'
Bernardo Anibal Subercaseaux Roa (Mar 25 2024 at 16:13):
that did work! Thanks! is there a simple explanation of the difference between induction
and induction'
? or some resource I should check?
Kevin Buzzard (Mar 25 2024 at 18:57):
induction'
is on the way out, is the main difference. Although maybe it just got a reprieve :-)
Mario Carneiro (Mar 25 2024 at 23:15):
you can do generalize e : m + n = mn; induction mn generalizing m n
Trevor Hyde (Apr 21 2025 at 18:47):
(deleted)
Last updated: May 02 2025 at 03:31 UTC