Zulip Chat Archive

Stream: mathlib4

Topic: Variables not imported


María Inés de Frutos Fernández (Sep 13 2024 at 10:56):

After updating Mathlib in our project with @Antoine Chambert-Loir , we are having issues with some variables that are used in the proof but not in the statement not being imported. Antoine is having the same problem in his main Mathlib branch, which he just updated. Here is a mwe:

import Mathlib.Algebra.Order.Ring.Nat

variable {n : } (hn : 1 < n)

theorem test :  0 < n := lt_trans zero_lt_one hn -- unknown identifier 'hn'

Ruben Van de Velde (Sep 13 2024 at 10:59):

Yep, use include hn in before the theorem, or don't use variable for it

Antoine Chambert-Loir (Sep 13 2024 at 10:59):

Is it a new rule?

Sebastian Ullrich (Sep 13 2024 at 11:00):

https://github.com/leanprover/lean4/releases/tag/v4.11.0

Antoine Chambert-Loir (Sep 13 2024 at 11:01):

Thanks!

Antoine Chambert-Loir (Sep 13 2024 at 11:47):

From a stylistic point of view, what is preferred for mathlib, using variable… and include… in or adding the variable each time?

Matthew Ballard (Sep 13 2024 at 11:52):

The latter.


Last updated: May 02 2025 at 03:31 UTC