Skip to content

Commit

Permalink
Fix and silence some warnings (#164)
Browse files Browse the repository at this point in the history
This makes it somewhat easier to spot legitimate output.

Co-authored-by: Pietro Monticone <[email protected]>
  • Loading branch information
Ruben-VandeVelde and pitmonticone authored Oct 10, 2024
1 parent d7d2013 commit 217555e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 13 deletions.
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

0 comments on commit 217555e

Please sign in to comment.