Skip to content

Commit b1013c6

Browse files
committed
feat: tag map_mono and comap_mono with gcongr (leanprover-community#40560)
1 parent 3eb2cbf commit b1013c6

15 files changed

Lines changed: 19 additions & 2 deletions

File tree

Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def map (f : F) (S : NonUnitalSubalgebra R A) : NonUnitalSubalgebra R B :=
344344
rcases hb with ⟨a, ha, rfl⟩
345345
exact map_smulₛₗ f r a ▸ Set.mem_image_of_mem f (S.smul_mem' r ha) }
346346

347+
@[gcongr]
347348
theorem map_mono {S₁ S₂ : NonUnitalSubalgebra R A} {f : F} :
348349
S₁ ≤ S₂ → (map f S₁ : NonUnitalSubalgebra R B) ≤ map f S₂ :=
349350
Set.image_mono

Mathlib/Algebra/Algebra/Subalgebra/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ def map (f : A →ₐ[R] B) (S : Subalgebra R A) : Subalgebra R B :=
417417
{ S.toSubsemiring.map (f : A →+* B) with
418418
algebraMap_mem' := fun r => f.commutes r ▸ Set.mem_image_of_mem _ (S.algebraMap_mem r) }
419419

420+
@[gcongr]
420421
theorem map_mono {S₁ S₂ : Subalgebra R A} {f : A →ₐ[R] B} : S₁ ≤ S₂ → S₁.map f ≤ S₂.map f :=
421422
Set.image_mono
422423

Mathlib/Algebra/Group/Subgroup/Map.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ theorem coe_comap (K : Subgroup N) (f : G →* N) : (K.comap f : Set G) = f ⁻
8282
theorem mem_comap {K : Subgroup N} {f : G →* N} {x : G} : x ∈ K.comap f ↔ f x ∈ K :=
8383
Iff.rfl
8484

85-
@[to_additive]
85+
@[to_additive (attr := gcongr)]
8686
theorem comap_mono {f : G →* N} {K K' : Subgroup N} : K ≤ K' → comap f K ≤ comap f K' :=
8787
preimage_mono
8888

Mathlib/Algebra/Star/NonUnitalSubalgebra.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ def map (f : F) (S : NonUnitalStarSubalgebra R A) : NonUnitalStarSubalgebra R B
343343
toNonUnitalSubalgebra := S.toNonUnitalSubalgebra.map (f : A →ₙₐ[R] B)
344344
star_mem' := by rintro _ ⟨a, ha, rfl⟩; exact ⟨star a, star_mem (s := S) ha, map_star f a⟩
345345

346+
@[gcongr]
346347
theorem map_mono {S₁ S₂ : NonUnitalStarSubalgebra R A} {f : F} :
347348
S₁ ≤ S₂ → (map f S₁ : NonUnitalStarSubalgebra R B) ≤ map f S₂ :=
348349
Set.image_mono

Mathlib/Algebra/Star/Subalgebra.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ theorem map_le_iff_le_comap {S : StarSubalgebra R A} {f : A →⋆ₐ[R] B} {U :
273273
theorem gc_map_comap (f : A →⋆ₐ[R] B) : GaloisConnection (map f) (comap f) := fun _S _U =>
274274
map_le_iff_le_comap
275275

276+
@[gcongr]
276277
theorem comap_mono {S₁ S₂ : StarSubalgebra R B} {f : A →⋆ₐ[R] B} :
277278
S₁ ≤ S₂ → S₁.comap f ≤ S₂.comap f :=
278279
Set.preimage_mono

Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ def comap (S : Subgroupoid D) : Subgroupoid C where
387387
simp only [mem_setOf, Functor.map_comp]
388388
apply S.mul <;> assumption
389389

390+
@[gcongr]
390391
theorem comap_mono (S T : Subgroupoid D) : S ≤ T → comap φ S ≤ comap φ T := fun ST _ =>
391392
@ST ⟨_, _, _⟩
392393

Mathlib/Combinatorics/SimpleGraph/Maps.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ theorem map_adj_apply' {f : V → W} (hadj : G.Adj u v) (hne : f u ≠ f v) :
101101
(G.map f).Adj (f u) (f v) :=
102102
⟨hne, u, v, hadj, rfl, rfl⟩
103103

104+
@[gcongr]
104105
theorem map_monotone (f : V → W) : Monotone (SimpleGraph.map f) := by
105106
rintro G G' h z1 z2 ⟨huv, u, v, ha, rfl, rfl⟩
106107
exact ⟨huv, _, _, h ha, rfl, rfl⟩
@@ -151,6 +152,7 @@ lemma comap_symm (G : SimpleGraph V) (e : V ≃ W) :
151152
lemma map_symm (G : SimpleGraph W) (e : V ≃ W) :
152153
G.map e.symm.toEmbedding = G.comap e.toEmbedding := by rw [← comap_symm, e.symm_symm]
153154

155+
@[gcongr]
154156
theorem comap_monotone (f : V ↪ W) : Monotone (SimpleGraph.comap f) :=
155157
fun _ _ h _ _ ha ↦ h ha
156158

Mathlib/Data/Multiset/MapFold.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ theorem map_lt_map {f : α → β} {s t : Multiset α} (h : s < t) : s.map f < t
183183
rw [← s.card_map f, ← t.card_map f]
184184
exact card_le_card H
185185

186+
@[gcongr]
186187
theorem map_mono (f : α → β) : Monotone (map f) := fun _ _ => map_le_map
187188

189+
@[gcongr]
188190
theorem map_strictMono (f : α → β) : StrictMono (map f) := fun _ _ => map_lt_map
189191

190192
@[simp, gcongr]

Mathlib/FieldTheory/IntermediateField/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ theorem map_map {K L₁ L₂ L₃ : Type*} [Field K] [Field L₁] [Algebra K L
495495
(E.map f).map g = E.map (g.comp f) :=
496496
SetLike.coe_injective <| Set.image_image _ _ _
497497

498+
@[gcongr]
498499
theorem map_mono (f : L →ₐ[K] L') {S T : IntermediateField K L} (h : S ≤ T) :
499500
S.map f ≤ T.map f :=
500501
SetLike.coe_mono (Set.image_mono h)

Mathlib/GroupTheory/FiniteIndexNormalSubgroup.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ theorem toSubgroup_comap (f : G →* H) (K : FiniteIndexNormalSubgroup H) :
138138
((comap f K : FiniteIndexNormalSubgroup G) : Subgroup G) = (K : Subgroup H).comap f :=
139139
rfl
140140

141-
@[to_additive]
141+
@[to_additive (attr := gcongr)]
142142
theorem comap_mono (f : G →* H) {K L : FiniteIndexNormalSubgroup H} (h : K ≤ L) :
143143
comap f K ≤ comap f L :=
144144
fun _ hx ↦ h hx

0 commit comments

Comments
 (0)