Module docstring
{"# Pointwise instances on AffineSubspaces
This file provides the additive action AffineSubspace.pointwiseAddAction in the
Pointwise locale.
"}
{"# Pointwise instances on AffineSubspaces
This file provides the additive action AffineSubspace.pointwiseAddAction in the
Pointwise locale.
"}
AffineSubspace.pointwiseVAdd
      definition
     : VAdd V (AffineSubspace k P)
        /-- The additive action on an affine subspace corresponding to applying the action to every element.
This is available as an instance in the `Pointwise` locale. -/
protected def pointwiseVAdd : VAdd V (AffineSubspace k P) where
  vadd x s := s.map (AffineEquiv.constVAdd k P x)
        AffineSubspace.coe_pointwise_vadd
      theorem
     (v : V) (s : AffineSubspace k P) : ((v +ᵥ s : AffineSubspace k P) : Set P) = v +ᵥ (s : Set P)
        @[simp, norm_cast] lemma coe_pointwise_vadd (v : V) (s : AffineSubspace k P) :
    ((v +ᵥ s : AffineSubspace k P) : Set P) = v +ᵥ (s : Set P) := rfl
        AffineSubspace.pointwiseAddAction
      definition
     : AddAction V (AffineSubspace k P)
        /-- The additive action on an affine subspace corresponding to applying the action to every element.
This is available as an instance in the `Pointwise` locale. -/
protected def pointwiseAddAction : AddAction V (AffineSubspace k P) :=
  SetLike.coe_injective.addAction _ coe_pointwise_vadd
        AffineSubspace.pointwise_vadd_eq_map
      theorem
     (v : V) (s : AffineSubspace k P) : v +ᵥ s = s.map (AffineEquiv.constVAdd k P v)
        theorem pointwise_vadd_eq_map (v : V) (s : AffineSubspace k P) :
    v +ᵥ s = s.map (AffineEquiv.constVAdd k P v) :=
  rfl
        AffineSubspace.vadd_mem_pointwise_vadd_iff
      theorem
     {v : V} {s : AffineSubspace k P} {p : P} : v +ᵥ p ∈ v +ᵥ s ↔ p ∈ s
        theorem vadd_mem_pointwise_vadd_iff {v : V} {s : AffineSubspace k P} {p : P} :
    v +ᵥ pv +ᵥ p ∈ v +ᵥ sv +ᵥ p ∈ v +ᵥ s ↔ p ∈ s :=
  vadd_mem_vadd_set_iff
        AffineSubspace.pointwise_vadd_bot
      theorem
     (v : V) : v +ᵥ (⊥ : AffineSubspace k P) = ⊥
        @[simp] theorem pointwise_vadd_bot (v : V) : v +ᵥ (⊥ : AffineSubspace k P) = ⊥ := by
  ext; simp [pointwise_vadd_eq_map, map_bot]
        AffineSubspace.pointwise_vadd_top
      theorem
     (v : V) : v +ᵥ (⊤ : AffineSubspace k P) = ⊤
        @[simp] lemma pointwise_vadd_top (v : V) : v +ᵥ (⊤ : AffineSubspace k P) = ⊤ := by
  ext; simp [pointwise_vadd_eq_map, map_top, vadd_eq_iff_eq_neg_vadd]
        AffineSubspace.pointwise_vadd_direction
      theorem
     (v : V) (s : AffineSubspace k P) : (v +ᵥ s).direction = s.direction
        theorem pointwise_vadd_direction (v : V) (s : AffineSubspace k P) :
    (v +ᵥ s).direction = s.direction := by
  rw [pointwise_vadd_eq_map, map_direction]
  exact Submodule.map_id _
        AffineSubspace.pointwise_vadd_span
      theorem
     (v : V) (s : Set P) : v +ᵥ affineSpan k s = affineSpan k (v +ᵥ s)
        theorem pointwise_vadd_span (v : V) (s : Set P) : v +ᵥ affineSpan k s = affineSpan k (v +ᵥ s) :=
  map_span _ s
        AffineSubspace.map_pointwise_vadd
      theorem
     (f : P₁ →ᵃ[k] P₂) (v : V₁) (s : AffineSubspace k P₁) : (v +ᵥ s).map f = f.linear v +ᵥ s.map f
        theorem map_pointwise_vadd (f : P₁ →ᵃ[k] P₂) (v : V₁) (s : AffineSubspace k P₁) :
    (v +ᵥ s).map f = f.linear v +ᵥ s.map f := by
  rw [pointwise_vadd_eq_map, pointwise_vadd_eq_map, map_map, map_map]
  congr 1
  ext
  exact f.map_vadd _ _
        AffineSubspace.pointwiseSMul
      definition
     : SMul M (AffineSubspace k V)
        /-- The multiplicative action on an affine subspace corresponding to applying the action to every
element.
This is available as an instance in the `Pointwise` locale.
TODO: generalize to include `SMul (P ≃ᵃ[k] P) (AffineSubspace k P)`, which acts on `P` with a
`VAdd` version of a `DistribMulAction`. -/
protected def pointwiseSMul : SMul M (AffineSubspace k V) where
  smul a s := s.map (DistribMulAction.toLinearMap k _ a).toAffineMap
        AffineSubspace.coe_smul
      theorem
     (a : M) (s : AffineSubspace k V) : ↑(a • s) = a • (s : Set V)
        @[simp, norm_cast]
lemma coe_smul (a : M) (s : AffineSubspace k V) : ↑(a • s) = a • (s : Set V) := rfl
        AffineSubspace.mulAction
      definition
     : MulAction M (AffineSubspace k V)
        /-- The multiplicative action on an affine subspace corresponding to applying the action to every
element.
This is available as an instance in the `Pointwise` locale.
TODO: generalize to include `SMul (P ≃ᵃ[k] P) (AffineSubspace k P)`, which acts on `P` with a
`VAdd` version of a `DistribMulAction`. -/
protected def mulAction : MulAction M (AffineSubspace k V) :=
  SetLike.coe_injective.mulAction _ coe_smul
        AffineSubspace.smul_eq_map
      theorem
     (a : M) (s : AffineSubspace k V) : a • s = s.map (DistribMulAction.toLinearMap k _ a).toAffineMap
        lemma smul_eq_map (a : M) (s : AffineSubspace k V) :
    a • s = s.map (DistribMulAction.toLinearMap k _ a).toAffineMap := rfl
        AffineSubspace.smul_mem_smul_iff
      theorem
     {G : Type*} [Group G] [DistribMulAction G V] [SMulCommClass G k V] {a : G} : a • p ∈ a • s ↔ p ∈ s
        lemma smul_mem_smul_iff {G : Type*} [Group G] [DistribMulAction G V] [SMulCommClass G k V] {a : G} :
    a • p ∈ a • sa • p ∈ a • s ↔ p ∈ s := smul_mem_smul_set_iff
        AffineSubspace.smul_mem_smul_iff_of_isUnit
      theorem
     (ha : IsUnit a) : a • p ∈ a • s ↔ p ∈ s
        lemma smul_mem_smul_iff_of_isUnit (ha : IsUnit a) : a • p ∈ a • sa • p ∈ a • s ↔ p ∈ s :=
  smul_mem_smul_iff (a := ha.unit)
        AffineSubspace.smul_mem_smul_iff₀
      theorem
     {G₀ : Type*} [GroupWithZero G₀] [DistribMulAction G₀ V] [SMulCommClass G₀ k V] {a : G₀} (ha : a ≠ 0) :
  a • p ∈ a • s ↔ p ∈ s
        lemma smul_mem_smul_iff₀ {G₀ : Type*} [GroupWithZero G₀] [DistribMulAction G₀ V]
    [SMulCommClass G₀ k V] {a : G₀} (ha : a ≠ 0) : a • p ∈ a • sa • p ∈ a • s ↔ p ∈ s :=
  smul_mem_smul_iff_of_isUnit ha.isUnit
        AffineSubspace.smul_bot
      theorem
     (a : M) : a • (⊥ : AffineSubspace k V) = ⊥
        @[simp] lemma smul_bot (a : M) : a • (⊥ : AffineSubspace k V) = ⊥ := by
  ext; simp [smul_eq_map, map_bot]
        AffineSubspace.smul_top
      theorem
     (ha : IsUnit a) : a • (⊤ : AffineSubspace k V) = ⊤
        @[simp] lemma smul_top (ha : IsUnit a) : a • (⊤ : AffineSubspace k V) = ⊤ := by
  ext x; simpa [smul_eq_map, map_top] using ⟨ha.unit⁻¹ • x, smul_inv_smul ha.unit _⟩
        AffineSubspace.smul_span
      theorem
     (a : M) (s : Set V) : a • affineSpan k s = affineSpan k (a • s)
        lemma smul_span (a : M) (s : Set V) : a • affineSpan k s = affineSpan k (a • s) := map_span _ s
        AffineSubspace.direction_smul
      theorem
     (ha : a ≠ 0) (s : AffineSubspace k V) : (a • s).direction = s.direction
        @[simp]
lemma direction_smul (ha : a ≠ 0) (s : AffineSubspace k V) : (a • s).direction = s.direction := by
  have : DistribMulAction.toLinearMap k V a = a • LinearMap.id := by
    ext; simp
  simp [smul_eq_map, map_direction, this, Submodule.map_smul, ha]