Skip to content

Commit faf1b24

Browse files
committed
Clarify failing test, and document the right spelling with TangentBundle
1 parent 41046cd commit faf1b24

1 file changed

Lines changed: 36 additions & 2 deletions

File tree

MathlibTest/DifferentialGeometry/Notation.lean

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ info: MDifferentiableAt 𝓘(𝕜, E) (𝓘(𝕜, E).prod 𝓘(𝕜, E')) fun x
326326
#guard_msgs in
327327
#check MDiffAt (T% σ')
328328

329+
section
330+
331+
variable [IsManifold I 2 M]
332+
333+
variable {h : Bundle.TotalSpace F (TangentSpace I : M → Type _) → F} {h' : TangentBundle I M → F}
334+
329335
-- Test the inference of a model with corners on a trivial bundle over the tangent space of a
330336
-- manifold. (This code path is not covered by the other tests, hence should be kept.)
331337
-- Stating smoothness this way does not make sense, but finding a model with corners should work.
@@ -353,11 +359,39 @@ trace: [Elab.DiffGeo.MDiff] Finding a model for: TotalSpace F (TangentSpace I)
353359
[Elab.DiffGeo.MDiff] Found model: 𝓘(𝕜, F)
354360
-/
355361
#guard_msgs in
356-
variable {h : Bundle.TotalSpace F (TangentSpace I : M → Type _) → F} in
357362
set_option trace.Elab.DiffGeo true in
358363
#check MDiff h
359364

360-
-- TODO: add a test with the correct spelling of this!
365+
-- The reason this test fails is that Bundle.TotalSpace F (TangentSpace I : M → Type _) is not
366+
-- the way to state smoothness.
367+
/--
368+
error: failed to synthesize
369+
TopologicalSpace (TotalSpace F (TangentSpace I))
370+
371+
Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.
372+
-/
373+
#guard_msgs in
374+
#synth IsManifold I.tangent 1 (Bundle.TotalSpace F (TangentSpace I : M → Type _))
375+
376+
-- The correct way is this.
377+
/-- info: TotalSpace.isManifold E (TangentSpace I) -/
378+
#guard_msgs in
379+
#synth IsManifold I.tangent 1 (TangentBundle I M)
380+
381+
/-- info: MDifferentiable I.tangent 𝓘(𝕜, F) h' : Prop -/
382+
#guard_msgs in
383+
#check MDifferentiable I.tangent 𝓘(𝕜, F) h'
384+
385+
/-- info: MDifferentiable (I.prod 𝓘(𝕜, E)) 𝓘(𝕜, F) h' : Prop -/
386+
#guard_msgs in
387+
#check MDifferentiable (I.prod (𝓘(𝕜, E))) 𝓘(𝕜, F) h'
388+
389+
-- TODO: implement special handling for the tangent bundle
390+
/-- error: Could not find models with corners for TangentBundle I M -/
391+
#guard_msgs in
392+
#check MDiff h'
393+
394+
end
361395

362396
/-! Error messages in case of a forgotten `T%`. -/
363397
section

0 commit comments

Comments
 (0)