Skip to content

Commit

Permalink
chore: bump to nightly-2023-08-17 (#6019)
Browse files Browse the repository at this point in the history
The major change here is adapting to `simp` failing if it makes no progress.
The vast majority of the redundant `simp`s found due to this change were extracted to #6632.



Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: Eric Wieser <[email protected]>
  • Loading branch information
3 people committed Aug 18, 2023
1 parent 971fb7a commit 8c53b71
Show file tree
Hide file tree
Showing 30 changed files with 92 additions and 64 deletions.
3 changes: 1 addition & 2 deletions Mathlib/Algebra/BigOperators/Finprod.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,7 @@ theorem finprod_mem_finset_product' [DecidableEq α] [DecidableEq β] (s : Finse
∀ a,
(∏ i : β in (s.filter fun ab => Prod.fst ab = a).image Prod.snd, f (a, i)) =
(Finset.filter (fun ab => Prod.fst ab = a) s).prod f := by
refine' fun a => Finset.prod_bij (fun b _ => (a, b)) _ _ _ _ <;>-- `finish` closes these goals
try simp; done
refine' fun a => Finset.prod_bij (fun b _ => (a, b)) _ _ _ _ <;> simp
suffices ∀ a' b, (a', b) ∈ s → a' = a → (a, b) ∈ s ∧ a' = a by simpa
rintro a' b hp rfl
exact ⟨hp, rfl⟩
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/CubicDiscriminant.lean
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 } where
-- Porting note: Added `simp only [Nat.zero_eq, Nat.succ_eq_add_one] <;> ring_nf`
-- There's probably a better way to do this.
ext (_ | _ | _ | _ | n) <;> simp only [Nat.zero_eq, Nat.succ_eq_add_one] <;> ring_nf
<;> simp only [coeffs]
<;> try simp only [coeffs]
have h3 : 3 < 4 + n := by linarith only
rw [coeff_eq_zero h3,
(degree_le_iff_coeff_zero (f : R[X]) 3).mp f.2 _ <| WithBot.coe_lt_coe.mpr (by exact h3)]
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Star/CHSH.lean
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ we prepare some easy lemmas about √2.
theorem tsirelson_inequality_aux : √2 * √2 ^ 3 = √2 * (2 * √2⁻¹ + 4 * (√2⁻¹ * 2⁻¹)) := by
ring_nf
rw [mul_inv_cancel (ne_of_gt (Real.sqrt_pos.2 (show (2 : ℝ) > 0 by norm_num)))]
convert congr_arg (· ^ 2) (@Real.sq_sqrt 2 (by norm_num)) using 1 <;> simp only [← pow_mul] <;>
norm_num
convert congr_arg (· ^ 2) (@Real.sq_sqrt 2 (by norm_num)) using 1 <;>
(try simp only [← pow_mul]) <;> norm_num
#align tsirelson_inequality.tsirelson_inequality_aux TsirelsonInequality.tsirelson_inequality_aux

theorem sqrt_two_inv_mul_self : √2⁻¹ * √2⁻¹ = (2⁻¹ : ℝ) := by
Expand Down
6 changes: 2 additions & 4 deletions Mathlib/AlgebraicTopology/SimplexCategory.lean
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ theorem δ_comp_δ {n} {i j : Fin (n + 2)} (H : i ≤ j) :
δ i ≫ δ j.succ = δ j ≫ δ (Fin.castSucc i) := by
ext k
dsimp [δ, Fin.succAbove]
simp only [OrderEmbedding.toOrderHom_coe, OrderEmbedding.coe_ofStrictMono, Function.comp_apply,
SimplexCategory.Hom.toOrderHom_mk, OrderHom.comp_coe]
rcases i with ⟨i, _⟩
rcases j with ⟨j, _⟩
rcases k with ⟨k, _⟩
Expand Down Expand Up @@ -279,7 +277,8 @@ theorem δ_comp_σ_self {n} {i : Fin (n + 1)} :
dsimp [σ, δ, Fin.predAbove, Fin.succAbove]
simp [Fin.lt_iff_val_lt_val, Fin.ite_val, Fin.dite_val]
split_ifs
all_goals try simp <;> linarith
any_goals simp
all_goals linarith
#align simplex_category.δ_comp_σ_self SimplexCategory.δ_comp_σ_self

@[reassoc]
Expand All @@ -296,7 +295,6 @@ theorem δ_comp_σ_succ {n} {i : Fin (n + 1)} : δ i.succ ≫ σ i = 𝟙 ([n] :
rcases i with ⟨i, _⟩
rcases j with ⟨j, _⟩
dsimp [δ, σ, Fin.succAbove, Fin.predAbove]
simp only [Fin.mk_lt_mk]
split_ifs <;> simp <;> simp at * <;> linarith
#align simplex_category.δ_comp_σ_succ SimplexCategory.δ_comp_σ_succ

Expand Down
4 changes: 3 additions & 1 deletion Mathlib/Analysis/Convex/Between.lean
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ theorem right_mem_affineSegment (x y : P) : y ∈ affineSegment R x y :=
theorem affineSegment_same (x : P) : affineSegment R x x = {x} := by
-- porting note: added as this doesn't do anything in `simp_rw` any more
rw [affineSegment]
-- Note: when adding "simp made no progress" in lean4#2336,
-- had to change `lineMap_same` to `lineMap_same _`. Not sure why?
-- porting note: added `_ _` and `Function.const`
simp_rw [lineMap_same, AffineMap.coe_const _ _, Function.const,
simp_rw [lineMap_same _, AffineMap.coe_const _ _, Function.const,
(Set.nonempty_Icc.mpr zero_le_one).image_const]
#align affine_segment_same affineSegment_same

Expand Down
7 changes: 5 additions & 2 deletions Mathlib/Analysis/Convex/Side.lean
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,11 @@ theorem _root_.Wbtw.wOppSide₁₃ {s : AffineSubspace R P} {x y z : P} (h : Wbt
rcases ht0.lt_or_eq with (ht0' | rfl); swap
· rw [lineMap_apply_zero]; simp
refine' Or.inr (Or.inr ⟨1 - t, t, sub_pos.2 ht1', ht0', _⟩)
simp_rw [lineMap_apply, vadd_vsub_assoc, vsub_vadd_eq_vsub_sub, ← neg_vsub_eq_vsub_rev z x,
vsub_self, zero_sub, ← neg_one_smul R (z -ᵥ x), ← add_smul, smul_neg, ← neg_smul, smul_smul]
-- TODO: after lean4#2336 "simp made no progress feature"
-- had to add `_` to several lemmas here. Not sure why!
simp_rw [lineMap_apply _, vadd_vsub_assoc _, vsub_vadd_eq_vsub_sub _,
← neg_vsub_eq_vsub_rev z x, vsub_self _, zero_sub, ← neg_one_smul R (z -ᵥ x),
← add_smul, smul_neg, ← neg_smul, smul_smul]
ring_nf
#align wbtw.w_opp_side₁₃ Wbtw.wOppSide₁₃

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Finsupp/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def update (f : α →₀ M) (a : α) (b : M) : α →₀ M where
classical
simp [Function.update, Ne.def]
split_ifs with hb ha ha <;>
simp only [*, not_false_iff, iff_true, not_true, iff_false]
try simp only [*, not_false_iff, iff_true, not_true, iff_false]
· rw [Finset.mem_erase]
simp
· rw [Finset.mem_erase]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Multiset/Functor.lean
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ theorem fmap_def {α' β'} {s : Multiset α'} (f : α' → β') : f <$> s = s.ma
rfl
#align multiset.fmap_def Multiset.fmap_def

instance : LawfulFunctor Multiset := by refine' { .. } <;> intros <;> simp; rfl
instance : LawfulFunctor Multiset := by refine' { .. } <;> intros <;> (try simp); rfl

open LawfulTraversable CommApplicative

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Num/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ theorem bitwise'_to_nat {f : Num → Num → Num} {g : Bool → Bool → Bool} (
-- Porting note: `change .. with ..` is now `simp only [show .. = .. from rfl]`.
intros m n
cases' m with m <;> cases' n with n <;>
simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
try simp only [show zero = 0 from rfl, show ((0 : Num) : ℕ) = 0 from rfl]
· rw [f00, Nat.bitwise'_zero]; rfl
· unfold Nat.bitwise'
rw [f0n, Nat.binaryRec_zero]
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/UnionFind.lean
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def setParentBump {n} (m : UFModel n) (x y : Fin n)
rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
rank_lt i := by
simp; split <;>
(rename_i h₁; simp [h₁]; split <;> rename_i h₂ <;>
(intro h; simp [h] at h₂ <;> simp [h₁, h₂, h]))
(rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
(intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
· simp [← h₁]; split <;> rename_i h₃
· rw [h₃]; apply Nat.lt_succ_self
· exact lt_of_le_of_ne H h₃
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Vector/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ theorem get_set_of_ne {v : Vector α n} {i j : Fin n} (h : i ≠ j) (a : α) :

theorem get_set_eq_if {v : Vector α n} {i j : Fin n} (a : α) :
(v.set i a).get j = if i = j then a else v.get j := by
split_ifs <;> try simp [*] <;> try rw [get_set_of_ne]; assumption
split_ifs <;> (try simp [*]); rwa [get_set_of_ne]
#align vector.nth_update_nth_eq_if Vector.get_set_eq_if

@[to_additive]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/FieldTheory/RatFunc.lean
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ section TacticInterlude
-- porting note: reimplemented the `frac_tac` and `smul_tac` as close to the originals as I could
/-- Solve equations for `RatFunc K` by working in `FractionRing K[X]`. -/
macro "frac_tac" : tactic => `(tactic| repeat (rintro (⟨⟩ : RatFunc _)) <;>
simp only [← ofFractionRing_zero, ← ofFractionRing_add, ← ofFractionRing_sub,
try simp only [← ofFractionRing_zero, ← ofFractionRing_add, ← ofFractionRing_sub,
← ofFractionRing_neg, ← ofFractionRing_one, ← ofFractionRing_mul, ← ofFractionRing_div,
← ofFractionRing_inv,
add_assoc, zero_add, add_zero, mul_assoc, mul_zero, mul_one, mul_add, inv_zero,
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Init/Algebra/Order.lean
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ theorem compare_gt_iff_gt {a b : α} : (compare a b = .gt) ↔ a > b := by

theorem compare_eq_iff_eq {a b : α} : (compare a b = .eq) ↔ a = b := by
rw [LinearOrder.compare_eq_compareOfLessAndEq, compareOfLessAndEq]
split_ifs <;> simp only []
split_ifs <;> try simp only []
case _ h => exact false_iff_iff.2 <| ne_iff_lt_or_gt.2 <| .inl h
case _ _ h => exact true_iff_iff.2 h
case _ _ h => exact false_iff_iff.2 h
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Logic/Equiv/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ theorem swapCore_swapCore (r a b : α) : swapCore a b (swapCore a b r) = r := by
theorem swapCore_comm (r a b : α) : swapCore a b r = swapCore b a r := by
unfold swapCore
-- Porting note: whatever solution works for `swapCore_swapCore` will work here too.
split_ifs with h₁ h₂ h₃ <;> simp
split_ifs with h₁ h₂ h₃ <;> try simp
· cases h₁; cases h₂; rfl
#align equiv.swap_core_comm Equiv.swapCore_comm

Expand Down
6 changes: 4 additions & 2 deletions Mathlib/Logic/Equiv/LocalEquiv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ elab (name := mfldSetTac) "mfld_set_tac" : tactic => withMainContext do
apply Set.ext; intro my_y
constructor <;>
· intro h_my_y
try (simp only [*, mfld_simps] at h_my_y; simp only [*, mfld_simps]))))
try simp only [*, mfld_simps] at h_my_y
try simp only [*, mfld_simps])))
| (``Subset, #[_ty, _inst, _e₁, _e₂]) =>
evalTactic (← `(tactic| (
intro my_y h_my_y
try (simp only [*, mfld_simps] at h_my_y; simp only [*, mfld_simps]))))
try simp only [*, mfld_simps] at h_my_y
try simp only [*, mfld_simps])))
| _ => throwError "goal should be an equality or an inclusion"

attribute [mfld_simps] and_true eq_self_iff_true Function.comp_apply
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/Liouville/LiouvilleWith.lean
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x := by
rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add',
add_div_eq_mul_add_div _ _ hn'.ne', div_lt_div_right hn']
convert add_lt_add_right ((Int.floor_le (x * n)).trans_lt (lt_add_one _)) 1 using 1 <;>
push_cast <;> ring
(try push_cast) <;> ring
#align liouville_with_one liouvilleWith_one

namespace LiouvilleWith
Expand Down
9 changes: 6 additions & 3 deletions Mathlib/Tactic/CategoryTheory/BicategoryCoherence.lean
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,19 @@ def bicategory_coherence (g : MVarId) : TermElabM Unit := g.withContext do
Use `pure_coherence` instead, which is a frontend to this one. -/
elab "bicategory_coherence" : tactic => do bicategory_coherence (← getMainGoal)

open Lean.Parser.Tactic

/--
Simp lemmas for rewriting a 2-morphism into a normal form.
-/
syntax (name := whisker_simps) "whisker_simps" : tactic
syntax (name := whisker_simps) "whisker_simps" (config)? : tactic

@[inherit_doc whisker_simps]
elab_rules : tactic
| `(tactic| whisker_simps) => do
| `(tactic| whisker_simps $[$cfg]?) => do
evalTactic (← `(tactic|
simp only [Category.assoc, Bicategory.comp_whiskerLeft, Bicategory.id_whiskerLeft,
simp $[$cfg]? only [Category.assoc,
Bicategory.comp_whiskerLeft, Bicategory.id_whiskerLeft,
Bicategory.whiskerRight_comp, Bicategory.whiskerRight_id,
Bicategory.whiskerLeft_comp, Bicategory.whiskerLeft_id,
Bicategory.comp_whiskerRight, Bicategory.id_whiskerRight, Bicategory.whisker_assoc]
Expand Down
11 changes: 6 additions & 5 deletions Mathlib/Tactic/CategoryTheory/Coherence.lean
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ elab (name := liftable_prefixes) "liftable_prefixes" : tactic => do
withOptions (fun opts => synthInstance.maxSize.set opts
(max 256 (synthInstance.maxSize.get opts))) do
evalTactic (← `(tactic|
simp only [monoidalComp, Category.assoc, MonoidalCoherence.hom] <;>
(simp (config := {failIfUnchanged := false}) only
[monoidalComp, Category.assoc, MonoidalCoherence.hom]) <;>
(apply (cancel_epi (𝟙 _)).1 <;> try infer_instance) <;>
simp only [assoc_liftHom, Mathlib.Tactic.BicategoryCoherence.assoc_liftHom₂]))
(simp (config := {failIfUnchanged := false}) only
[assoc_liftHom, Mathlib.Tactic.BicategoryCoherence.assoc_liftHom₂])))

lemma insert_id_lhs {C : Type*} [Category C] {X Y : C} (f g : X ⟶ Y) (w : f ≫ 𝟙 _ = g) :
f = g := by
Expand Down Expand Up @@ -364,8 +366,7 @@ syntax (name := coherence) "coherence" : tactic
elab_rules : tactic
| `(tactic| coherence) => do
evalTactic (← `(tactic|
simp only [bicategoricalComp];
simp only [monoidalComp];
try whisker_simps
(simp (config := {failIfUnchanged := false}) only [bicategoricalComp, monoidalComp]);
whisker_simps (config := {failIfUnchanged := false})
))
coherence_loop
2 changes: 1 addition & 1 deletion Mathlib/Tactic/DeriveTraversable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def deriveLawfulTraversable (m : MVarId) : TermElabM Unit := do
if b then
let hs ← getPropHyps
s ← hs.foldlM (fun s f => f.getDecl >>= fun d => s.add (.fvar f) #[] d.toExpr) s
return { simpTheorems := #[s] }
return { config := { failIfUnchanged := false }, simpTheorems := #[s] }
let .app (.app (.const ``LawfulTraversable _) F) _ ← m.getType >>= instantiateMVars | failure
let some n := F.getAppFn.constName? | failure
let [mit, mct, mtmi, mn] ← m.applyConst ``LawfulTraversable.mk | failure
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Tactic/Group.lean
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ syntax (name := aux_group₁) "aux_group₁" (location)? : tactic

macro_rules
| `(tactic| aux_group₁ $[at $location]?) =>
`(tactic| simp (config := {decide := false}) only
`(tactic| simp (config := {decide := false, failIfUnchanged := false}) only
[commutatorElement_def, mul_one, one_mul,
←zpow_neg_one, ←zpow_ofNat, ←zpow_mul,
Int.ofNat_add, Int.ofNat_mul,
Expand Down
5 changes: 3 additions & 2 deletions Mathlib/Tactic/Lift.lean
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ def Lift.main (e t : TSyntax `term) (hUsing : Option (TSyntax `term))
if decl.userName != newEqName then
let declIdent := mkIdent decl.userName
-- The line below fails if $declIdent is there only once.
evalTactic (← `(tactic| simp only [← $newEqIdent] at $declIdent $declIdent))
evalTactic (← `(tactic| simp only [← $newEqIdent]))
evalTactic (← `(tactic| simp (config := {failIfUnchanged := false})
only [← $newEqIdent] at $declIdent $declIdent))
evalTactic (← `(tactic| simp (config := {failIfUnchanged := false}) only [← $newEqIdent]))
-- Clear the temporary hypothesis used for the new variable name if applicable
if isNewVar && !isNewEq then
evalTactic (← `(tactic| clear $newEqIdent))
Expand Down
28 changes: 15 additions & 13 deletions Mathlib/Tactic/NoncommRing.lean
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ by noncomm_ring
syntax (name := noncomm_ring) "noncomm_ring" : tactic
macro_rules
| `(tactic| noncomm_ring) => `(tactic| (
simp only [ -- Expand everything out.
add_mul, mul_add, sub_eq_add_neg,
-- Right associate all products.
mul_assoc,
-- Expand powers to numerals.
pow_one, pow_zero, pow_succ,
-- Replace multiplication by numerals with `zsmul`.
one_mul, mul_one, zero_mul, mul_zero,
nat_lit_mul_eq_nsmul, mul_nat_lit_eq_nsmul,
-- Pull `zsmul n` out the front so `abel` can see them.
mul_smul_comm, smul_mul_assoc,
-- Pull out negations.
neg_mul, mul_neg ] <;>
(first | simp only [
-- Expand everything out.
add_mul, mul_add, sub_eq_add_neg,
-- Right associate all products.
mul_assoc,
-- Expand powers to numerals.
pow_one, pow_zero, pow_succ,
-- Replace multiplication by numerals with `zsmul`.
one_mul, mul_one, zero_mul, mul_zero,
nat_lit_mul_eq_nsmul, mul_nat_lit_eq_nsmul,
-- Pull `zsmul n` out the front so `abel` can see them.
mul_smul_comm, smul_mul_assoc,
-- Pull out negations.
neg_mul, mul_neg] |
fail "`noncomm_ring` simp lemmas don't apply; try `abel` instead") <;>
first | abel1 | abel_nf ))

end Mathlib.Tactic.NoncommRing
1 change: 1 addition & 0 deletions Mathlib/Tactic/NormCast/Tactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ syntax (name := pushCast) "push_cast " (config)? (discharger)? (&" only")?
@[tactic pushCast] def evalPushCast : Tactic := fun stx ↦ do
let { ctx, dischargeWrapper, .. } ← withMainContext do
mkSimpContext' (← pushCastExt.getTheorems) stx (eraseLocal := false)
let ctx := { ctx with config := { ctx.config with failIfUnchanged := false } }
dischargeWrapper.with fun discharge? ↦
discard <| simpLocation ctx discharge? (expandOptLocation stx[5])

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Tactic/SimpRw.lean
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ by simp_rw [h1, h2]
```
-/
elab s:"simp_rw " rws:rwRuleSeq g:(location)? : tactic => do
evalTactic (← `(tactic| simp%$s only $g ?))
evalTactic (← `(tactic| simp%$s (config := { failIfUnchanged := false }) only $g ?))
withSimpRWRulesSeq s rws fun symm term => do
evalTactic (← match term with
| `(term| $e:term) =>
Expand Down
1 change: 1 addition & 0 deletions Mathlib/Tactic/SplitIfs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private def discharge? (e : Expr) : SimpM (Option Expr) := do
-/
private def reduceIfsAt (loc : Location) : TacticM Unit := do
let ctx ← SplitIf.getSimpContext
let ctx := { ctx with config := { ctx.config with failIfUnchanged := false } }
let _ ← simpLocation ctx discharge? loc
pure ()

Expand Down
3 changes: 2 additions & 1 deletion Mathlib/Topology/MetricSpace/Infsep.lean
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ theorem einfsep_insert_le : (insert x s).einfsep ≤ ⨅ (y ∈ s) (_ : x ≠ y)

theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
rintro a (rfl | rfl) b (rfl | rfl) hab <;> simp only [le_refl, true_or, or_true] <;> contradiction
rintro a (rfl | rfl) b (rfl | rfl) hab <;> (try simp only [le_refl, true_or, or_true]) <;>
contradiction
#align set.le_einfsep_pair Set.le_einfsep_pair

theorem einfsep_pair_le_left (hxy : x ≠ y) : ({x, y} : Set α).einfsep ≤ edist x y :=
Expand Down
26 changes: 18 additions & 8 deletions lake-manifest.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
{"version": 4,
{"version": 5,
"packagesDir": "lake-packages",
"packages":
[{"git":
{"url": "https://github.com/EdAyers/ProofWidgets4",
"subDir?": null,
"rev": "a0c2cd0ac3245a0dade4f925bcfa97e06dd84229",
"opts": {},
"name": "proofwidgets",
"inputRev?": "v0.0.13"}},
"inputRev?": "v0.0.13",
"inherited": false}},
{"git":
{"url": "https://github.com/mhuisi/lean4-cli.git",
"subDir?": null,
"rev": "5a858c32963b6b19be0d477a30a1f4b6c120be7e",
"opts": {},
"name": "Cli",
"inputRev?": "nightly"}},
"inputRev?": "nightly",
"inherited": false}},
{"git":
{"url": "https://github.com/gebner/quote4",
"subDir?": null,
"rev": "81cc13c524a68d0072561dbac276cd61b65872a6",
"opts": {},
"name": "Qq",
"inputRev?": "master"}},
"inputRev?": "master",
"inherited": false}},
{"git":
{"url": "https://github.com/JLimperg/aesop",
"subDir?": null,
"rev": "d13a9666e6f430b940ef8d092f1219e964b52a09",
"rev": "086c98bb129ca856381d4414dc0afd6e3e4ae2ef",
"opts": {},
"name": "aesop",
"inputRev?": "master"}},
"inputRev?": "master",
"inherited": false}},
{"git":
{"url": "https://github.com/leanprover/std4",
"subDir?": null,
"rev": "8b864260672b21d964d79ecb2376e01d0eab9f5b",
"rev": "49353fa54abdac7221fe27f7b57a6ed9ff559d5c",
"opts": {},
"name": "std",
"inputRev?": "main"}}]}
"inputRev?": "main",
"inherited": false}}]}
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2023-08-15
leanprover/lean4:nightly-2023-08-17
7 changes: 6 additions & 1 deletion test/NoncommRing.lean
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@ example : ⁅a, b ⚬ c⁆ = ⁅a, b⁆ ⚬ c + b ⚬ ⁅a, c⁆ := by noncomm_r
example : ⁅a ⚬ b, c⁆ = a ⚬ ⁅b, c⁆ + ⁅a, c⁆ ⚬ b := by noncomm_ring
example : (a ⚬ b) ⚬ c - a ⚬ (b ⚬ c) = -⁅⁅a, b⁆, c⁆ + ⁅a, ⁅b, c⁆⁆ := by noncomm_ring

example : a + -b = -b + a := by noncomm_ring
example : a + -b = -b + a := by
-- This should print "`noncomm_ring` simp lemmas don't apply; try `abel` instead"
-- but I don't know how to test for this:
-- See https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60fail.60.20that.20doesn't.20print.20the.20goal.3F/near/382280010
fail_if_success noncomm_ring
abel
example : a ^ 50 * a ^ 37 = a ^ 23 * a ^ 64 := by noncomm_ring
Loading

0 comments on commit 8c53b71

Please sign in to comment.