l3lab/ntp-mathlib huggingface dataset:
/-- The domain of the adjoint operator.

This definition is needed to construct the adjoint operator and the preferred version to use is
`T.adjoint.domain` instead of `T.adjointDomain`. -/
def adjointDomain : Submodule 𝕜 F where
  carrier := {y | Continuous ((innerₛₗ 𝕜 y).comp T.toFun)}
  zero_mem' := by
    rw [Set.mem_setOf_eq, LinearMap.map_zero, LinearMap.zero_comp]
    exact continuous_zero
  add_mem' hx hy := by rw [Set.mem_setOf_eq, LinearMap.map_add] at *; exact hx.add hy
  smul_mem' a x hx := by
    rw [Set.mem_setOf_eq, LinearMap.map_smulₛₗ] at *
    

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁴ : IsROrC 𝕜
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
inst✝¹ : NormedAddCommGroup F
inst✝ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
a : 𝕜
x : F
hx : Continuous ⇑((innerₛₗ 𝕜) x ∘ₗ T.toFun)
⊢ Continuous ⇑(((starRingEnd 𝕜) a • (innerₛₗ 𝕜) x) ∘ₗ T.toFun)

Next tactic:
exact hx.const_smul (conj a)
/-- The adjoint as a linear map from its domain to `E`.

This is an auxiliary definition needed to define the adjoint operator as a `LinearPMap` without
the assumption that `T.domain` is dense. -/
def adjointAux : T.adjointDomain →ₗ[𝕜] E where
  toFun y := (InnerProductSpace.toDual 𝕜 E).symm (adjointDomainMkClmExtend hT y)
  map_add' x y :=
    hT.eq_of_inner_left fun _ => by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
x y : ↥(adjointDomain T)
x✝ : ↥T.domain
⊢ inner ((fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y)) (x + y))
      ↑x✝ =
    inner
      ((fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y)) x +
        (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y)) y)
      ↑x✝

Next tactic:
simp only [inner_add_left, Submodule.coe_add, InnerProductSpace.toDual_symm_apply,
        adjointDomainMkClmExtend_apply]
/-- The adjoint as a linear map from its domain to `E`.

This is an auxiliary definition needed to define the adjoint operator as a `LinearPMap` without
the assumption that `T.domain` is dense. -/
def adjointAux : T.adjointDomain →ₗ[𝕜] E where
  toFun y := (InnerProductSpace.toDual 𝕜 E).symm (adjointDomainMkClmExtend hT y)
  map_add' x y :=
    hT.eq_of_inner_left fun _ => by
      simp only [inner_add_left, Submodule.coe_add, InnerProductSpace.toDual_symm_apply,
        adjointDomainMkClmExtend_apply]
  map_smul' _ _ :=
    hT.eq_of_inner_left fun _ => by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
x✝² : 𝕜
x✝¹ : ↥(adjointDomain T)
x✝ : ↥T.domain
⊢ inner
      (AddHom.toFun
        { toFun := fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y),
          map_add' :=
            (_ :
              ∀ (x y : ↥(adjointDomain T)),
                (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                    (x + y) =
                  (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                      x +
                    (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                      y) }
        (x✝² • x✝¹))
      ↑x✝ =
    inner
      ((RingHom.id 𝕜) x✝² •
        AddHom.toFun
          { toFun := fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y),
            map_add' :=
              (_ :
                ∀ (x y : ↥(adjointDomain T)),
                  (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                      (x + y) =
                    (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                        x +
                      (fun y =>
                          (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                        y) }
          x✝¹)
      ↑x✝

Next tactic:
simp only [inner_smul_left, Submodule.coe_smul_of_tower, RingHom.id_apply,
        InnerProductSpace.toDual_symm_apply, adjointDomainMkClmExtend_apply]
theorem adjointAux_inner (y : T.adjointDomain) (x : T.domain) :
    ⟪adjointAux hT y, x⟫ = ⟪(y : F), T x⟫ := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : ↥(adjointDomain T)
x : ↥T.domain
⊢ inner ((adjointAux hT) y) ↑x = inner (↑y) (↑T x)

Next tactic:
simp only [adjointAux, LinearMap.coe_mk, InnerProductSpace.toDual_symm_apply,
    adjointDomainMkClmExtend_apply]
theorem adjointAux_inner (y : T.adjointDomain) (x : T.domain) :
    ⟪adjointAux hT y, x⟫ = ⟪(y : F), T x⟫ := by
  simp only [adjointAux, LinearMap.coe_mk, InnerProductSpace.toDual_symm_apply,
    adjointDomainMkClmExtend_apply]
  -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5026):
  -- mathlib3 was finished here
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : ↥(adjointDomain T)
x : ↥T.domain
⊢ inner
      ({ toFun := fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y),
          map_add' :=
            (_ :
              ∀ (x y : ↥(adjointDomain T)),
                (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                    (x + y) =
                  (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                      x +
                    (fun y => (LinearIsometryEquiv.symm (InnerProductSpace.toDual 𝕜 E)) (adjointDomainMkClmExtend hT y))
                      y) }
        y)
      ↑x =
    inner (↑y) (↑T x)

Next tactic:
simp only [AddHom.coe_mk, InnerProductSpace.toDual_symm_apply]
theorem adjointAux_inner (y : T.adjointDomain) (x : T.domain) :
    ⟪adjointAux hT y, x⟫ = ⟪(y : F), T x⟫ := by
  simp only [adjointAux, LinearMap.coe_mk, InnerProductSpace.toDual_symm_apply,
    adjointDomainMkClmExtend_apply]
  -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5026):
  -- mathlib3 was finished here
  simp only [AddHom.coe_mk, InnerProductSpace.toDual_symm_apply]
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : ↥(adjointDomain T)
x : ↥T.domain
⊢ (adjointDomainMkClmExtend hT y) ↑x = inner (↑y) (↑T x)

Next tactic:
rw [adjointDomainMkClmExtend_apply]
theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, ⟪w, x⟫ = ⟪y, T x⟫) :
    y ∈ T†.domain := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : F
h : ∃ w, ∀ (x : ↥T.domain), inner w ↑x = inner y (↑T x)
⊢ y ∈ T†.domain

Next tactic:
cases' h with w hw
theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, ⟪w, x⟫ = ⟪y, T x⟫) :
    y ∈ T†.domain := by
  cases' h with w hw
  

Proof state:
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : F
w : E
hw : ∀ (x : ↥T.domain), inner w ↑x = inner y (↑T x)
⊢ y ∈ T†.domain

Next tactic:
rw [T.mem_adjoint_domain_iff]
theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, ⟪w, x⟫ = ⟪y, T x⟫) :
    y ∈ T†.domain := by
  cases' h with w hw
  rw [T.mem_adjoint_domain_iff]
  -- Porting note: was `by continuity`
  

Proof state:
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : F
w : E
hw : ∀ (x : ↥T.domain), inner w ↑x = inner y (↑T x)
⊢ Continuous ⇑((innerₛₗ 𝕜) y ∘ₗ T.toFun)

Next tactic:
have : Continuous ((innerSL 𝕜 w).comp T.domain.subtypeL) := ContinuousLinearMap.continuous _
theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, ⟪w, x⟫ = ⟪y, T x⟫) :
    y ∈ T†.domain := by
  cases' h with w hw
  rw [T.mem_adjoint_domain_iff]
  -- Porting note: was `by continuity`
  have : Continuous ((innerSL 𝕜 w).comp T.domain.subtypeL) := ContinuousLinearMap.continuous _
  

Proof state:
case intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : F
w : E
hw : ∀ (x : ↥T.domain), inner w ↑x = inner y (↑T x)
this : Continuous ⇑(ContinuousLinearMap.comp ((innerSL 𝕜) w) (Submodule.subtypeL T.domain))
⊢ Continuous ⇑((innerₛₗ 𝕜) y ∘ₗ T.toFun)

Next tactic:
convert this using 1
theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, ⟪w, x⟫ = ⟪y, T x⟫) :
    y ∈ T†.domain := by
  cases' h with w hw
  rw [T.mem_adjoint_domain_iff]
  -- Porting note: was `by continuity`
  have : Continuous ((innerSL 𝕜 w).comp T.domain.subtypeL) := ContinuousLinearMap.continuous _
  convert this using 1
  

Proof state:
case h.e'_5
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : F
w : E
hw : ∀ (x : ↥T.domain), inner w ↑x = inner y (↑T x)
this : Continuous ⇑(ContinuousLinearMap.comp ((innerSL 𝕜) w) (Submodule.subtypeL T.domain))
⊢ ⇑((innerₛₗ 𝕜) y ∘ₗ T.toFun) = ⇑(ContinuousLinearMap.comp ((innerSL 𝕜) w) (Submodule.subtypeL T.domain))

Next tactic:
exact funext fun x => (hw x).symm
theorem adjoint_apply_of_not_dense (hT : ¬Dense (T.domain : Set E)) (y : T†.domain) : T† y = 0 := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT✝ : Dense ↑T.domain
inst✝ : CompleteSpace E
hT : ¬Dense ↑T.domain
y : ↥T†.domain
⊢ ↑T† y = 0

Next tactic:
change (if hT : Dense (T.domain : Set E) then adjointAux hT else 0) y = _
theorem adjoint_apply_of_not_dense (hT : ¬Dense (T.domain : Set E)) (y : T†.domain) : T† y = 0 := by
  change (if hT : Dense (T.domain : Set E) then adjointAux hT else 0) y = _
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT✝ : Dense ↑T.domain
inst✝ : CompleteSpace E
hT : ¬Dense ↑T.domain
y : ↥T†.domain
⊢ (if hT : Dense ↑T.domain then adjointAux hT else 0) y = 0

Next tactic:
simp only [hT, not_false_iff, dif_neg, LinearMap.zero_apply]
theorem adjoint_apply_of_dense (y : T†.domain) : T† y = adjointAux hT y := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : ↥T†.domain
⊢ ↑T† y = (adjointAux hT) y

Next tactic:
change (if hT : Dense (T.domain : Set E) then adjointAux hT else 0) y = _
theorem adjoint_apply_of_dense (y : T†.domain) : T† y = adjointAux hT y := by
  change (if hT : Dense (T.domain : Set E) then adjointAux hT else 0) y = _
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
y : ↥T†.domain
⊢ (if hT : Dense ↑T.domain then adjointAux hT else 0) y = (adjointAux hT) y

Next tactic:
simp only [hT, dif_pos, LinearMap.coe_mk]
/-- The adjoint is maximal in the sense that it contains every formal adjoint. -/
theorem IsFormalAdjoint.le_adjoint (h : T.IsFormalAdjoint S) : S ≤ T† :=
  ⟨-- Trivially, every `x : S.domain` is in `T.adjoint.domain`
  fun x hx =>
    mem_adjoint_domain_of_exists _
      ⟨S ⟨x, hx⟩, h.symm ⟨x, hx⟩⟩,-- Equality on `S.domain` follows from equality
  -- `⟪v, S x⟫ = ⟪v, T.adjoint y⟫` for all `v : T.domain`:
  fun _ _ hxy => (adjoint_apply_eq hT _ fun _ => by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
T : E →ₗ.[𝕜] F
S : F →ₗ.[𝕜] E
hT : Dense ↑T.domain
inst✝ : CompleteSpace E
h : IsFormalAdjoint T S
x✝² : ↥S.domain
x✝¹ : ↥T†.domain
hxy : ↑x✝² = ↑x✝¹
x✝ : ↥T.domain
⊢ inner (↑S x✝²) ↑x✝ = inner (↑x✝¹) (↑T x✝)

Next tactic:
rw [h.symm, hxy]
/-- Restricting `A` to a dense submodule and taking the `LinearPMap.adjoint` is the same
as taking the `continuous_linear_map.adjoint` interpreted as a `linear_pmap`. -/
theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) :
    (A.toPMap p).adjoint = A.adjoint.toPMap ⊤ := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
A : E →L[𝕜] F
p : Submodule 𝕜 E
hp : Dense ↑p
⊢ LinearPMap.adjoint (LinearMap.toPMap (↑A) p) = LinearMap.toPMap ↑(adjoint A) ⊤

Next tactic:
ext x y hxy
/-- Restricting `A` to a dense submodule and taking the `LinearPMap.adjoint` is the same
as taking the `continuous_linear_map.adjoint` interpreted as a `linear_pmap`. -/
theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) :
    (A.toPMap p).adjoint = A.adjoint.toPMap ⊤ := by
  ext x y hxy
  · 

Proof state:
case h.h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
A : E →L[𝕜] F
p : Submodule 𝕜 E
hp : Dense ↑p
x : F
⊢ x ∈ (LinearPMap.adjoint (LinearMap.toPMap (↑A) p)).domain ↔ x ∈ (LinearMap.toPMap ↑(adjoint A) ⊤).domain

Next tactic:
simp only [LinearMap.toPMap_domain, Submodule.mem_top, iff_true_iff,
      LinearPMap.mem_adjoint_domain_iff, LinearMap.coe_comp, innerₛₗ_apply_coe]
/-- Restricting `A` to a dense submodule and taking the `LinearPMap.adjoint` is the same
as taking the `continuous_linear_map.adjoint` interpreted as a `linear_pmap`. -/
theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) :
    (A.toPMap p).adjoint = A.adjoint.toPMap ⊤ := by
  ext x y hxy
  · simp only [LinearMap.toPMap_domain, Submodule.mem_top, iff_true_iff,
      LinearPMap.mem_adjoint_domain_iff, LinearMap.coe_comp, innerₛₗ_apply_coe]
    

Proof state:
case h.h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
A : E →L[𝕜] F
p : Submodule 𝕜 E
hp : Dense ↑p
x : F
⊢ Continuous ((fun w => inner x w) ∘ ⇑(LinearMap.toPMap (↑A) p).toFun)

Next tactic:
exact ((innerSL 𝕜 x).comp <| A.comp <| Submodule.subtypeL _).cont
/-- Restricting `A` to a dense submodule and taking the `LinearPMap.adjoint` is the same
as taking the `continuous_linear_map.adjoint` interpreted as a `linear_pmap`. -/
theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) :
    (A.toPMap p).adjoint = A.adjoint.toPMap ⊤ := by
  ext x y hxy
  · simp only [LinearMap.toPMap_domain, Submodule.mem_top, iff_true_iff,
      LinearPMap.mem_adjoint_domain_iff, LinearMap.coe_comp, innerₛₗ_apply_coe]
    exact ((innerSL 𝕜 x).comp <| A.comp <| Submodule.subtypeL _).cont
  

Proof state:
case h'
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
A : E →L[𝕜] F
p : Submodule 𝕜 E
hp : Dense ↑p
x : ↥(LinearPMap.adjoint (LinearMap.toPMap (↑A) p)).domain
y : ↥(LinearMap.toPMap ↑(adjoint A) ⊤).domain
hxy : ↑x = ↑y
⊢ ↑(LinearPMap.adjoint (LinearMap.toPMap (↑A) p)) x = ↑(LinearMap.toPMap ↑(adjoint A) ⊤) y

Next tactic:
refine' LinearPMap.adjoint_apply_eq _ _ fun v => _
/-- Restricting `A` to a dense submodule and taking the `LinearPMap.adjoint` is the same
as taking the `continuous_linear_map.adjoint` interpreted as a `linear_pmap`. -/
theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) :
    (A.toPMap p).adjoint = A.adjoint.toPMap ⊤ := by
  ext x y hxy
  · simp only [LinearMap.toPMap_domain, Submodule.mem_top, iff_true_iff,
      LinearPMap.mem_adjoint_domain_iff, LinearMap.coe_comp, innerₛₗ_apply_coe]
    exact ((innerSL 𝕜 x).comp <| A.comp <| Submodule.subtypeL _).cont
  refine' LinearPMap.adjoint_apply_eq _ _ fun v => _
  · -- Porting note: was simply `hp` as an argument above
    

Proof state:
case h'.refine'_1
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
A : E →L[𝕜] F
p : Submodule 𝕜 E
hp : Dense ↑p
x : ↥(LinearPMap.adjoint (LinearMap.toPMap (↑A) p)).domain
y : ↥(LinearMap.toPMap ↑(adjoint A) ⊤).domain
hxy : ↑x = ↑y
⊢ Dense ↑(LinearMap.toPMap (↑A) p).domain

Next tactic:
simpa using hp
/-- Restricting `A` to a dense submodule and taking the `LinearPMap.adjoint` is the same
as taking the `continuous_linear_map.adjoint` interpreted as a `linear_pmap`. -/
theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) :
    (A.toPMap p).adjoint = A.adjoint.toPMap ⊤ := by
  ext x y hxy
  · simp only [LinearMap.toPMap_domain, Submodule.mem_top, iff_true_iff,
      LinearPMap.mem_adjoint_domain_iff, LinearMap.coe_comp, innerₛₗ_apply_coe]
    exact ((innerSL 𝕜 x).comp <| A.comp <| Submodule.subtypeL _).cont
  refine' LinearPMap.adjoint_apply_eq _ _ fun v => _
  · -- Porting note: was simply `hp` as an argument above
    simpa using hp
  · 

Proof state:
case h'.refine'_2
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 F
inst✝¹ : CompleteSpace E
inst✝ : CompleteSpace F
A : E →L[𝕜] F
p : Submodule 𝕜 E
hp : Dense ↑p
x : ↥(LinearPMap.adjoint (LinearMap.toPMap (↑A) p)).domain
y : ↥(LinearMap.toPMap ↑(adjoint A) ⊤).domain
hxy : ↑x = ↑y
v : ↥(LinearMap.toPMap (↑A) p).domain
⊢ inner (↑(LinearMap.toPMap ↑(adjoint A) ⊤) y) ↑v = inner (↑x) (↑(LinearMap.toPMap (↑A) p) v)

Next tactic:
simp only [adjoint_inner_left, hxy, LinearMap.toPMap_apply, coe_coe]
/-- Every self-adjoint `LinearPMap` has dense domain.

This is not true by definition since we define the adjoint without the assumption that the
domain is dense, but the choice of the junk value implies that a `LinearPMap` cannot be self-adjoint
if it does not have dense domain. -/
theorem _root_.IsSelfAdjoint.dense_domain (hA : IsSelfAdjoint A) : Dense (A.domain : Set E) := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
inst✝ : CompleteSpace E
A : E →ₗ.[𝕜] E
hA : IsSelfAdjoint A
⊢ Dense ↑A.domain

Next tactic:
by_contra h
/-- Every self-adjoint `LinearPMap` has dense domain.

This is not true by definition since we define the adjoint without the assumption that the
domain is dense, but the choice of the junk value implies that a `LinearPMap` cannot be self-adjoint
if it does not have dense domain. -/
theorem _root_.IsSelfAdjoint.dense_domain (hA : IsSelfAdjoint A) : Dense (A.domain : Set E) := by
  by_contra h
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
inst✝ : CompleteSpace E
A : E →ₗ.[𝕜] E
hA : IsSelfAdjoint A
h : ¬Dense ↑A.domain
⊢ False

Next tactic:
rw [isSelfAdjoint_def] at hA
/-- Every self-adjoint `LinearPMap` has dense domain.

This is not true by definition since we define the adjoint without the assumption that the
domain is dense, but the choice of the junk value implies that a `LinearPMap` cannot be self-adjoint
if it does not have dense domain. -/
theorem _root_.IsSelfAdjoint.dense_domain (hA : IsSelfAdjoint A) : Dense (A.domain : Set E) := by
  by_contra h
  rw [isSelfAdjoint_def] at hA
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
inst✝ : CompleteSpace E
A : E →ₗ.[𝕜] E
hA : A† = A
h : ¬Dense ↑A.domain
⊢ False

Next tactic:
have h' : A.domain = ⊤ := by
    rw [← hA, Submodule.eq_top_iff']
    intro x
    rw [mem_adjoint_domain_iff, ← hA]
    refine (innerSL 𝕜 x).cont.comp ?_
    simp [adjoint, h, continuous_const]
/-- Every self-adjoint `LinearPMap` has dense domain.

This is not true by definition since we define the adjoint without the assumption that the
domain is dense, but the choice of the junk value implies that a `LinearPMap` cannot be self-adjoint
if it does not have dense domain. -/
theorem _root_.IsSelfAdjoint.dense_domain (hA : IsSelfAdjoint A) : Dense (A.domain : Set E) := by
  by_contra h
  rw [isSelfAdjoint_def] at hA
  have h' : A.domain = ⊤ := by
    

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
inst✝ : CompleteSpace E
A : E →ₗ.[𝕜] E
hA : A† = A
h : ¬Dense ↑A.domain
⊢ A.domain = ⊤

Next tactic:
rw [← hA, Submodule.eq_top_iff']
/-- Every self-adjoint `LinearPMap` has dense domain.

This is not true by definition since we define the adjoint without the assumption that the
domain is dense, but the choice of the junk value implies that a `LinearPMap` cannot be self-adjoint
if it does not have dense domain. -/
theorem _root_.IsSelfAdjoint.dense_domain (hA : IsSelfAdjoint A) : Dense (A.domain : Set E) := by
  by_contra h
  rw [isSelfAdjoint_def] at hA
  have h' : A.domain = ⊤ := by
    rw [← hA, Submodule.eq_top_iff']
    

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace 𝕜 F
inst✝ : CompleteSpace E
A : E →ₗ.[𝕜] E
hA : A† = A
h : ¬Dense ↑A.domain
⊢ ∀ (x : E), x ∈ A†.domain

Next tactic:
intro x