@@ -352,25 +352,17 @@ namespace Submodule
352352
353353/-! ### The orthogonal complement -/
354354
355- variable [CommSemiring R] [CommSemiring R₁] [CommSemiring R₂]
356- variable [AddCommMonoid M] [Module R M]
357- variable [AddCommMonoid M₁] [Module R₁ M₁]
358- variable [AddCommMonoid M₂] [Module R₂ M₂]
359- variable {N L : Submodule R₁ M₁}
360-
361- section
355+ variable [CommRing R] [CommRing R₁] [AddCommGroup M₁] [Module R₁ M₁] [AddCommGroup M] [Module R M]
356+ {I₁ : R₁ →+* R} {I₂ : R₁ →+* R} {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
362357
363- variable {I₁ : R₁ →+* R} {I₂ : R₂ →+* R} {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M}
364-
365- variable (B) in
366358/-- The orthogonal complement of a submodule `N` with respect to some bilinear map is the set of
367359elements `x` which are orthogonal to all elements of `N`; i.e., for all `y` in `N`, `B x y = 0`.
368360
369361Note that for general (neither symmetric nor antisymmetric) bilinear maps this definition has a
370362chirality; in addition to this "left" orthogonal complement one could define a "right" orthogonal
371363complement for which, for all `y` in `N`, `B y x = 0`. This variant definition is not currently
372364provided in mathlib. -/
373- def orthogonalBilin (N : Submodule R₁ M₁) : Submodule R₂ M₂ where
365+ def orthogonalBilin (N : Submodule R₁ M₁) (B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M) : Submodule R₁ M₁ where
374366 carrier := { m | ∀ n ∈ N, B.IsOrtho n m }
375367 zero_mem' x _ := B.isOrtho_zero_right x
376368 add_mem' hx hy n hn := by
@@ -379,24 +371,18 @@ def orthogonalBilin (N : Submodule R₁ M₁) : Submodule R₂ M₂ where
379371 smul_mem' c x hx n hn := by
380372 rw [LinearMap.IsOrtho, map_smulₛₗ, show B n x = 0 from hx n hn, smul_zero]
381373
374+ variable {N L : Submodule R₁ M₁}
375+
382376@[simp]
383- theorem mem_orthogonalBilin_iff {m : M₂ } : m ∈ N.orthogonalBilin B ↔ ∀ n ∈ N, B.IsOrtho n m :=
377+ theorem mem_orthogonalBilin_iff {m : M₁ } : m ∈ N.orthogonalBilin B ↔ ∀ n ∈ N, B.IsOrtho n m :=
384378 Iff.rfl
385379
386380theorem orthogonalBilin_le (h : N ≤ L) : L.orthogonalBilin B ≤ N.orthogonalBilin B :=
387381 fun _ hn l hl ↦ hn l (h hl)
388382
389- end
390-
391- section
392-
393- variable {I₁ : R₁ →+* R} {I₂ : R₁ →+* R} {B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
394-
395383theorem le_orthogonalBilin_orthogonalBilin (b : B.IsRefl) :
396384 N ≤ (N.orthogonalBilin B).orthogonalBilin B := fun n hn _m hm ↦ b _ _ (hm n hn)
397385
398- end
399-
400386end Submodule
401387
402388namespace LinearMap
@@ -408,7 +394,7 @@ variable [Field K] [AddCommGroup V] [Module K V] [Field K₁] [AddCommGroup V₁
408394
409395-- ↓ This lemma only applies in fields as we require `a * b = 0 → a = 0 ∨ b = 0`
410396theorem span_singleton_inf_orthogonal_eq_bot (B : V₁ →ₛₗ[J₁] V₁ →ₛₗ[J₁'] V₂) (x : V₁)
411- (hx : ¬B.IsOrtho x x) : (K₁ ∙ x) ⊓ (K₁ ∙ x).orthogonalBilin B = ⊥ := by
397+ (hx : ¬B.IsOrtho x x) : (K₁ ∙ x) ⊓ Submodule.orthogonalBilin (K₁ ∙ x) B = ⊥ := by
412398 rw [← Finset.coe_singleton]
413399 refine eq_bot_iff.2 fun y h ↦ ?_
414400 obtain ⟨μ, -, rfl⟩ := Submodule.mem_span_finset.1 h.1
@@ -422,7 +408,7 @@ theorem span_singleton_inf_orthogonal_eq_bot (B : V₁ →ₛₗ[J₁] V₁ →
422408
423409-- ↓ This lemma only applies in fields since we use the `mul_eq_zero`
424410theorem orthogonal_span_singleton_eq_to_lin_ker {B : V →ₗ[K] V →ₛₗ[J] V₂} (x : V) :
425- (K ∙ x).orthogonalBilin B = LinearMap.ker (B x) := by
411+ Submodule.orthogonalBilin (K ∙ x) B = LinearMap.ker (B x) := by
426412 ext y
427413 simp_rw [Submodule.mem_orthogonalBilin_iff, LinearMap.mem_ker, Submodule.mem_span_singleton]
428414 constructor
@@ -433,15 +419,15 @@ theorem orthogonal_span_singleton_eq_to_lin_ker {B : V →ₗ[K] V →ₛₗ[J]
433419
434420-- todo: Generalize this to sesquilinear maps
435421theorem span_singleton_sup_orthogonal_eq_top {B : V →ₗ[K] V →ₗ[K] K} {x : V} (hx : ¬B.IsOrtho x x) :
436- (K ∙ x) ⊔ ( K ∙ x).orthogonalBilin B = ⊤ := by
422+ (K ∙ x) ⊔ Submodule.orthogonalBilin (N := K ∙ x) (B := B) = ⊤ := by
437423 rw [orthogonal_span_singleton_eq_to_lin_ker]
438424 exact (B x).span_singleton_sup_ker_eq_top hx
439425
440426-- todo: Generalize this to sesquilinear maps
441427/-- Given a bilinear form `B` and some `x` such that `B x x ≠ 0`, the span of the singleton of `x`
442428 is complement to its orthogonal complement. -/
443429theorem isCompl_span_singleton_orthogonal {B : V →ₗ[K] V →ₗ[K] K} {x : V} (hx : ¬B.IsOrtho x x) :
444- IsCompl (K ∙ x) (( K ∙ x).orthogonalBilin B ) :=
430+ IsCompl (K ∙ x) (Submodule.orthogonalBilin (N := K ∙ x) (B := B) ) :=
445431 { disjoint := disjoint_iff.2 <| span_singleton_inf_orthogonal_eq_bot B x hx
446432 codisjoint := codisjoint_iff.2 <| span_singleton_sup_orthogonal_eq_top hx }
447433
0 commit comments