Skip to content

Commit b9fd8df

Browse files
Merge remote-tracking branch 'mathnetwork/develop'
2 parents 8dcec1b + 2fc2233 commit b9fd8df

42 files changed

Lines changed: 5046 additions & 500 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

OpenGALib/Algebraic/Auxiliary/Fin.lean

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,9 @@ theorem finAddFlip_finSumFinEquiv {m n : ℕ} (a : Fin m ⊕ Fin n) :
3333
/-- `Fin (m + n) ≃ Fin (n + m)`. -/
3434
def finAddCongr : Fin (m + n) ≃ Fin (n + m) := finCongr (add_comm m n)
3535

36-
@[simp]
37-
lemma finAddCongr_finAddCongr (i : Fin (m + n)) :
38-
finAddCongr (finAddCongr i) = i :=
39-
rfl
40-
41-
@[simp]
42-
lemma finAddCongr_symm_finAddCongr_symm (i : Fin (m + n)) :
43-
finAddCongr.symm (finAddCongr.symm i) = i :=
44-
rfl
45-
46-
/-- `Fin m ⊕ Fin n ≃ Fin n ⊕ Fin m` via `Sum.swap`. -/
47-
def finSumCongr : Fin m ⊕ Fin n ≃ Fin n ⊕ Fin m where
48-
toFun x := x.swap
49-
invFun x := x.swap
50-
left_inv := Sum.swap_swap
51-
right_inv := Sum.swap_swap
36+
/-- `Fin m ⊕ Fin n ≃ Fin n ⊕ Fin m` via `Sum.swap`.
37+
Thin wrapper over Mathlib `Equiv.sumComm`. -/
38+
def finSumCongr : Fin m ⊕ Fin n ≃ Fin n ⊕ Fin m := Equiv.sumComm (Fin m) (Fin n)
5239

5340
@[simp]
5441
lemma finSumCongr_symm_inl_inr (x : Fin m) :

OpenGALib/Algebraic/Auxiliary/Perm.lean

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,6 @@ open Fin
1515

1616
variable {m n p k : ℕ}
1717

18-
@[simps!]
19-
def addAssocPerm :
20-
Equiv.Perm ((Fin m ⊕ Fin n) ⊕ Fin p) ≃ Equiv.Perm (Fin m ⊕ Fin n ⊕ Fin p) :=
21-
Equiv.permCongr (Equiv.sumAssoc (Fin m) (Fin n) (Fin p))
22-
23-
@[simp]
24-
lemma addAssocPerm_symm_addAssocPerm (σ₁ : Equiv.Perm ((Fin m ⊕ Fin n) ⊕ Fin p)) :
25-
addAssocPerm.symm (addAssocPerm σ₁) = σ₁ :=
26-
Equiv.symm_apply_apply addAssocPerm σ₁
27-
28-
@[simp]
29-
lemma sign_addAssocPerm (σ₁ : Equiv.Perm ((Fin m ⊕ Fin n) ⊕ Fin p)) :
30-
Equiv.Perm.sign (addAssocPerm σ₁) = Equiv.Perm.sign σ₁ := by
31-
simp only [addAssocPerm, Equiv.Perm.sign_permCongr]
32-
33-
def addCongrPerm : Equiv.Perm (Fin (m + n)) ≃ Equiv.Perm (Fin (n + m)) :=
34-
Equiv.permCongr finAddCongr
35-
3618
def sumCongrPerm : Equiv.Perm (Fin m ⊕ Fin n) ≃ Equiv.Perm (Fin n ⊕ Fin m) :=
3719
Equiv.permCongr finSumCongr
3820

OpenGALib/Algebraic/Auxiliary/ShuffleSplit.lean

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,25 +144,13 @@ theorem removeNone_sign {α : Type*} [DecidableEq α] [Fintype α]
144144
conv_rhs => rw [← optionCongr_removeNone_of_fix_none σ h]
145145
exact (Equiv.optionCongr_sign _).symm
146146

147-
/-- `Equiv.permCongr` preserves sign. -/
148-
theorem permCongr_sign {α β : Type*} [DecidableEq α] [DecidableEq β]
149-
[Fintype α] [Fintype β]
150-
(e : α ≃ β) (σ : Equiv.Perm α) :
151-
Equiv.Perm.sign (Equiv.permCongr e σ) = Equiv.Perm.sign σ :=
152-
Equiv.Perm.sign_permCongr _ _
153-
154-
/-- `Equiv.permCongr` commutes with `Equiv.Perm` inverse-multiply. -/
147+
/-- `Equiv.permCongr` commutes with `Equiv.Perm` inverse-multiply.
148+
Thin wrapper over the `MulEquiv` `Equiv.permCongrHom`. -/
155149
theorem permCongr_inv_mul {α β : Type*}
156150
(e : α ≃ β) (σ₁ σ₂ : Equiv.Perm α) :
157151
Equiv.permCongr e (σ₁⁻¹ * σ₂) =
158152
(Equiv.permCongr e σ₁)⁻¹ * Equiv.permCongr e σ₂ := by
159-
have h_inv : (Equiv.permCongr e σ₁ : Equiv.Perm _)⁻¹ =
160-
Equiv.permCongr e σ₁⁻¹ := by
161-
ext y
162-
show (Equiv.permCongr e σ₁).symm y = e (σ₁⁻¹ (e.symm y))
163-
simp [Equiv.permCongr_def, Equiv.Perm.inv_def]
164-
ext x
165-
simp only [Equiv.Perm.coe_mul, Function.comp_apply, Equiv.permCongr_apply,
166-
h_inv, Equiv.symm_apply_apply]
153+
have := map_mul e.permCongrHom σ₁⁻¹ σ₂
154+
simpa only [Equiv.permCongrHom_coe, map_inv] using this
167155

168156
end ShuffleSplit

OpenGALib/Algebraic/BilinearForm/Basic.lean

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Mathlib.LinearAlgebra.BilinearForm.Basic
2+
import Mathlib.LinearAlgebra.BilinearForm.Properties
23
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
34
import Mathlib.Algebra.Order.Ring.Defs
45

@@ -18,20 +19,21 @@ positive-definite forms in optimisation, matrix calculus.
1819

1920
namespace BilinearForm
2021

21-
/-- A bilinear form on `V` over field `𝕜`: a linear map
22-
`V →ₗ[𝕜] V →ₗ[𝕜] 𝕜`. -/
23-
abbrev Form (𝕜 : Type*) [Field 𝕜]
24-
(V : Type*) [AddCommGroup V] [Module 𝕜 V] :=
25-
V →ₗ[𝕜] V →ₗ[𝕜] 𝕜
22+
/-- A bilinear form on `V` over `𝕜`: a linear map
23+
`V →ₗ[𝕜] V →ₗ[𝕜] 𝕜`. Definitionally Mathlib's `LinearMap.BilinForm`. -/
24+
abbrev Form (𝕜 : Type*) [CommSemiring 𝕜]
25+
(V : Type*) [AddCommMonoid V] [Module 𝕜 V] :=
26+
LinearMap.BilinForm 𝕜 V
2627

2728
section Algebra
2829

2930
variable {𝕜 : Type*} [Field 𝕜]
3031
{V : Type*} [AddCommGroup V] [Module 𝕜 V]
3132

32-
/-- The bilinear form is symmetric. -/
33-
def IsSymm (B : Form 𝕜 V) : Prop :=
34-
∀ v w, B v w = B w v
33+
/-- The bilinear form is symmetric. Alias of Mathlib's
34+
`LinearMap.BilinForm.IsSymm`. -/
35+
abbrev IsSymm (B : Form 𝕜 V) : Prop :=
36+
LinearMap.BilinForm.IsSymm B
3537

3638
/-- The **inner product** $\langle v, w \rangle_B$ via a bilinear form. -/
3739
def inner (B : Form 𝕜 V) (v w : V) : 𝕜 :=
@@ -50,7 +52,7 @@ generic version of the framework's `metricInner_*` lemmas. -/
5052
/-- **Symmetry** (when the form is symmetric). -/
5153
theorem inner_comm {B : Form 𝕜 V} (hB : IsSymm B) (v w : V) :
5254
inner B v w = inner B w v :=
53-
hB v w
55+
hB.eq v w
5456

5557
/-- **Additivity in left argument**. -/
5658
theorem inner_add_left (B : Form 𝕜 V) (v₁ v₂ w : V) :
@@ -100,13 +102,13 @@ theorem inner_neg_right (B : Form 𝕜 V) (v w : V) :
100102
@[simp]
101103
theorem inner_sub_left (B : Form 𝕜 V) (v₁ v₂ w : V) :
102104
inner B (v₁ - v₂) w = inner B v₁ w - inner B v₂ w := by
103-
rw [sub_eq_add_neg, inner_add_left, inner_neg_left, sub_eq_add_neg]
105+
simp [inner_def, map_sub, LinearMap.sub_apply]
104106

105107
/-- **Subtraction in right argument**. -/
106108
@[simp]
107109
theorem inner_sub_right (B : Form 𝕜 V) (v w₁ w₂ : V) :
108110
inner B v (w₁ - w₂) = inner B v w₁ - inner B v w₂ := by
109-
rw [sub_eq_add_neg, inner_add_right, inner_neg_right, sub_eq_add_neg]
111+
simp [inner_def, map_sub]
110112

111113
end Algebra
112114

OpenGALib/Algebraic/BilinearForm/Riesz.lean

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import OpenGALib.Algebraic.BilinearForm.Basic
2-
import Mathlib.LinearAlgebra.Dual.Lemmas
3-
import Mathlib.LinearAlgebra.FiniteDimensional.Defs
2+
import Mathlib.LinearAlgebra.BilinearForm.Properties
43

54
/-!
65
# Riesz extraction — algebraic core
@@ -45,6 +44,19 @@ omit [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] in
4544
theorem toDual_apply (B : Form 𝕜 V) (v w : V) :
4645
toDual B v w = inner B v w := rfl
4746

47+
omit [IsStrictOrderedRing 𝕜] in
48+
/-- **Positive-definite ⇒ nondegenerate** (`LinearMap.BilinForm.Nondegenerate`):
49+
a positive-definite bilinear form is nondegenerate, the hypothesis Mathlib's
50+
`LinearMap.BilinForm.toDual` requires. Both separating directions follow from
51+
`B v v > 0` for `v ≠ 0` (no symmetry needed). -/
52+
theorem IsPosDef.nondegenerate {B : Form 𝕜 V} (hB : IsPosDef B) :
53+
(B : LinearMap.BilinForm 𝕜 V).Nondegenerate := by
54+
refine ⟨fun x hx => ?_, fun y hy => ?_⟩
55+
· by_contra hne
56+
exact ne_of_gt (inner_self_pos hB x hne) (hx x)
57+
· by_contra hne
58+
exact ne_of_gt (inner_self_pos hB y hne) (hy y)
59+
4860
/-- **Injectivity of forward Riesz**: from positive-definiteness. -/
4961
theorem toDual_injective {B : Form 𝕜 V} (hB : IsPosDef B) :
5062
Function.Injective (toDual B) := by
@@ -70,33 +82,23 @@ theorem inner_eq_iff_eq {B : Form 𝕜 V} (hB : IsPosDef B) (v w : V) :
7082

7183
variable [FiniteDimensional 𝕜 V]
7284

73-
/-- **Bijectivity of forward Riesz**: injective + same finrank ⇒ bijective. -/
74-
theorem toDual_bijective {B : Form 𝕜 V} (hB : IsPosDef B) :
75-
Function.Bijective (toDual B) := by
76-
refine ⟨toDual_injective hB, ?_⟩
77-
have h_finrank : Module.finrank 𝕜 (V →ₗ[𝕜] 𝕜) = Module.finrank 𝕜 V :=
78-
Subspace.dual_finrank_eq
79-
exact (LinearMap.injective_iff_surjective_of_finrank_eq_finrank
80-
(f := toDual B) h_finrank.symm).mp (toDual_injective hB)
81-
82-
/-- The Riesz isomorphism as a `LinearEquiv`. -/
85+
/-- The Riesz isomorphism as a `LinearEquiv`, delegating to Mathlib's
86+
`LinearMap.BilinForm.toDual` for the nondegenerate form `B`. -/
8387
noncomputable def toDualEquiv {B : Form 𝕜 V} (hB : IsPosDef B) :
8488
V ≃ₗ[𝕜] (V →ₗ[𝕜] 𝕜) :=
85-
LinearEquiv.ofBijective (toDual B) (toDual_bijective hB)
89+
LinearMap.BilinForm.toDual B hB.nondegenerate
8690

8791
/-- **Inverse Riesz**: linear functional → vector via bilinear form. -/
8892
noncomputable def riesz {B : Form 𝕜 V} (hB : IsPosDef B)
8993
(φ : V →ₗ[𝕜] 𝕜) : V :=
9094
(toDualEquiv hB).symm φ
9195

96+
omit [IsStrictOrderedRing 𝕜] in
9297
/-- **Riesz defining property**: `inner B (riesz hB φ) v = φ v`. -/
9398
theorem riesz_inner {B : Form 𝕜 V} (hB : IsPosDef B)
9499
(φ : V →ₗ[𝕜] 𝕜) (v : V) :
95-
inner B (riesz hB φ) v = φ v := by
96-
show toDual B (riesz hB φ) v = φ v
97-
have heq : toDual B ((toDualEquiv hB).symm φ) = φ :=
98-
(toDualEquiv hB).apply_symm_apply φ
99-
exact congrArg (fun (f : V →ₗ[𝕜] 𝕜) => f v) heq
100+
inner B (riesz hB φ) v = φ v :=
101+
LinearMap.BilinForm.apply_toDual_symm_apply (hB := hB.nondegenerate) φ v
100102

101103
/-- **Riesz uniqueness**: if `v` represents `φ`, then `v = riesz hB φ`. -/
102104
theorem riesz_unique {B : Form 𝕜 V} (hB : IsPosDef B) (v : V)
@@ -105,10 +107,7 @@ theorem riesz_unique {B : Form 𝕜 V} (hB : IsPosDef B) (v : V)
105107
apply toDual_injective hB
106108
ext w
107109
rw [toDual_apply, h w]
108-
show φ w = toDual B (riesz hB φ) w
109-
have heq : toDual B ((toDualEquiv hB).symm φ) = φ :=
110-
(toDualEquiv hB).apply_symm_apply φ
111-
exact congrArg (fun (f : V →ₗ[𝕜] 𝕜) => f w) heq.symm
110+
exact (riesz_inner hB φ w).symm
112111

113112
end Riesz
114113

OpenGALib/Algebraic/Instances/RatVector.lean

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import OpenGALib.Algebraic.BilinearForm.Basic
2+
import Mathlib.Algebra.BigOperators.Fin
23
import Mathlib.Data.Rat.Defs
34
import Mathlib.Data.Fintype.BigOperators
45
import Mathlib.Data.Fin.VecNotation
56
import Mathlib.LinearAlgebra.Matrix.DotProduct
7+
import Mathlib.Algebra.Order.Ring.Rat
8+
import Mathlib.Tactic.NormNum.Ineq
69

710
/-!
811
# Concrete instance: rational vectors
912
1013
A fully `#eval`-able `BilinearForm` on `Fin n → ℚ`. `#eval inner`
11-
produces a `Rat`; `native_decide` closes concrete equalities like
12-
`inner ![1,2,3] ![4,5,6] = 32`. The same operations on the abstract
14+
produces a `Rat`; concrete equalities like
15+
`inner ![1,2,3] ![4,5,6] = 32` are closed by kernel-checked
16+
`simp`/`norm_num` proofs. The same operations on the abstract
1317
`Form ℚ V` API give the same numerical results, demonstrating
1418
algebraic-core ↔ concrete-instance consistency.
1519
@@ -78,24 +82,32 @@ open BilinearForm RatVector
7882

7983
#eval inner (stdForm 3) ![1, 0, 0] ![1, 0, 0] -- 1
8084

81-
/-! ## `native_decide`-closed equalities — proof by execution
85+
/-! ## Kernel-checked equalities — proof by computation
8286
83-
The same equations that `#eval` produces are closed as theorems via
84-
`native_decide`, which compiles the term to native code and uses the
85-
result as a proof. -/
87+
The same equations that `#eval` produces are closed as theorems by
88+
unfolding `inner` to the concrete sum (`stdForm_apply`,
89+
`Fin.sum_univ_two`/`Fin.sum_univ_three`) and discharging the rational
90+
arithmetic with `norm_num`. Each proof is checked by the kernel — no
91+
native code or compiler trust. -/
8692

87-
example : inner (stdForm 3) ![1, 2, 3] ![4, 5, 6] = 32 := by native_decide
93+
example : inner (stdForm 3) ![1, 2, 3] ![4, 5, 6] = 32 := by
94+
simp [stdForm_apply, Fin.sum_univ_three]; norm_num
8895

89-
example : inner (stdForm 2) ![3, 4] ![3, 4] = 25 := by native_decide
96+
example : inner (stdForm 2) ![3, 4] ![3, 4] = 25 := by
97+
simp [stdForm_apply, Fin.sum_univ_two]; norm_num
9098

91-
example : inner (stdForm 3) ![1, 0, 0] ![0, 1, 0] = 0 := by native_decide
99+
example : inner (stdForm 3) ![1, 0, 0] ![0, 1, 0] = 0 := by
100+
simp [stdForm_apply, Fin.sum_univ_three]
92101

93-
example : inner (stdForm 3) ![1, 0, 0] ![1, 0, 0] = 1 := by native_decide
102+
example : inner (stdForm 3) ![1, 0, 0] ![1, 0, 0] = 1 := by
103+
simp [stdForm_apply, Fin.sum_univ_three]
94104

95-
/-- Cauchy–Schwarz on a concrete pair, verified by execution. -/
105+
/-- Cauchy–Schwarz on a concrete pair, kernel-checked. -/
96106
example :
97107
let v : Fin 3 → ℚ := ![1, 2, 3]
98108
let w : Fin 3 → ℚ := ![4, 5, 6]
99109
(inner (stdForm 3) v w) ^ 2
100110
≤ inner (stdForm 3) v v * inner (stdForm 3) w w := by
101-
native_decide
111+
norm_num [inner_def, stdForm_apply, Fin.sum_univ_three,
112+
Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons,
113+
Matrix.cons_val_two, Matrix.tail_cons]

OpenGALib/Manifold.lean

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1+
import OpenGALib.Manifold.Charts.ChartedSpaceCore
12
import OpenGALib.Manifold.Charts.CoordinateBall
23
import OpenGALib.Manifold.Charts.PrecompactBasis
4+
import OpenGALib.Manifold.Covering.LiftedStructure
5+
import OpenGALib.Manifold.Covering.LocalSection
6+
import OpenGALib.Manifold.Covering.ProperLocalDiffeomorph
7+
import OpenGALib.Manifold.Covering.SmoothCoveringMap
8+
import OpenGALib.Manifold.Instances.Pi
9+
import OpenGALib.Manifold.Instances.RealProjectiveSpace
10+
import OpenGALib.Manifold.Map.LocalDiffeomorph
11+
import OpenGALib.Manifold.Map.TopologicalImmersionSubmersion
12+
import OpenGALib.Manifold.Submanifold.Embedded
13+
import OpenGALib.Manifold.Submanifold.SliceCharts
14+
import OpenGALib.Manifold.Submanifold.TangentSpace
15+
import OpenGALib.Manifold.Cutoff.Exhaustion
16+
import OpenGALib.Manifold.Tangent.CoordinateComponents
17+
import OpenGALib.Manifold.Tangent.CurveVelocity
18+
import OpenGALib.Manifold.Tangent.MFDeriv
319

420
/-!
521
# Manifold
622
723
Manifold-foundations domain: chart-level and atlas-level structure on
824
topological and smooth manifolds, stated directly on Mathlib's
925
`ChartedSpace` / `IsManifold` API. Sits below `Riemannian` in the library
10-
layering. Currently provides coordinate-ball predicates for charts.
26+
layering. Provides coordinate-ball predicates for charts, the inverse
27+
function theorem with local-diffeomorphism characterizations for maps, the
28+
point-set immersion/submersion conditions underlying them, the smooth
29+
refinement of topological covering maps, immersed/embedded submanifold
30+
structures with their tangent spaces, and the canonical manifold instance on
31+
finite products.
1132
-/

0 commit comments

Comments
 (0)