Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and silence some warnings #164

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions FLT/AutomorphicForm/QuaternionAlgebra.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ suppress_compilation

variable (F : Type*) [Field F] [NumberField F]

variable (D : Type*) [Ring D] [Algebra F D] [FiniteDimensional F D]
variable (D : Type*) [Ring D] [Algebra F D]

open DedekindDomain

Expand Down Expand Up @@ -56,7 +56,7 @@ end missing_instances

instance : TopologicalSpace (D ⊗[F] (FiniteAdeleRing (𝓞 F) F)) := actionTopology (FiniteAdeleRing (𝓞 F) F) _
instance : IsActionTopology (FiniteAdeleRing (𝓞 F) F) (D ⊗[F] (FiniteAdeleRing (𝓞 F) F)) := ⟨rfl⟩
instance : TopologicalRing (D ⊗[F] (FiniteAdeleRing (𝓞 F) F)) :=
instance [FiniteDimensional F D] : TopologicalRing (D ⊗[F] (FiniteAdeleRing (𝓞 F) F)) :=
-- this def would be a dangerous instance
-- (it can't guess R) but it's just a Prop so we can easily add it here
ActionTopology.Module.topologicalRing (FiniteAdeleRing (𝓞 F) F) _
Expand Down Expand Up @@ -93,16 +93,16 @@ attribute [coe] AutomorphicForm.toFun
theorem ext (φ ψ : AutomorphicForm F D M) (h : ∀ x, φ x = ψ x) : φ = ψ := by
cases φ; cases ψ; simp only [mk.injEq]; ext; apply h

def zero : (AutomorphicForm F D M) where
def zero [FiniteDimensional F D] : (AutomorphicForm F D M) where
toFun := 0
left_invt := by simp
loc_cst := by use ⊤; simp

instance : Zero (AutomorphicForm F D M) where
instance [FiniteDimensional F D] : Zero (AutomorphicForm F D M) where
zero := zero

@[simp]
theorem zero_apply (x : (D ⊗[F] (FiniteAdeleRing (𝓞 F) F))ˣ) :
theorem zero_apply [FiniteDimensional F D] (x : (D ⊗[F] (FiniteAdeleRing (𝓞 F) F))ˣ) :
(0 : AutomorphicForm F D M) x = 0 := rfl

def neg (φ : AutomorphicForm F D M) : AutomorphicForm F D M where
Expand Down Expand Up @@ -147,7 +147,7 @@ instance : Add (AutomorphicForm F D M) where
theorem add_apply (φ ψ : AutomorphicForm F D M) (x : (D ⊗[F] (FiniteAdeleRing (𝓞 F) F))ˣ) :
(φ + ψ) x = (φ x) + (ψ x) := rfl

instance addCommGroup : AddCommGroup (AutomorphicForm F D M) where
instance addCommGroup [FiniteDimensional F D] : AddCommGroup (AutomorphicForm F D M) where
add := (· + ·)
add_assoc := by intros; ext; simp [add_assoc];
zero := 0
Expand Down Expand Up @@ -184,7 +184,7 @@ theorem toConjAct_open {G : Type*} [Group G] [TopologicalSpace G] [TopologicalGr
group
exact hu

instance : SMul (Dfx F D) (AutomorphicForm F D M) where
instance [FiniteDimensional F D] : SMul (Dfx F D) (AutomorphicForm F D M) where
smul g φ := { -- (g • f) (x) := f(xg) -- x(gf)=(xg)f
toFun := fun x => φ (x * g)
left_invt := by
Expand All @@ -204,10 +204,10 @@ instance : SMul (Dfx F D) (AutomorphicForm F D M) where
}

@[simp]
theorem sMul_eval (g : Dfx F D) (f : AutomorphicForm F D M) (x : (D ⊗[F] FiniteAdeleRing (𝓞 F) F)ˣ) :
theorem sMul_eval [FiniteDimensional F D] (g : Dfx F D) (f : AutomorphicForm F D M) (x : (D ⊗[F] FiniteAdeleRing (𝓞 F) F)ˣ) :
(g • f) x = f (x * g) := rfl

instance : MulAction (Dfx F D) (AutomorphicForm F D M) where
instance [FiniteDimensional F D] : MulAction (Dfx F D) (AutomorphicForm F D M) where
smul := (· • ·)
one_smul := by intros; ext; simp only [sMul_eval, mul_one]
mul_smul := by intros; ext; simp only [sMul_eval, mul_assoc]
2 changes: 1 addition & 1 deletion FLT/HIMExperiments/ContinuousSMul_topology.lean
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ lemma induced_continuous_smul [τA : TopologicalSpace A] [ContinuousSMul R A] (h
@ContinuousSMul S B _ _ (TopologicalSpace.induced g τA) := by
convert Inducing.continuousSMul (inducing_induced g) hf (fun {c} {x} ↦ map_smulₛₗ g c x)

#check Prod.continuousSMul -- exists and is an instance :-)
-- #check Prod.continuousSMul -- exists and is an instance :-)
--#check Induced.continuousSMul -- doesn't exist

end continuous_smul
Expand Down
2 changes: 2 additions & 0 deletions FLT/HIMExperiments/FGModuleTopology.lean
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ or $p$-adics).

-/

set_option linter.unusedSectionVars false

section basics

variable (R : Type*) [TopologicalSpace R] [Semiring R]
Expand Down
6 changes: 3 additions & 3 deletions FLT/HIMExperiments/dual_topology.lean
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace dual_topology

section basics

variable (R : Type*) [Monoid R] [TopologicalSpace R] [ContinuousMul R]
variable (R : Type*) [Monoid R] [TopologicalSpace R]
variable (A : Type*) [SMul R A]

abbrev dualTopology : TopologicalSpace A :=
Expand All @@ -121,10 +121,10 @@ lemma isDualTopology [τA : TopologicalSpace A] [IsDualTopology R A] :
end basics

-- Non-commutative variables
variable (R : Type*) [Monoid R] [τR: TopologicalSpace R] [ContinuousMul R]
variable (R : Type*) [Monoid R] [τR: TopologicalSpace R]


lemma Module.topology_self : τR = dualTopology R R := by
lemma Module.topology_self [ContinuousMul R] : τR = dualTopology R R := by
refine le_antisymm (le_iInf (fun i ↦ ?_)) <| sInf_le ⟨MulActionHom.id R, induced_id⟩
rw [← continuous_iff_le_induced,
show i = ⟨fun r ↦ r • i 1, fun _ _ ↦ mul_assoc _ _ _⟩ by
Expand Down
2 changes: 2 additions & 0 deletions FLT/HIMExperiments/module_topology.lean
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and target.

-/

set_option linter.unusedSectionVars false

-- This was an early theorem I proved when I didn't know what was true or not, and
-- was just experimenting.

Expand Down
2 changes: 2 additions & 0 deletions FLT/HIMExperiments/right_module_topology.lean
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ functions from `M` (now considered only as an index set, so with no topology) to

-/

set_option linter.unusedSectionVars false

-- See FLT.ForMathlib.ActionTopology for a parallel development.
namespace right_module_topology

Expand Down
2 changes: 2 additions & 0 deletions FLT/MathlibExperiments/Frobenius.lean
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ for "helping me to understand the math proof and to formalize it."

-/

set_option linter.unusedSectionVars false

open Classical

section FiniteFrobeniusDef
Expand Down
1 change: 1 addition & 0 deletions FLT/MathlibExperiments/Frobenius2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ open scoped algebraMap
noncomputable local instance : Algebra A[X] B[X] :=
RingHom.toAlgebra (Polynomial.mapRingHom (Algebra.toRingHom))

omit [Fintype (B ≃ₐ[A] B)] [DecidableEq (Ideal B)] in
@[simp, norm_cast]
lemma coe_monomial (n : ℕ) (a : A) : ((monomial n a : A[X]) : B[X]) = monomial n (a : B) :=
map_monomial _
Expand Down