Skip to content

Commit 008d4c7

Browse files
committed
chore: export bodies of WellFounded theorems
1 parent 4944e94 commit 008d4c7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Lean/AddDecl.lean

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ private def isSimpleRflProof (proof : Expr) : Bool :=
6262
else
6363
proof.isAppOfArity ``rfl 2
6464

65+
private def looksLikeRelevantTheoremProofType (type : Expr) : Bool :=
66+
if let .forallE _ _ type _ := type then
67+
looksLikeRelevantTheoremProofType type
68+
else
69+
type.isAppOfArity ``WellFounded 2
70+
6571
def addDecl (decl : Declaration) : CoreM Unit := do
6672
-- register namespaces for newly added constants; this used to be done by the kernel itself
6773
-- but that is incompatible with moving it to a separate task
@@ -78,7 +84,9 @@ def addDecl (decl : Declaration) : CoreM Unit := do
7884
let mut exportedKind? := none
7985
let (name, info, kind) ← match decl with
8086
| .thmDecl thm =>
81-
if (← getEnv).header.isModule && !isSimpleRflProof thm.value then
87+
if (← getEnv).header.isModule && !isSimpleRflProof thm.value &&
88+
-- TODO: this is horrible...
89+
!looksLikeRelevantTheoremProofType thm.type then
8290
exportedInfo? := some <| .axiomInfo { thm with isUnsafe := false }
8391
exportedKind? := some .axiom
8492
pure (thm.name, .thmInfo thm, .thm)

0 commit comments

Comments
 (0)