Skip to content

Commit

Permalink
feat(Data.Set.Basic/Data.Finset.Basic): rename insert_subset (#5450)
Browse files Browse the repository at this point in the history
Currently, (for both `Set` and `Finset`) `insert_subset` is an `iff` lemma stating that `insert a s ⊆ t` if and only if `a ∈ t` and `s ⊆ t`. For both types, this PR renames this lemma to `insert_subset_iff`, and adds an `insert_subset` lemma that gives the implication just in the reverse direction : namely `theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t` . 

This both aligns the naming with `union_subset` and `union_subset_iff`, and removes the need for the awkward `insert_subset.mpr ⟨_,_⟩` idiom. It touches a lot of files (too many to list), but in a trivial way.
  • Loading branch information
apnelson1 authored and kbuzzard committed Jul 6, 2023
1 parent c43889d commit 3c21b20
Show file tree
Hide file tree
Showing 43 changed files with 99 additions and 78 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Algebra/BigOperators/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
(hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : (∏ x in s, f x) = f a * f b := by
haveI := Classical.decEq α; let s' := ({a, b} : Finset α)
have hu : s' ⊆ s := by
refine' insert_subset.mpr _
refine' insert_subset_iff.mpr _
apply And.intro ha
apply singleton_subset_iff.mpr hb
have hf : ∀ c ∈ s, c ∉ s' → f c = 1 := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/BigOperators/Order.lean
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ theorem prod_lt_prod_of_subset' (h : s ⊆ t) {i : ι} (ht : i ∈ t) (hs : i
exact lt_mul_of_one_lt_left' (∏ j in s, f j) hlt
_ ≤ ∏ j in t, f j := by
apply prod_le_prod_of_subset_of_one_le'
· simp [Finset.insert_subset, h, ht]
· simp [Finset.insert_subset_iff, h, ht]
· intro x hx h'x
simp only [mem_insert, not_or] at h'x
exact hle x hx h'x.2
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/BoxIntegral/Partition/Split.lean
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ a box `I` into subboxes. Let `Js` be one of them. If `J` and `Js` have nonempty
theorem not_disjoint_imp_le_of_subset_of_mem_splitMany {I J Js : Box ι} {s : Finset (ι × ℝ)}
(H : ∀ i, {(i, J.lower i), (i, J.upper i)} ⊆ s) (HJs : Js ∈ splitMany I s)
(Hn : ¬Disjoint (J : WithBot (Box ι)) Js) : Js ≤ J := by
simp only [Finset.insert_subset, Finset.singleton_subset_iff] at H
simp only [Finset.insert_subset_iff, Finset.singleton_subset_iff] at H
rcases Box.not_disjoint_coe_iff_nonempty_inter.mp Hn with ⟨x, hx, hxs⟩
refine' fun y hy i => ⟨_, _⟩
· rcases splitMany_le_split I (H i).1 HJs with ⟨Jl, Hmem : Jl ∈ split I i (J.lower i), Hle⟩
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Convex/Between.lean
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ theorem sbtw_of_sbtw_of_sbtw_of_mem_affineSpan_pair [NoZeroSMulDivisors R V]
refine' affineSpan_pair_le_of_mem_of_mem (mem_affineSpan R (Set.mem_range_self _)) _
have hle : line[R, t.points i₂, t.points i₃] ≤ affineSpan R (Set.range t.points) := by
refine' affineSpan_mono R _
simp [Set.insert_subset]
simp [Set.insert_subset_iff]
rw [AffineSubspace.le_def'] at hle
exact hle _ h₁.wbtw.mem_affineSpan
rw [AffineSubspace.le_def'] at hle
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Convex/Hull.lean
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ theorem convexHull_singleton (x : E) : convexHull 𝕜 ({x} : Set E) = {x} :=
theorem convexHull_pair (x y : E) : convexHull 𝕜 {x, y} = segment 𝕜 x y := by
refine (convexHull_min ?_ <| convex_segment _ _).antisymm
(segment_subset_convexHull (mem_insert _ _) <| subset_insert _ _ <| mem_singleton _)
rw [insert_subset, singleton_subset_iff]
rw [insert_subset_iff, singleton_subset_iff]
exact ⟨left_mem_segment _ _ _, right_mem_segment _ _ _⟩
#align convex_hull_pair convexHull_pair

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/Convex/Segment.lean
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ theorem segment_same (x : E) : [x -[𝕜] x] = {x} :=

theorem insert_endpoints_openSegment (x y : E) :
insert x (insert y (openSegment 𝕜 x y)) = [x -[𝕜] y] := by
simp only [subset_antisymm_iff, insert_subset, left_mem_segment, right_mem_segment,
simp only [subset_antisymm_iff, insert_subset_iff, left_mem_segment, right_mem_segment,
openSegment_subset_segment, true_and_iff]
rintro z ⟨a, b, ha, hb, hab, rfl⟩
refine' hb.eq_or_gt.imp _ fun hb' => ha.eq_or_gt.imp _ fun ha' => _
Expand All @@ -160,7 +160,7 @@ theorem mem_openSegment_of_ne_left_right (hx : x ≠ z) (hy : y ≠ z) (hz : z

theorem openSegment_subset_iff_segment_subset (hx : x ∈ s) (hy : y ∈ s) :
openSegment 𝕜 x y ⊆ s ↔ [x -[𝕜] y] ⊆ s := by
simp only [← insert_endpoints_openSegment, insert_subset, *, true_and_iff]
simp only [← insert_endpoints_openSegment, insert_subset_iff, *, true_and_iff]
#align open_segment_subset_iff_segment_subset openSegment_subset_iff_segment_subset

end Module
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Convex/StoneSeparation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ theorem exists_convex_convex_compl_subset (hs : Convex 𝕜 s) (ht : Convex 𝕜
refine'
not_disjoint_segment_convexHull_triple hz hu hv
(hC.2.symm.mono (ht.segment_subset hut hvt) <| convexHull_min _ hC.1)
simpa [insert_subset, hp, hq, singleton_subset_iff.2 hzC]
simpa [insert_subset_iff, hp, hq, singleton_subset_iff.2 hzC]
rintro c hc
by_contra' h
suffices h : Disjoint (convexHull 𝕜 (insert c C)) t
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Convex/Topology.lean
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ protected theorem Convex.strictConvex' {s : Set E} (hs : Convex 𝕜 s)
by_cases hy' : y ∈ interior s
· exact hs.openSegment_self_interior_subset_interior hx hy'
rcases h ⟨hx, hx'⟩ ⟨hy, hy'⟩ hne with ⟨c, hc⟩
refine' (openSegment_subset_union x y ⟨c, rfl⟩).trans (insert_subset.2 ⟨hc, union_subset _ _⟩)
refine' (openSegment_subset_union x y ⟨c, rfl⟩).trans (insert_subset_iff.2 ⟨hc, union_subset _ _⟩)
exacts [hs.openSegment_self_interior_subset_interior hx hc,
hs.openSegment_interior_self_subset_interior hc hy]
#align convex.strict_convex' Convex.strictConvex'
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/Additive/RuzsaCovering.lean
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ theorem exists_subset_mul_div (ht : t.Nonempty) :
· exact subset_mul_left _ ht.one_mem_div hau
by_cases H : ∀ b ∈ u, Disjoint (a • t) (b • t)
· refine' (hCmax _ _ <| ssubset_insert hau).elim
rw [mem_filter, mem_powerset, insert_subset, coe_insert]
rw [mem_filter, mem_powerset, insert_subset_iff, coe_insert]
exact ⟨⟨ha, hu.1⟩, hu.2.insert fun _ hb _ ↦ H _ hb⟩
push_neg at H
simp_rw [not_disjoint_iff, ← inv_smul_mem_iff] at H
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ theorem Adj.card_commonNeighbors_lt_degree {G : SimpleGraph V} [DecidableRel G.A
rw [Finset.ssubset_iff]
use w
constructor
· rw [Finset.insert_subset]
· rw [Finset.insert_subset_iff]
constructor
· simpa
· rw [neighborFinset, Set.toFinset_subset_toFinset]
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Computability/TMToPartrec.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ theorem trStmts₁_supports {S q} (H₁ : (q : Λ').Supports S) (HS₁ : trStmts
induction' q with _ _ _ q q_ih _ _ q q_ih q q_ih _ _ q q_ih q q_ih q q_ih q₁ q₂ q₁_ih q₂_ih _ <;>
simp [trStmts₁, -Finset.singleton_subset_iff] at HS₁ ⊢
any_goals
cases' Finset.insert_subset.1 HS₁ with h₁ h₂
cases' Finset.insert_subset_iff.1 HS₁ with h₁ h₂
first | have h₃ := h₂ W | try simp [Finset.subset_iff] at h₂
· exact supports_insert.2 ⟨⟨fun _ => h₃, fun _ => h₁⟩, q_ih H₁ h₂⟩ -- move
· exact supports_insert.2 ⟨⟨fun _ => h₃, fun _ => h₁⟩, q_ih H₁ h₂⟩ -- clear
Expand Down Expand Up @@ -2033,7 +2033,7 @@ theorem codeSupp'_supports {S c k} (H : codeSupp c k ⊆ S) : Supports (codeSupp
refine' supports_union.2 ⟨IHf H'.2, _⟩
refine' trStmts₁_supports' (trNormal_supports _) (Finset.union_subset_right h) fun _ => _
· simp only [codeSupp', codeSupp, Finset.union_subset_iff, contSupp, trStmts₁,
Finset.insert_subset] at h H ⊢
Finset.insert_subset_iff] at h H ⊢
exact ⟨h.1, ⟨H.1.1, h⟩, H.2
exact supports_singleton.2 (ret_supports <| Finset.union_subset_right H)
#align turing.partrec_to_TM2.code_supp'_supports Turing.PartrecToTM2.codeSupp'_supports
Expand Down
16 changes: 10 additions & 6 deletions Mathlib/Data/Finset/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,8 @@ theorem eq_singleton_or_nontrivial (ha : a ∈ s) : s = {a} ∨ (s : Set α).Non
theorem Nonempty.exists_eq_singleton_or_nontrivial :
s.Nonempty → (∃ a, s = {a}) ∨ (s : Set α).Nontrivial := fun ⟨a, ha⟩ =>
(eq_singleton_or_nontrivial ha).imp_left <| Exists.intro a
#align finset.nonempty.exists_eq_singleton_or_nontrivial Finset.Nonempty.exists_eq_singleton_or_nontrivial
#align finset.nonempty.exists_eq_singleton_or_nontrivial
Finset.Nonempty.exists_eq_singleton_or_nontrivial

instance [Nonempty α] : Nontrivial (Finset α) :=
‹Nonempty α›.elim fun a => ⟨⟨{a}, ∅, singleton_ne_empty _⟩⟩
Expand Down Expand Up @@ -1163,15 +1164,18 @@ theorem ne_insert_of_not_mem (s t : Finset α) {a : α} (h : a ∉ s) : s ≠ in
simp [h]
#align finset.ne_insert_of_not_mem Finset.ne_insert_of_not_mem

theorem insert_subset : insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t := by
theorem insert_subset_iff : insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t := by
simp only [subset_iff, mem_insert, forall_eq, or_imp, forall_and]
#align finset.insert_subset Finset.insert_subset
#align finset.insert_subset Finset.insert_subset_iff

theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t :=
insert_subset_iff.mpr ⟨ha,hs⟩

theorem subset_insert (a : α) (s : Finset α) : s ⊆ insert a s := fun _b => mem_insert_of_mem
#align finset.subset_insert Finset.subset_insert

theorem insert_subset_insert (a : α) {s t : Finset α} (h : s ⊆ t) : insert a s ⊆ insert a t :=
insert_subset.2 ⟨mem_insert_self _ _, Subset.trans h (subset_insert _ _)⟩
insert_subset_iff.2 ⟨mem_insert_self _ _, Subset.trans h (subset_insert _ _)⟩
#align finset.insert_subset_insert Finset.insert_subset_insert

theorem insert_inj (ha : a ∉ s) : insert a s = insert b s ↔ a = b :=
Expand Down Expand Up @@ -1236,7 +1240,7 @@ theorem induction_on' {α : Type _} {p : Finset α → Prop} [DecidableEq α] (S
(h₂ : ∀ {a s}, a ∈ S → s ⊆ S → a ∉ s → p s → p (insert a s)) : p S :=
@Finset.induction_on α (fun T => T ⊆ S → p T) _ S (fun _ => h₁)
(fun _ _ has hqs hs =>
let ⟨hS, sS⟩ := Finset.insert_subset.1 hs
let ⟨hS, sS⟩ := Finset.insert_subset_iff.1 hs
h₂ hS sS has (hqs sS))
(Finset.Subset.refl S)
#align finset.induction_on' Finset.induction_on'
Expand Down Expand Up @@ -1545,7 +1549,7 @@ theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type
obtain ⟨j, hbj⟩ : ∃ j, b ∈ f j := by simpa [Set.mem_iUnion₂] using hbtc (t.mem_insert_self b)
rcases h j i with ⟨k, hk, hk'⟩
use k
rw [coe_insert, Set.insert_subset]
rw [coe_insert, Set.insert_subset_iff]
exact ⟨hk hbj, _root_.trans hti hk'⟩
#align directed.exists_mem_subset_of_finset_subset_bUnion Directed.exists_mem_subset_of_finset_subset_biUnion

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/Finset/NAry.lean
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ theorem subset_image₂ {s : Set α} {t : Set β} (hu : ↑u ⊆ image2 f s t) :
haveI := Classical.decEq α
haveI := Classical.decEq β
refine' ⟨insert x s', insert y t', _⟩
simp_rw [coe_insert, Set.insert_subset]
simp_rw [coe_insert, Set.insert_subset_iff]
exact
⟨⟨hx, hs⟩, ⟨hy, hs'⟩,
insert_subset.2
insert_subset_iff.2
⟨mem_image₂.2 ⟨x, y, mem_insert_self _ _, mem_insert_self _ _, ha⟩,
h.trans <| image₂_subset (subset_insert _ _) <| subset_insert _ _⟩⟩
#align finset.subset_image₂ Finset.subset_image₂
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/Polynomial/Coeff.lean
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ open Finset
theorem support_binomial {k m : ℕ} (hkm : k ≠ m) {x y : R} (hx : x ≠ 0) (hy : y ≠ 0) :
support (C x * X ^ k + C y * X ^ m) = {k, m} := by
apply subset_antisymm (support_binomial' k m x y)
simp_rw [insert_subset, singleton_subset_iff, mem_support_iff, coeff_add, coeff_C_mul,
simp_rw [insert_subset_iff, singleton_subset_iff, mem_support_iff, coeff_add, coeff_C_mul,
coeff_X_pow_self, mul_one, coeff_X_pow, if_neg hkm, if_neg hkm.symm, mul_zero, zero_add,
add_zero, Ne.def, hx, hy]
#align polynomial.support_binomial Polynomial.support_binomial
Expand All @@ -206,7 +206,7 @@ theorem support_trinomial {k m n : ℕ} (hkm : k < m) (hmn : m < n) {x y z : R}
(hy : y ≠ 0) (hz : z ≠ 0) :
support (C x * X ^ k + C y * X ^ m + C z * X ^ n) = {k, m, n} := by
apply subset_antisymm (support_trinomial' k m n x y z)
simp_rw [insert_subset, singleton_subset_iff, mem_support_iff, coeff_add, coeff_C_mul,
simp_rw [insert_subset_iff, singleton_subset_iff, mem_support_iff, coeff_add, coeff_C_mul,
coeff_X_pow_self, mul_one, coeff_X_pow, if_neg hkm.ne, if_neg hkm.ne', if_neg hmn.ne,
if_neg hmn.ne', if_neg (hkm.trans hmn).ne, if_neg (hkm.trans hmn).ne', mul_zero, add_zero,
zero_add, Ne.def, hx, hy, hz]
Expand Down
15 changes: 9 additions & 6 deletions Mathlib/Data/Set/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,12 @@ theorem insert_ne_self : insert a s ≠ s ↔ a ∉ s :=
insert_eq_self.not
#align set.insert_ne_self Set.insert_ne_self

theorem insert_subset : insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t := by
theorem insert_subset_iff : insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t := by
simp only [subset_def, mem_insert_iff, or_imp, forall_and, forall_eq]
#align set.insert_subset Set.insert_subset
#align set.insert_subset Set.insert_subset_iff

theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t :=
insert_subset_iff.mpr ⟨ha, hs⟩

theorem insert_subset_insert (h : s ⊆ t) : insert a s ⊆ insert a t := fun _ => Or.imp_right (@h _)
#align set.insert_subset_insert Set.insert_subset_insert
Expand All @@ -1171,7 +1174,7 @@ theorem subset_insert_iff_of_not_mem (ha : a ∉ s) : s ⊆ insert a t ↔ s ⊆
#align set.subset_insert_iff_of_not_mem Set.subset_insert_iff_of_not_mem

theorem ssubset_iff_insert {s t : Set α} : s ⊂ t ↔ ∃ (a : α) (_ : a ∉ s), insert a s ⊆ t := by
simp only [insert_subset, exists_and_right, ssubset_def, not_subset]
simp only [insert_subset_iff, exists_and_right, ssubset_def, not_subset]
simp only [exists_prop, and_comm]
#align set.ssubset_iff_insert Set.ssubset_iff_insert

Expand Down Expand Up @@ -1390,8 +1393,8 @@ theorem pair_comm (a b : α) : ({a, b} : Set α) = {b, a} :=
-- Porting note: first branch after `constructor` used to be by `tauto!`.
theorem pair_eq_pair_iff {x y z w : α} :
({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
simp only [Set.Subset.antisymm_iff, Set.insert_subset, Set.mem_insert_iff, Set.mem_singleton_iff,
Set.singleton_subset_iff]
simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
Set.mem_singleton_iff, Set.singleton_subset_iff]
constructor
· rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> simp [h₁, h₂] at * <;> simp [h₁, h₂]
· rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) <;> simp
Expand Down Expand Up @@ -2474,7 +2477,7 @@ theorem nontrivial_of_pair_subset {x y} (hxy : x ≠ y) (h : {x, y} ⊆ s) : s.N

theorem Nontrivial.pair_subset (hs : s.Nontrivial) : ∃ (x y : _) (_ : x ≠ y), {x, y} ⊆ s :=
let ⟨x, hx, y, hy, hxy⟩ := hs
⟨x, y, hxy, insert_subset.2 ⟨hx, singleton_subset_iff.2 hy⟩⟩
⟨x, y, hxy, insert_subset_iff.2 ⟨hx, singleton_subset_iff.2 hy⟩⟩
#align set.nontrivial.pair_subset Set.Nontrivial.pair_subset

theorem nontrivial_iff_pair_subset : s.Nontrivial ↔ ∃ (x y : _) (_ : x ≠ y), {x, y} ⊆ s :=
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/Finite.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ theorem Finite.induction_on' {C : Set α → Prop} {S : Set α} (h : S.Finite) (
(H1 : ∀ {a s}, a ∈ S → s ⊆ S → a ∉ s → C s → C (insert a s)) : C S := by
refine' @Set.Finite.induction_on α (fun s => s ⊆ S → C s) S h (fun _ => H0) _ Subset.rfl
intro a s has _ hCs haS
rw [insert_subset] at haS
rw [insert_subset_iff] at haS
exact H1 haS.1 haS.2 has (hCs haS.2)
#align set.finite.induction_on' Set.Finite.induction_on'

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/Intervals/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ theorem Icc_diff_Ioc_same (h : a ≤ b) : Icc a b \ Ioc a b = {a} := by
@[simp]
theorem Icc_diff_Ioo_same (h : a ≤ b) : Icc a b \ Ioo a b = {a, b} := by
rw [← Icc_diff_both, diff_diff_cancel_left]
simp [insert_subset, h]
simp [insert_subset_iff, h]
#align set.Icc_diff_Ioo_same Set.Icc_diff_Ioo_same

@[simp]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/Intervals/OrdConnected.lean
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ theorem ordConnected_of_Ioo {α : Type _} [PartialOrder α] {s : Set α}
intro x hx y hy hxy
rcases eq_or_lt_of_le hxy with (rfl | hxy'); · simpa
rw [← Ioc_insert_left hxy, ← Ioo_insert_right hxy']
exact insert_subset.2 ⟨hx, insert_subset.2 ⟨hy, hs x hx y hy hxy'⟩⟩
exact insert_subset_iff.2 ⟨hx, insert_subset_iff.2 ⟨hy, hs x hx y hy hxy'⟩⟩
#align set.ord_connected_of_Ioo Set.ordConnected_of_Ioo

theorem OrdConnected.preimage_mono {f : β → α} (hs : OrdConnected s) (hf : Monotone f) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/List.lean
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x |

theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) := by
rw [← range_list_nthLe, ← range_comp]
refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset.2 ⟨_, _⟩)
refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset_iff.2 ⟨_, _⟩)
exacts [(le_or_lt l.length n).imp get?_eq_none.2 (fun hlt => ⟨⟨_, hlt⟩, (get?_eq_get hlt).symm⟩),
⟨_, get?_eq_none.2 le_rfl⟩, range_subset_iff.2 <| fun k => ⟨_, get?_eq_get _⟩]
#align set.range_list_nth Set.range_list_get?
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/FieldTheory/Adjoin.lean
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ theorem adjoin_insert_adjoin (x : E) :
adjoin F (insert x (adjoin F S : Set E)) = adjoin F (insert x S) :=
le_antisymm
(adjoin_le_iff.mpr
(Set.insert_subset.mpr
(Set.insert_subset_iff.mpr
⟨subset_adjoin _ _ (Set.mem_insert _ _),
adjoin_le_iff.mpr (subset_adjoin_of_subset_right _ _ (Set.subset_insert _ _))⟩))
(adjoin.mono _ _ _ (Set.insert_subset_insert (subset_adjoin _ _)))
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Geometry/Euclidean/Angle/Sphere.lean
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ theorem Cospherical.two_zsmul_oangle_eq {p₁ p₂ p₃ p₄ : P}
(h : Cospherical ({p₁, p₂, p₃, p₄} : Set P)) (hp₂p₁ : p₂ ≠ p₁) (hp₂p₄ : p₂ ≠ p₄)
(hp₃p₁ : p₃ ≠ p₁) (hp₃p₄ : p₃ ≠ p₄) : (2 : ℤ) • ∡ p₁ p₂ p₄ = (2 : ℤ) • ∡ p₁ p₃ p₄ := by
obtain ⟨s, hs⟩ := cospherical_iff_exists_sphere.1 h
simp_rw [Set.insert_subset, Set.singleton_subset_iff, Sphere.mem_coe] at hs
simp_rw [Set.insert_subset_iff, Set.singleton_subset_iff, Sphere.mem_coe] at hs
exact Sphere.two_zsmul_oangle_eq hs.1 hs.2.1 hs.2.2.1 hs.2.2.2 hp₂p₁ hp₂p₄ hp₃p₁ hp₃p₄
#align euclidean_geometry.cospherical.two_zsmul_oangle_eq EuclideanGeometry.Cospherical.two_zsmul_oangle_eq

Expand Down Expand Up @@ -374,7 +374,7 @@ theorem cospherical_of_two_zsmul_oangle_eq_of_not_collinear {p₁ p₂ p₃ p₄
let t₂ : Affine.Triangle ℝ P := ⟨![p₁, p₃, p₄], affineIndependent_iff_not_collinear_set.2 hn'⟩
rw [cospherical_iff_exists_sphere]
refine' ⟨t₂.circumsphere, _⟩
simp_rw [Set.insert_subset, Set.singleton_subset_iff]
simp_rw [Set.insert_subset_iff, Set.singleton_subset_iff]
refine' ⟨t₂.mem_circumsphere 0, _, t₂.mem_circumsphere 1, t₂.mem_circumsphere 2
rw [Affine.Triangle.circumsphere_eq_circumsphere_of_eq_of_eq_of_two_zsmul_oangle_eq
(by decide : (0 : Fin 3) ≠ 1) (by decide : (0 : Fin 3) ≠ 2) (by decide)
Expand Down Expand Up @@ -404,7 +404,7 @@ theorem cospherical_or_collinear_of_two_zsmul_oangle_eq {p₁ p₂ p₃ p₄ : P
let t : Affine.Triangle ℝ P := ⟨![p₂, p₃, p₄], affineIndependent_iff_not_collinear_set.2 hl⟩
rw [cospherical_iff_exists_sphere]
refine' ⟨t.circumsphere, _⟩
simp_rw [Set.insert_subset, Set.singleton_subset_iff]
simp_rw [Set.insert_subset_iff, Set.singleton_subset_iff]
exact ⟨t.mem_circumsphere 0, t.mem_circumsphere 1, t.mem_circumsphere 2
have hc' : Collinear ℝ ({p₁, p₃, p₄} : Set P) := by
rwa [← collinear_iff_of_two_zsmul_oangle_eq h]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Geometry/Euclidean/Sphere/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ theorem Cospherical.affineIndependent_of_mem_of_ne {s : Set P} (hs : Cospherical
(h₁ : p₁ ∈ s) (h₂ : p₂ ∈ s) (h₃ : p₃ ∈ s) (h₁₂ : p₁ ≠ p₂) (h₁₃ : p₁ ≠ p₃) (h₂₃ : p₂ ≠ p₃) :
AffineIndependent ℝ ![p₁, p₂, p₃] := by
refine' hs.affineIndependent _ _
· simp [h₁, h₂, h₃, Set.insert_subset]
· simp [h₁, h₂, h₃, Set.insert_subset_iff]
· erw [Fin.cons_injective_iff, Fin.cons_injective_iff]
simp [h₁₂, h₁₃, h₂₃, Function.Injective]
#align euclidean_geometry.cospherical.affine_independent_of_mem_of_ne EuclideanGeometry.Cospherical.affineIndependent_of_mem_of_ne
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/GroupTheory/Perm/Cycle/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ theorem closure_cycle_coprime_swap {n : ℕ} {σ : Perm α} (h0 : Nat.coprime n
have h1' : IsCycle ((σ ^ n) ^ (m : ℤ)) := by rwa [← hm] at h1
replace h1' : IsCycle (σ ^ n) :=
h1'.of_pow (le_trans (support_pow_le σ n) (ge_of_eq (congr_arg support hm)))
rw [eq_top_iff, ← closure_cycle_adjacent_swap h1' h2' x, closure_le, Set.insert_subset]
rw [eq_top_iff, ← closure_cycle_adjacent_swap h1' h2' x, closure_le, Set.insert_subset_iff]
exact
⟨Subgroup.pow_mem (closure _) (subset_closure (Set.mem_insert σ _)) n,
Set.singleton_subset_iff.mpr (subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)))⟩
Expand Down

0 comments on commit 3c21b20

Please sign in to comment.