Skip to content

Commit

Permalink
FunLike の仕様変更に伴うエラーを解消する
Browse files Browse the repository at this point in the history
  • Loading branch information
Seasawher committed Mar 29, 2024
1 parent f3069f3 commit 33b6e72
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Solution/Advanced/Algebra/Lecture2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ variable [Group G₁] [Group G₂] {f : G₁ →* G₂}
-- `f`と`a : G₁`に対して、いちいち`f.toFun a`と書く代わりに、`f a`と書くためのおまじない
-- (`f`そのものは、写像`f.toFun`と、それが積を保つという事実`f.map_mul'`を束ねたもので、本来は写像でない)
-- 右側のInfoviewには、`f a`の代わりに`↑f a`と表示されることもあるが、同じなので気にしないでください。
instance : FunLike (G₁ →* G₂) G₁ (fun _ ↦ G₂) where
instance : DFunLike (G₁ →* G₂) G₁ (fun _ ↦ G₂) where
coe := fun f ↦ f.toFun
coe_injective' f₁ f₂ _ := by cases f₁; cases f₂; congr

Expand Down
4 changes: 2 additions & 2 deletions Solution/Advanced/Algebra/Lecture3.lean
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ notation:25 X " →[" G:25 "] " Y:0 => GroupActionHom G X Y
variable [Group G] [GroupAction G X] [GroupAction G Y] [GroupAction G Z]

-- `f : X →[G] Y`に対して`f x`のように書くためのおまじない。
instance : FunLike (GroupActionHom G X Y) X (fun _ ↦ Y) where
instance : DFunLike (GroupActionHom G X Y) X (fun _ ↦ Y) where
coe f := f.toFun
coe_injective' f₁ f₂ _ := by cases f₁; cases f₂; congr

Expand All @@ -161,7 +161,7 @@ theorem GroupActionHom.coe_coe (f : X → Y) (h) : ((⟨f, h⟩ : X →[G] Y) :
-- 定義からすぐ分かること
@[ext]
theorem GroupActionHom.ext {f₁ f₂ : X →[G] Y} : (∀ x, f₁ x = f₂ x) → f₁ = f₂ :=
FunLike.ext f₁ f₂
DFunLike.ext f₁ f₂

theorem map_smul (f : X →[G] Y) : ∀ (a : G) (x : X), f (a • x) = a • f x := f.map_smul'

Expand Down
8 changes: 8 additions & 0 deletions Solution/Advanced/Category/Lecture1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ instance {R : CommRingCat} : Category (CommAlgCat R) where

/- 定義の上の`@[simps]`はおまじないで、ここでは特に意味がない。`Lecture 2`で役に立つ。 -/

-- おまじない
instance {A B : CommAlgCat R} : FunLike (Hom A B) A B where
coe f := f.toFun
coe_injective' f g h := by
rcases f with ⟨⟨⟨⟨_, _⟩, _⟩, _, _⟩, _⟩
rcases g with ⟨⟨⟨⟨_, _⟩, _⟩, _, _⟩, _⟩
congr

-- おまじない。`Lecture 2`で役に立つ。
instance {A B : CommAlgCat R} : AlgHomClass (Hom A B) R A B :=
inferInstanceAs <| AlgHomClass (A →ₐ[R] B) R A B
Expand Down

0 comments on commit 33b6e72

Please sign in to comment.