Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

属性: csimp 属性 #216

Closed
Seasawher opened this issue Apr 24, 2024 · 0 comments · Fixed by #556
Closed

属性: csimp 属性 #216

Seasawher opened this issue Apr 24, 2024 · 0 comments · Fixed by #556

Comments

@Seasawher
Copy link
Member

使用例: Mathlib.NumberTheory.Padics.PadicVal

/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · simp [Classical.em]
      · dsimp [padicValNat, maxPowDiv]
        rw [go_eq, if_neg, dif_neg] <;> simp
    · intro h
      simp [h]
@Seasawher Seasawher transferred this issue from lean-ja/lean-by-example-legacy Jun 10, 2024
@Seasawher Seasawher added this to the 優先順位Top10 milestone Jul 31, 2024
@Seasawher Seasawher changed the title csimp 属性 属性: csimp 属性 Jul 31, 2024
@Seasawher Seasawher self-assigned this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant