Skip to content

Commit a233946

Browse files
committed
feat: add elaborators for IsImmersion(At) --- yet untested!
1 parent 5c75994 commit a233946

1 file changed

Lines changed: 34 additions & 12 deletions

File tree

Mathlib/Geometry/Manifold/Notation.lean

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@ All of these elaborators are scoped to the `Manifold` namespace.
2121
We provide compact notation for differentiability and continuous differentiability on manifolds,
2222
including inference of the model with corners.
2323
24-
| Notation | Elaborates to |
25-
|---------------------|-------------------------------------|
26-
| `MDiff f` | `MDifferentiable I J f` |
27-
| `MDiffAt f x` | `MDifferentiableAt I J f x` |
28-
| `MDiff[u] f` | `MDifferentiableOn I J f u` |
29-
| `MDiffAt[u] f x` | `MDifferentiableWithinAt I J f u x` |
30-
| `CMDiff n f` | `ContMDiff I J n f` |
31-
| `CMDiffAt n f x` | `ContMDiffAt I J n f x` |
32-
| `CMDiff[u] n f` | `ContMDiffOn I J n f u` |
33-
| `CMDiffAt[u] n f x` | `ContMDiffWithinAt I J n f u x` |
34-
| `mfderiv[u] f x` | `mfderivWithin I J f u x` |
35-
| `mfderiv% f x` | `mfderiv I J f x` |
24+
| Notation | Elaborates to |
25+
|--------------------------|-------------------------------------|
26+
| `MDiff f` | `MDifferentiable I J f` |
27+
| `MDiffAt f x` | `MDifferentiableAt I J f x` |
28+
| `MDiff[u] f` | `MDifferentiableOn I J f u` |
29+
| `MDiffAt[u] f x` | `MDifferentiableWithinAt I J f u x` |
30+
| `CMDiff n f` | `ContMDiff I J n f` |
31+
| `CMDiffAt n f x` | `ContMDiffAt I J n f x` |
32+
| `CMDiff[u] n f` | `ContMDiffOn I J n f u` |
33+
| `CMDiffAt[u] n f x` | `ContMDiffWithinAt I J n f u x` |
34+
| `mfderiv[u] f x` | `mfderivWithin I J f u x` |
35+
| `mfderiv% f x` | `mfderiv I J f x` |
36+
| `IsImmersionAt% F n f x` | `IsImmersionAt F I J n f x` |
37+
| `IsImmersion% F n f` | `IsImmersion F I J n f` |
3638
3739
In each of these cases, the models with corners are inferred from the domain and codomain of `f`.
3840
The search for models with corners uses the local context and is (almost) only based on expression
@@ -452,6 +454,26 @@ scoped elab:max "mfderiv%" ppSpace t:term:arg : term => do
452454
let (srcI, tgtI) ← findModels e none
453455
mkAppM ``mfderiv #[srcI, tgtI, e]
454456

457+
/-- `IsImmersionAt% F n f x` elaborates to `IsImmersionAt F I J n f x`,
458+
trying to determine `I` and `J` from the local context. -/
459+
scoped elab:max "IsImmersionAt%" ppSpace F:term:arg ppSpace nt:term:arg ppSpace
460+
f:term:arg ppSpace x:term:arg : term => do
461+
let eF ← Term.elabTerm F none
462+
let ne ← Term.elabTermEnsuringType nt q(WithTop ℕ∞)
463+
let ef ← ensureIsFunction <|← Term.elabTerm f none
464+
let ex ← Term.elabTerm x none
465+
let (srcI, tgtI) ← findModels e none
466+
mkAppM ``IsImmersionAt #[eF, srcI, tgtI, ne, e, ex]
467+
468+
/-- `IsImmersion% F n f` elaborates to `IsImmersion F I J n f`,
469+
trying to determine `I` and `J` from the local context. -/
470+
scoped elab:max "IsImmersion%" ppSpace F:term:arg ppSpace nt:term:arg ppSpace f:term:arg : term => do
471+
let eF ← Term.elabTerm F none
472+
let ne ← Term.elabTermEnsuringType nt q(WithTop ℕ∞)
473+
let ef ← ensureIsFunction <|← Term.elabTerm f none
474+
let (srcI, tgtI) ← findModels e none
475+
mkAppM ``IsImmersion #[eF, srcI, tgtI, ne, e]
476+
455477
end Manifold
456478

457479
section trace

0 commit comments

Comments
 (0)