File tree Expand file tree Collapse file tree
MathlibTest/DifferentialGeometry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,32 @@ variable (F : Type*) [NormedAddCommGroup F] [NormedSpace 𝕜 F]
3939 [FiberBundle F V] [VectorBundle 𝕜 F V]
4040 -- `V` vector bundle
4141
42+ section ErrorMetavars -- Test for error messages when the goal still has metavariables.
43+
44+ -- The argument k is deliberately implicit; it should be explicit in a mathlib definition.
45+ def proj : TangentBundle 𝓘(𝕜, 𝕜) 𝕜 → 𝕜 := fun x ↦ x.2
46+
47+ open ContDiff
48+
49+ -- TODO: the error message could be more helpful, by saying "the goal has metavariables; maybe there is an implicit argument missing"
50+ /--
51+ error: Could not find a model with corners for `TangentBundle 𝓘(?_, ?_) ?_`.
52+
53+ Hint: failures to find a model with corners can be debugged with the command `set_option trace.Elab.DiffGeo.MDiff true`.
54+ -/
55+ #guard_msgs in
56+ set_option pp.mvars.anonymous false in
57+ lemma contMDiff_proj : CMDiff ∞ (proj) := by
58+ unfold proj
59+ exact contMDiff_snd_tangentBundle_modelSpace 𝕜 𝓘(𝕜)
60+
61+ -- Adding the implicit argument k works.
62+ example : CMDiff ∞ (proj (𝕜 := 𝕜)) := by
63+ unfold proj
64+ exact contMDiff_snd_tangentBundle_modelSpace 𝕜 𝓘(𝕜)
65+
66+ end ErrorMetavars
67+
4268/-! Additional tests for the elaborators for `MDifferentiable{WithinAt,At,On}`. -/
4369section differentiability
4470
You can’t perform that action at this time.
0 commit comments