Zulip Chat Archive
Stream: new members
Topic: variable not working
Iván Renison (Dec 21 2025 at 19:24):
Hi, do you know why is this not working? image.png
It seems that for some reason hn is not becoming an argument of hn', but I don't understand why
Iván Renison (Dec 21 2025 at 19:26):
Here the code:
import Mathlib
variable {n : ℕ} (hn : n ≠ 0)
lemma hn' : 1 < 2 * n + 1 := by
refine Nat.lt_add_of_pos_left ?_
refine Nat.succ_mul_pos 1 ?_
apply Nat.zero_lt_of_ne_zero hn
Ruben Van de Velde (Dec 21 2025 at 19:29):
include hn
Ruben Van de Velde (Dec 21 2025 at 19:29):
Theorems don't pick up Prop hypotheses from variable unless they're used in the statement
Kevin Buzzard (Dec 21 2025 at 19:29):
include hn in
lemma hn' : 1 < 2 * n + 1 := by
refine Nat.lt_add_of_pos_left ?_
refine Nat.succ_mul_pos 1 ?_
apply Nat.zero_lt_of_ne_zero hn
Iván Renison (Dec 21 2025 at 19:30):
Ruben Van de Velde said:
Theorems don't pick up
Prophypotheses fromvariableunless they're used in the statement
Ah, okay, thank you very much
Philippe Duchon (Dec 21 2025 at 21:19):
Ruben Van de Velde said:
Theorems don't pick up
Prophypotheses fromvariableunless they're used in the statement
Is this specific to Prop hypotheses? I thought it applied to all variable
Ruben Van de Velde (Dec 21 2025 at 22:16):
You may be right, yes. About the Prop ones I'm sure, at least :)
Last updated: Feb 28 2026 at 14:05 UTC