Skip to content

Commit

Permalink
chore: adaptations for leanprover/lean4#2973 (#9161)
Browse files Browse the repository at this point in the history
This is a PR to Mathlib's `bump/v4.5.0` branch, containing adaptations required for leanprover/lean4#2973, which landed in `leanprover/lean4:nightly-2023-12-19` and will become part of `v4.5.0-rc1` soon.



Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
  • Loading branch information
3 people committed Dec 21, 2023
1 parent 043df18 commit 5e6437b
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 19 deletions.
1 change: 0 additions & 1 deletion Mathlib/Data/List/Func.lean
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ theorem length_set : ∀ {m : ℕ} {as : List α}, as {m ↦ a}.length = max as.
· simp [Nat.le_add_right]
exact Nat.succ_le_succ (Nat.zero_le _)
| m + 1, [] => by
have := @length_set m []
simp [set, length, @length_set m, Nat.zero_max]
| m + 1, _ :: as => by
simp [set, length, @length_set m, Nat.succ_max_succ]
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Data/List/Join.lean
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ theorem join_filter_isEmpty_eq_false [DecidablePred fun l : List α => l.isEmpty
| [] :: L => by
simp [join_filter_isEmpty_eq_false (L := L), isEmpty_iff_eq_nil]
| (a :: l) :: L => by
have cons_not_empty : isEmpty (a :: l) = false := rfl
simp [join_filter_isEmpty_eq_false (L := L), cons_not_empty]
simp [join_filter_isEmpty_eq_false (L := L), isEmpty_cons]
#align list.join_filter_empty_eq_ff List.join_filter_isEmpty_eq_false

@[simp]
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/Data/Nat/Bits.lean
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ theorem binaryRec_eq' {C : ℕ → Sort*} {z : C 0} {f : ∀ b n, C n → C (bit
simp only [imp_false, or_false_iff, eq_self_iff_true, not_true] at h
exact h.symm
· dsimp only []
-- Porting note: this line was `generalize_proofs e`:
generalize @id (C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
(Eq.symm (bit_decomp (bit b n)) ▸ Eq.refl (C (bit b n))) = e
generalize_proofs e
revert e
rw [bodd_bit, div2_bit]
intros
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/PFun.lean
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ theorem fixInduction_spec {C : α → Sort*} {f : α →. Sum β α} {b : β} {a
@fixInduction _ _ C _ _ _ h H = H a h fun a' h' => fixInduction (fix_fwd h h') H := by
unfold fixInduction
-- Porting note: `generalize` required to address `generalize_proofs` bug
generalize (Part.mem_assert_iff.1 h).fst = ha
generalize @fixInduction.proof_1 α β f b a h = ha
induction ha
rfl
#align pfun.fix_induction_spec PFun.fixInduction_spec
Expand Down
1 change: 0 additions & 1 deletion Mathlib/Data/Stream/Init.lean
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ theorem get_interleave_left : ∀ (n : Nat) (s₁ s₂ : Stream' α),
| n + 1, s₁, s₂ => by
change get (s₁ ⋈ s₂) (succ (succ (2 * n))) = get s₁ (succ n)
rw [get_succ, get_succ, interleave_eq, tail_cons, tail_cons]
have : n < succ n := Nat.lt_succ_self n
rw [get_interleave_left n (tail s₁) (tail s₂)]
rfl
#align stream.nth_interleave_left Stream'.get_interleave_left
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Init/Data/Nat/Bitwise.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
import Mathlib.Tactic.Cases
import Mathlib.Tactic.Says
import Mathlib.Tactic.GeneralizeProofs

#align_import init.data.nat.bitwise from "leanprover-community/lean"@"53e8520d8964c7632989880372d91ba0cecbaf00"

Expand Down Expand Up @@ -341,9 +342,8 @@ theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit
rfl
case neg h' =>
simp only [dif_neg h]
generalize @id (C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
(Eq.symm (bit_decomp (bit b n)) ▸ Eq.refl (C (bit b n))) = e
revert e
generalize_proofs h
revert h
rw [bodd_bit, div2_bit]
intros; rfl
#align nat.binary_rec_eq Nat.binaryRec_eq
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Localization/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ theorem isLocalization_iff_of_algEquiv [Algebra R P] (h : S ≃ₐ[R] P) :
#align is_localization.is_localization_iff_of_alg_equiv IsLocalization.isLocalization_iff_of_algEquiv

theorem isLocalization_iff_of_ringEquiv (h : S ≃+* P) :
IsLocalization M S ↔ have := (h.toRingHom.comp <| algebraMap R S).toAlgebra;
IsLocalization M S ↔ haveI := (h.toRingHom.comp <| algebraMap R S).toAlgebra;
IsLocalization M P :=
letI := (h.toRingHom.comp <| algebraMap R S).toAlgebra
isLocalization_iff_of_algEquiv M { h with commutes' := fun _ => rfl }
Expand All @@ -820,7 +820,7 @@ theorem isLocalization_iff_of_ringEquiv (h : S ≃+* P) :
variable (S)

theorem isLocalization_of_base_ringEquiv [IsLocalization M S] (h : R ≃+* P) :
have := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra;
haveI := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra;
IsLocalization (M.map h.toMonoidHom) S := by
letI : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
constructor
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Tactic/Clean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def clean (e : Expr) : Expr :=
| .app (.app (.const n _) _) e' => if n ∈ cleanConsts then some e' else none
| .app (.lam _ _ (.bvar 0) _) e' => some e'
| e =>
match letFunAnnotation? e with
| some (.app (.lam _ _ (.bvar 0) _) e') => some e'
match e.letFun? with
| some (_n, _t, v, .bvar 0) => some v
| _ => none

end Lean.Expr
Expand Down
4 changes: 2 additions & 2 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[{"url": "https://github.com/leanprover/std4",
"type": "git",
"subDir": null,
"rev": "71e11a6be0e43dabcba416e1af15b5bbbbfc9dde",
"rev": "a17925cb39040c461c92ce63cd152f1767b02832",
"name": "std",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "bump/v4.5.0",
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/quote4",
Expand Down
2 changes: 1 addition & 1 deletion lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package mathlib where
meta if get_config? doc = some "on" then -- do not download and build doc-gen4 by default
require «doc-gen4» from git "https://github.com/leanprover/doc-gen4" @ "main"

require std from git "https://github.com/leanprover/std4" @ "main"
require std from git "https://github.com/leanprover/std4" @ "bump/v4.5.0"
require Qq from git "https://github.com/leanprover-community/quote4" @ "master"
require aesop from git "https://github.com/leanprover-community/aesop" @ "master"
require proofwidgets from git "https://github.com/leanprover-community/ProofWidgets4" @ "v0.0.23"
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2023-12-16
leanprover/lean4:nightly-2023-12-19

0 comments on commit 5e6437b

Please sign in to comment.