leanprover / lean4

Lean 4 programming language and theorem prover
https://lean-lang.org
Apache License 2.0
4.71k stars 424 forks source link

`@[local ext]` should not generate a global `ext_iff` lemma #5978

Open YaelDillies opened 1 week ago

YaelDillies commented 1 week ago

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Tagging a structure Foo with @[local ext] generates global Foo.ext and Foo.ext_iff. It seems better to generate them as private lemmas instead.

Context

Zulip

Steps to Reproduce

In file MWE:

@[local ext]
structure Foo where
  toNat := Nat

In another file,

import MWE

#check Foo.ext
#check Foo.ext_iff

Expected behavior: The #checks fail

Actual behavior: They succeed

Versions

4.14.0-rc2 Ubuntu

Impact

Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.

adomani commented 1 week ago

3643 seems related and closed.