/- Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro ! This file was ported from Lean 3 source module data.nat.cast.basic ! leanprover-community/mathlib commit acebd8d49928f6ed8920e502a6c90674e75bd441 ! Please do not edit these lines, except to modify the commit id ! if you have ported upstream changes. -/ import Mathlib.Algebra.CharZero.Defs import Mathlib.Algebra.GroupWithZero.Commute import Mathlib.Algebra.Hom.Ring import Mathlib.Algebra.Order.Group.Abs import Mathlib.Algebra.Ring.Commute import Mathlib.Data.Nat.Order.Basic import Mathlib.Algebra.Group.Opposite /-! # Cast of natural numbers (additional theorems) This file proves additional properties about the *canonical* homomorphism from the natural numbers into an additive monoid with a one (`Nat.cast`). ## Main declarations * `castAddMonoidHom`: `cast` bundled as an `AddMonoidHom`. * `castRingHom`: `cast` bundled as a `RingHom`. -/ -- Porting note: There are many occasions below where we need `simp [map_zero f]` -- where `simp [map_zero]` should suffice. (Similarly for `map_one`.) -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20regression.20with.20MonoidHomClass variable {Ξ±Ξ±: Type ?u.33331Ξ² :Ξ²: Type ?u.11Type _} namespace Nat /-- `Nat.cast : β β Ξ±` as an `AddMonoidHom`. -/ defType _: Type (?u.6990+1)castAddMonoidHom (castAddMonoidHom: (Ξ± : Type u_1) β [inst : AddMonoidWithOne Ξ±] β β β+ Ξ±Ξ± :Ξ±: Type ?u.14Type _) [AddMonoidWithOneType _: Type (?u.14+1)Ξ±] :Ξ±: Type ?u.14β β+β: TypeΞ± where toFun := Nat.cast map_add' := cast_add map_zero' :=Ξ±: Type ?u.14cast_zero #align nat.cast_add_monoid_homcast_zero: β {R : Type ?u.725} [inst : AddMonoidWithOne R], β0 = 0Nat.castAddMonoidHom @[simp] theoremNat.castAddMonoidHom: (Ξ± : Type u_1) β [inst : AddMonoidWithOne Ξ±] β β β+ Ξ±coe_castAddMonoidHom [AddMonoidWithOnecoe_castAddMonoidHom: β {Ξ± : Type u_1} [inst : AddMonoidWithOne Ξ±], β(castAddMonoidHom Ξ±) = Nat.castΞ±] : (Ξ±: Type ?u.818castAddMonoidHomcastAddMonoidHom: (Ξ± : Type ?u.831) β [inst : AddMonoidWithOne Ξ±] β β β+ Ξ±Ξ± :Ξ±: Type ?u.818β ββ: TypeΞ±) = Nat.cast := rfl #align nat.coe_cast_add_monoid_homΞ±: Type ?u.818Nat.coe_castAddMonoidHom @[simp, norm_cast] theoremNat.coe_castAddMonoidHom: β {Ξ± : Type u_1} [inst : AddMonoidWithOne Ξ±], β(castAddMonoidHom Ξ±) = Nat.castcast_mul [NonAssocSemiringcast_mul: β [inst : NonAssocSemiring Ξ±] (m n : β), β(m * n) = βm * βnΞ±] (Ξ±: Type ?u.2097mm: βn :n: ββ) : ((β: Typem *m: βn :n: ββ) :β: TypeΞ±) =Ξ±: Type ?u.2097m *m: βn :=n: βGoals accomplished! π#align nat.cast_mul Nat.cast_mul /-- `Nat.cast : β β Ξ±` as a `RingHom` -/ defGoals accomplished! πcastRingHom (castRingHom: (Ξ± : Type u_1) β [inst : NonAssocSemiring Ξ±] β β β+* Ξ±Ξ± :Ξ±: Type ?u.4477Type _) [NonAssocSemiringType _: Type (?u.4477+1)Ξ±] :Ξ±: Type ?u.4477β β+*β: TypeΞ± := {Ξ±: Type ?u.4477castAddMonoidHomcastAddMonoidHom: (Ξ± : Type ?u.4511) β [inst : AddMonoidWithOne Ξ±] β β β+ Ξ±Ξ± with toFun := Nat.cast, map_one' :=Ξ±: Type ?u.4477cast_one, map_mul' := cast_mul } #align nat.cast_ring_homcast_one: β {R : Type ?u.4997} [inst : AddMonoidWithOne R], β1 = 1Nat.castRingHom @[simp] theoremNat.castRingHom: (Ξ± : Type u_1) β [inst : NonAssocSemiring Ξ±] β β β+* Ξ±coe_castRingHom [NonAssocSemiringcoe_castRingHom: β {Ξ± : Type u_1} [inst : NonAssocSemiring Ξ±], β(castRingHom Ξ±) = Nat.castΞ±] : (Ξ±: Type ?u.5446castRingHomcastRingHom: (Ξ± : Type ?u.5459) β [inst : NonAssocSemiring Ξ±] β β β+* Ξ±Ξ± :Ξ±: Type ?u.5446β ββ: TypeΞ±) = Nat.cast := rfl #align nat.coe_cast_ring_homΞ±: Type ?u.5446Nat.coe_castRingHom theoremNat.coe_castRingHom: β {Ξ± : Type u_1} [inst : NonAssocSemiring Ξ±], β(castRingHom Ξ±) = Nat.castcast_commute [NonAssocSemiringcast_commute: β {Ξ± : Type u_1} [inst : NonAssocSemiring Ξ±] (n : β) (x : Ξ±), Commute (βn) xΞ±] (Ξ±: Type ?u.6253n :n: ββ) (β: Typex :x: Ξ±Ξ±) : Commute (Ξ±: Type ?u.6253n :n: βΞ±)Ξ±: Type ?u.6253x :=x: Ξ±Goals accomplished! πCommute (βn) xCommute (βn) x
zero
zero
zeroCommute 0 x
zeroCommute 0 x
zeroCommute 0 x
zeroGoals accomplished! πCommute (βn) x#align nat.cast_commuteGoals accomplished! πNat.cast_commute theorem cast_comm [NonAssocSemiringNat.cast_commute: β {Ξ± : Type u_1} [inst : NonAssocSemiring Ξ±] (n : β) (x : Ξ±), Commute (βn) xΞ±] (Ξ±: Type ?u.6990n :n: ββ) (β: Typex :x: Ξ±Ξ±) : (Ξ±: Type ?u.6990n :n: βΞ±) *Ξ±: Type ?u.6990x =x: Ξ±x *x: Ξ±n := (n: βcast_commutecast_commute: β {Ξ± : Type ?u.7644} [inst : NonAssocSemiring Ξ±] (n : β) (x : Ξ±), Commute (βn) xnn: βx).eq #align nat.cast_comm Nat.cast_comm theoremx: Ξ±commute_cast [NonAssocSemiringcommute_cast: β {Ξ± : Type u_1} [inst : NonAssocSemiring Ξ±] (x : Ξ±) (n : β), Commute x βnΞ±] (Ξ±: Type ?u.7777x :x: Ξ±Ξ±) (Ξ±: Type ?u.7777n :n: ββ) : Commuteβ: Typexx: Ξ±n := (n: βn.n: βcast_commutecast_commute: β {Ξ± : Type ?u.8103} [inst : NonAssocSemiring Ξ±] (n : β) (x : Ξ±), Commute (βn) xx).symm #align nat.commute_castx: Ξ±Nat.commute_cast section OrderedSemiring variable [OrderedSemiringNat.commute_cast: β {Ξ± : Type u_1} [inst : NonAssocSemiring Ξ±] (x : Ξ±) (n : β), Commute x βnΞ±] @[mono] theoremΞ±: Type ?u.13759mono_cast : Monotone (Nat.cast :mono_cast: Monotone Nat.castβ ββ: TypeΞ±) := monotone_nat_of_le_succ funΞ±: Type ?u.8246n β¦n: ?m.8577Goals accomplished! π#align nat.mono_castGoals accomplished! πNat.mono_cast @[simp] theoremNat.mono_cast: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±], Monotone Nat.castcast_nonneg (cast_nonneg: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] (n : β), 0 β€ βnn :n: ββ) :β: Type0 β€ (0: ?m.9719n :n: βΞ±) := @Ξ±: Type ?u.9706Nat.cast_zeroNat.cast_zero: β {R : Type ?u.10082} [inst : AddMonoidWithOne R], β0 = 0Ξ± _ βΈΞ±: Type ?u.9706mono_cast (Nat.zero_lemono_cast: β {Ξ± : Type ?u.10225} [inst : OrderedSemiring Ξ±], Monotone Nat.castn) #align nat.cast_nonnegn: βNat.cast_nonneg section Nontrivial variable [NontrivialNat.cast_nonneg: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] (n : β), 0 β€ βnΞ±] theorem cast_add_one_pos (Ξ±: Type ?u.10286n :n: ββ) :β: Type0 < (0: ?m.10314n :n: βΞ±) +Ξ±: Type ?u.102981 :=1: ?m.10445zero_lt_one.trans_le <|zero_lt_one: β {Ξ± : Type ?u.11032} [inst : Zero Ξ±] [inst_1 : One Ξ±] [inst_2 : PartialOrder Ξ±] [inst_3 : ZeroLEOneClass Ξ±] [inst_4 : NeZero 1], 0 < 1le_add_of_nonneg_leftle_add_of_nonneg_left: β {Ξ± : Type ?u.11522} [inst : AddZeroClass Ξ±] [inst_1 : LE Ξ±] [inst_2 : CovariantClass Ξ± Ξ± (Function.swap fun x x_1 => x + x_1) fun x x_1 => x β€ x_1] {a b : Ξ±}, 0 β€ b β a β€ b + an.n: βcast_nonneg #align nat.cast_add_one_poscast_nonneg: β {Ξ± : Type ?u.11728} [inst : OrderedSemiring Ξ±] (n : β), 0 β€ βnNat.cast_add_one_pos @[simp] theoremNat.cast_add_one_pos: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] [inst_1 : Nontrivial Ξ±] (n : β), 0 < βn + 1cast_pos {cast_pos: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] [inst_1 : Nontrivial Ξ±] {n : β}, 0 < βn β 0 < nn :n: ββ} : (β: Type0 :0: ?m.12335Ξ±) <Ξ±: Type ?u.12318n βn: β0 <0: ?m.12762n :=n: βGoals accomplished! π
zero
succ
zero
succ#align nat.cast_posGoals accomplished! πNat.cast_pos end Nontrivial variable [Nat.cast_pos: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] [inst_1 : Nontrivial Ξ±] {n : β}, 0 < βn β 0 < nCharZeroCharZero: (R : Type ?u.15455) β [inst : AddMonoidWithOne R] β PropΞ±] {Ξ±: Type ?u.13759mm: βn :n: ββ} theoremβ: TypestrictMono_cast : StrictMono (Nat.cast :strictMono_cast: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] [inst_1 : CharZero Ξ±], StrictMono Nat.castβ ββ: TypeΞ±) :=Ξ±: Type ?u.13917mono_cast.mono_cast: β {Ξ± : Type ?u.14343} [inst : OrderedSemiring Ξ±], Monotone Nat.caststrictMono_of_injectivestrictMono_of_injective: β {Ξ± : Type ?u.14352} {Ξ² : Type ?u.14351} [inst : Preorder Ξ±] [inst_1 : PartialOrder Ξ²] {f : Ξ± β Ξ²}, Monotone f β Function.Injective f β StrictMono fcast_injective #align nat.strict_mono_castcast_injective: β {R : Type ?u.14458} [inst : AddMonoidWithOne R] [inst_1 : CharZero R], Function.Injective Nat.castNat.strictMono_cast /-- `Nat.cast : β β Ξ±` as an `OrderEmbedding` -/ @[simps! (config := { fullyApplied :=Nat.strictMono_cast: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] [inst_1 : CharZero Ξ±], StrictMono Nat.castfalse })] def castOrderEmbedding :false: Boolβ βͺoβ: TypeΞ± :=Ξ±: Type ?u.14695OrderEmbedding.ofStrictMono Nat.castOrderEmbedding.ofStrictMono: {Ξ± : Type ?u.14965} β {Ξ² : Type ?u.14964} β [inst : LinearOrder Ξ±] β [inst_1 : Preorder Ξ²] β (f : Ξ± β Ξ²) β StrictMono f β Ξ± βͺo Ξ²Nat.strictMono_cast #align nat.cast_order_embeddingNat.strictMono_cast: β {Ξ± : Type ?u.15174} [inst : OrderedSemiring Ξ±] [inst_1 : CharZero Ξ±], StrictMono Nat.castNat.castOrderEmbedding #align nat.cast_order_embedding_applyNat.castOrderEmbedding: {Ξ± : Type u_1} β [inst : OrderedSemiring Ξ±] β [inst_1 : CharZero Ξ±] β β βͺo Ξ±Nat.castOrderEmbedding_apply @[simp, norm_cast] theorem cast_le : (Nat.castOrderEmbedding_apply: β {Ξ± : Type u_1} [inst : OrderedSemiring Ξ±] [inst_1 : CharZero Ξ±], βcastOrderEmbedding = Nat.castm :m: βΞ±) β€Ξ±: Type ?u.15446n βn: βm β€m: βn :=n: βstrictMono_cast.strictMono_cast: β {Ξ± : Type ?u.15979} [inst : OrderedSemiring Ξ±] [inst_1 : CharZero Ξ±], StrictMono Nat.castle_iff_le #align nat.cast_le Nat.cast_le @[simp, norm_cast, mono] theoremle_iff_le: β {Ξ± : Type ?u.15992} {Ξ² : Type ?u.15991} [inst : LinearOrder Ξ±] [inst_1 : Preorder Ξ²] {f : Ξ± β Ξ²}, StrictMono f β β {a b : Ξ±}, f a β€ f b β a β€ bcast_lt : (m :m: βΞ±) <Ξ±: Type ?u.16299n βn: βm <m: βn :=n: βstrictMono_cast.strictMono_cast: β {Ξ± : Type ?u.16832} [inst : OrderedSemiring Ξ±] [inst_1 : CharZero Ξ±], StrictMono Nat.castlt_iff_lt #align nat.cast_lt Nat.cast_lt @[simp, norm_cast] theoremlt_iff_lt: β {Ξ± : Type ?u.16845} {Ξ² : Type ?u.16844} [inst : LinearOrder Ξ±] [inst_1 : Preorder Ξ²] {f : Ξ± β Ξ²}, StrictMono f β β {a b : Ξ±}, f a < f b β a < bone_lt_cast :1 < (1: ?m.17312n :n: βΞ±) βΞ±: Type ?u.171521 <1: ?m.17609n :=n: βGoals accomplished! π#align nat.one_lt_cast Nat.one_lt_cast @[simp, norm_cast] theorem one_le_cast :Goals accomplished! π1 β€ (1: ?m.18162n :n: βΞ±) βΞ±: Type ?u.180021 β€1: ?m.18459n :=n: βGoals accomplished! π#align nat.one_le_cast Nat.one_le_cast @[simp, norm_cast] theorem cast_lt_one : (Goals accomplished! πn :n: βΞ±) <Ξ±: Type ?u.188521 β1: ?m.19124n =n: β0 :=0: ?m.19304Goals accomplished! π#align nat.cast_lt_one Nat.cast_lt_one @[simp, norm_cast] theorem cast_le_one : (Goals accomplished! πn :n: βΞ±) β€Ξ±: Type ?u.198901 β1: ?m.20162n β€n: β1 :=1: ?m.20342Goals accomplished! π#align nat.cast_le_one Nat.cast_le_one end OrderedSemiring /-- A version of `Nat.cast_sub` that works for `ββ₯0` and `ββ₯0`. Note that this proof doesn't work for `ββ` and `ββ₯0β`, so we use type-specific lemmas for these types. -/ @[simp, norm_cast] theoremGoals accomplished! πcast_tsub [CanonicallyOrderedCommSemiringcast_tsub: β {Ξ± : Type u_1} [inst : CanonicallyOrderedCommSemiring Ξ±] [inst_1 : Sub Ξ±] [inst_2 : OrderedSub Ξ±] [inst_3 : ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1] (m n : β), β(m - n) = βm - βnΞ±] [SubΞ±: Type ?u.20727Ξ±] [OrderedSubΞ±: Type ?u.20727Ξ±] [ContravariantClassΞ±: Type ?u.20727Ξ±Ξ±: Type ?u.20727Ξ±Ξ±: Type ?u.20727(Β· + Β·)(Β· + Β·): Ξ± β Ξ± β Ξ±(Β· β€ Β·)] ((Β· β€ Β·): Ξ± β Ξ± β Propmm: βn :n: ββ) : β(β: Typem -m: βn) = (n: βm -m: βn :n: βΞ±) :=Ξ±: Type ?u.20727Goals accomplished! πΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: βΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: n β€ m
inrΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: βΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: n β€ m
inrΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inl0 = 0Ξ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlβm β€ βnΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlβm β€ βnΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: m β€ n
inlGoals accomplished! πΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: βΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: n β€ m
inrΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: n β€ m
inrΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
m, n: β
h: n β€ m
inrΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
n, m: β
h: n β€ m + n
inr.introΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
n, m: β
h: n β€ m + n
inr.introΞ±: Type u_1
Ξ²: Type ?u.20730
instβΒ³: CanonicallyOrderedCommSemiring Ξ±
instβΒ²: Sub Ξ±
instβΒΉ: OrderedSub Ξ±
instβ: ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1
n, m: β
h: n β€ m + n
inr.introβm = βm#align nat.cast_tsubGoals accomplished! πNat.cast_tsub @[simp, norm_cast] theoremNat.cast_tsub: β {Ξ± : Type u_1} [inst : CanonicallyOrderedCommSemiring Ξ±] [inst_1 : Sub Ξ±] [inst_2 : OrderedSub Ξ±] [inst_3 : ContravariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1] (m n : β), β(m - n) = βm - βncast_min [LinearOrderedSemiringcast_min: β [inst : LinearOrderedSemiring Ξ±] {a b : β}, β(min a b) = min βa βbΞ±] {Ξ±: Type ?u.23098aa: βb :b: ββ} : ((minβ: Typeaa: βb :b: ββ) :β: TypeΞ±) = min (Ξ±: Type ?u.23098a :a: βΞ±)Ξ±: Type ?u.23098b := (@b: βmono_castmono_cast: β {Ξ± : Type ?u.23344} [inst : OrderedSemiring Ξ±], Monotone Nat.castΞ± _).Ξ±: Type ?u.23098map_min #align nat.cast_min Nat.cast_min @[simp, norm_cast] theoremmap_min: β {Ξ± : Type ?u.23402} {Ξ² : Type ?u.23401} [inst : LinearOrder Ξ±] [inst_1 : LinearOrder Ξ²] {f : Ξ± β Ξ²} {a b : Ξ±}, Monotone f β f (min a b) = min (f a) (f b)cast_max [LinearOrderedSemiringΞ±] {Ξ±: Type ?u.23622aa: βb :b: ββ} : ((maxβ: Typeaa: βb :b: ββ) :β: TypeΞ±) = max (Ξ±: Type ?u.23622a :a: βΞ±)Ξ±: Type ?u.23622b := (@b: βmono_castmono_cast: β {Ξ± : Type ?u.23868} [inst : OrderedSemiring Ξ±], Monotone Nat.castΞ± _).Ξ±: Type ?u.23622map_max #align nat.cast_max Nat.cast_max @[simp, norm_cast] theoremmap_max: β {Ξ± : Type ?u.23926} {Ξ² : Type ?u.23925} [inst : LinearOrder Ξ±] [inst_1 : LinearOrder Ξ²] {f : Ξ± β Ξ²} {a b : Ξ±}, Monotone f β f (max a b) = max (f a) (f b)abs_cast [LinearOrderedRingabs_cast: β [inst : LinearOrderedRing Ξ±] (a : β), abs βa = βaΞ±] (Ξ±: Type ?u.24146a :a: ββ) : |(β: Typea :a: βΞ±)| =Ξ±: Type ?u.24146a :=a: βabs_of_nonneg (abs_of_nonneg: β {Ξ± : Type ?u.24423} [inst : AddGroup Ξ±] [inst_1 : LinearOrder Ξ±] [inst_2 : CovariantClass Ξ± Ξ± (fun x x_1 => x + x_1) fun x x_1 => x β€ x_1] {a : Ξ±}, 0 β€ a β abs a = acast_nonnegcast_nonneg: β {Ξ± : Type ?u.24616} [inst : OrderedSemiring Ξ±] (n : β), 0 β€ βna) #align nat.abs_casta: βNat.abs_cast theorem coe_nat_dvd [SemiringNat.abs_cast: β {Ξ± : Type u_1} [inst : LinearOrderedRing Ξ±] (a : β), abs βa = βaΞ±] {Ξ±: Type ?u.24840mm: βn :n: ββ} (β: Typeh :h: m β£ nm β£m: βn) : (n: βm :m: βΞ±) β£ (Ξ±: Type ?u.24840n :n: βΞ±) := map_dvd (Ξ±: Type ?u.24840Nat.castRingHomNat.castRingHom: (Ξ± : Type ?u.25086) β [inst : NonAssocSemiring Ξ±] β β β+* Ξ±Ξ±)Ξ±: Type ?u.24840h #align nat.coe_nat_dvd Nat.coe_nat_dvd alias coe_nat_dvd β _root_.Dvd.dvd.natCast end Nath: m β£ ninstance [AddMonoidWithOneinstance: β {Ξ± : Type u_1} [inst : AddMonoidWithOne Ξ±] [inst : CharZero Ξ±], Nontrivial Ξ±Ξ±] [Ξ±: Type ?u.25684CharZeroCharZero: (R : Type ?u.25693) β [inst : AddMonoidWithOne R] β PropΞ±] : NontrivialΞ±: Type ?u.25684Ξ± where exists_pair_ne := β¨Ξ±: Type ?u.256841,1: ?m.257220, (0: ?m.25927Nat.cast_one (R :=Nat.cast_one: β {R : Type ?u.26344} [inst : AddMonoidWithOne R], β1 = 1Ξ±) βΈ Nat.cast_ne_zero.2 (Ξ±: Type ?u.25684Goals accomplished! π1 β 0))β© section AddMonoidHomClass variable {Goals accomplished! πAA: Type ?u.33337BB: Type ?u.26449F :F: Type ?u.35455Type _} [AddMonoidWithOneType _: Type (?u.35452+1)B] theoremB: Type ?u.26449ext_nat' [AddMonoidA] [A: Type ?u.26464AddMonoidHomClassAddMonoidHomClass: Type ?u.26481 β (M : outParam (Type ?u.26480)) β (N : outParam (Type ?u.26479)) β [inst : AddZeroClass M] β [inst : AddZeroClass N] β Type (max(max?u.26481?u.26480)?u.26479)FF: Type ?u.26470ββ: TypeA] (A: Type ?u.26464ff: Fg :g: FF) (F: Type ?u.26470h :h: βf 1 = βg 1ff: F1 =1: ?m.27487gg: F1) :1: ?m.28454f =f: Fg := FunLike.extg: Fff: Fg <|g: FGoals accomplished! πGoals accomplished! πGoals accomplished! π#align ext_nat' ext_nat' @[ext] theorem AddMonoidHom.ext_nat [AddMonoidGoals accomplished! πA] {f g :A: Type ?u.33337β β+β: TypeA} : fA: Type ?u.333371 = g1: ?m.343711 β f = g := ext_nat' f g #align add_monoid_hom.ext_nat AddMonoidHom.ext_nat variable [AddMonoidWithOne1: ?m.35344A] -- these versions are primed so that the `RingHomClass` versions aren't theoremA: Type ?u.35470eq_natCast' [eq_natCast': β [inst : AddMonoidHomClass F β A] (f : F), βf 1 = 1 β β (n : β), βf n = βnAddMonoidHomClassAddMonoidHomClass: Type ?u.35487 β (M : outParam (Type ?u.35486)) β (N : outParam (Type ?u.35485)) β [inst : AddZeroClass M] β [inst : AddZeroClass N] β Type (max(max?u.35487?u.35486)?u.35485)FF: Type ?u.35476ββ: TypeA] (A: Type ?u.35470f :f: FF) (F: Type ?u.35476h1 :h1: βf 1 = 1ff: F1 =1: ?m.364971) : β1: ?m.36508n :n: ββ,β: Typeff: Fn =n: βn |n: β0 =>0: βGoals accomplished! πΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1βf 0 = β0|Goals accomplished! πn + 1 =>n: βGoals accomplished! πΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: βΞ±: Type ?u.35464
Ξ²: Type ?u.35467
A: Type u_2
B: Type ?u.35473
F: Type u_1
instβΒ²: AddMonoidWithOne B
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F β A
f: F
h1: βf 1 = 1
n: β#align eq_nat_cast'Goals accomplished! πeq_natCast' theoremeq_natCast': β {A : Type u_2} {F : Type u_1} [inst : AddMonoidWithOne A] [inst_1 : AddMonoidHomClass F β A] (f : F), βf 1 = 1 β β (n : β), βf n = βnmap_natCast' {map_natCast': β {B : Type u_3} {F : Type u_2} [inst : AddMonoidWithOne B] {A : Type u_1} [inst_1 : AddMonoidWithOne A] [inst_2 : AddMonoidHomClass F A B] (f : F), βf 1 = 1 β β (n : β), βf βn = βnA} [AddMonoidWithOneA: Type u_1A] [A: ?m.40897AddMonoidHomClassAddMonoidHomClass: Type ?u.40905 β (M : outParam (Type ?u.40904)) β (N : outParam (Type ?u.40903)) β [inst : AddZeroClass M] β [inst : AddZeroClass N] β Type (max(max?u.40905?u.40904)?u.40903)FF: Type ?u.40888AA: ?m.40897B] (B: Type ?u.40885f :f: FF) (F: Type ?u.40888h :h: βf 1 = 1ff: F1 =1: ?m.419211) : β1: ?m.42117n :n: ββ,β: Typeff: Fn =n: βn |n: β0 =>0: βGoals accomplished! πΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1βf β0 = β0|Goals accomplished! πn + 1 =>n: βGoals accomplished! πΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: βΞ±: Type ?u.40876
Ξ²: Type ?u.40879
Aβ: Type ?u.40882
B: Type u_3
F: Type u_2
instβΒ³: AddMonoidWithOne B
instβΒ²: AddMonoidWithOne Aβ
A: Type u_1
instβΒΉ: AddMonoidWithOne A
instβ: AddMonoidHomClass F A B
f: F
h: βf 1 = 1
n: β#align map_nat_cast'Goals accomplished! πmap_natCast' end AddMonoidHomClass section MonoidWithZeroHomClass variable {map_natCast': β {B : Type u_3} {F : Type u_2} [inst : AddMonoidWithOne B] {A : Type u_1} [inst_1 : AddMonoidWithOne A] [inst_2 : AddMonoidHomClass F A B] (f : F), βf 1 = 1 β β (n : β), βf βn = βnAA: Type ?u.48254F :F: Type ?u.48257Type _} [MulZeroOneClassType _: Type (?u.48242+1)A] /-- If two `MonoidWithZeroHom`s agree on the positive naturals they are equal. -/ theoremA: Type ?u.48239ext_nat'' [MonoidWithZeroHomClassMonoidWithZeroHomClass: Type ?u.48265 β (M : outParam (Type ?u.48264)) β (N : outParam (Type ?u.48263)) β [inst : MulZeroOneClass M] β [inst : MulZeroOneClass N] β Type (max(max?u.48265?u.48264)?u.48263)FF: Type ?u.48257ββ: TypeA] (A: Type ?u.48254ff: Fg :g: FF) (h_pos : β {F: Type ?u.48257n :n: ββ},β: Type0 <0: ?m.48305n βn: βff: Fn =n: βgg: Fn) :n: βf =f: Fg :=g: FGoals accomplished! πΞ±: Type ?u.48248
Ξ²: Type ?u.48251
A: Type u_2
F: Type u_1
instβΒΉ: MulZeroOneClass A
instβ: MonoidWithZeroHomClass F β A
f, g: F
h_pos: β {n : β}, 0 < n β βf n = βg n
h.zeroΞ±: Type ?u.48248
Ξ²: Type ?u.48251
A: Type u_2
F: Type u_1
instβΒΉ: MulZeroOneClass A
instβ: MonoidWithZeroHomClass F β A
f, g: F
h_pos: β {n : β}, 0 < n β βf n = βg n
n: β
h.succΞ±: Type ?u.48248
Ξ²: Type ?u.48251
A: Type u_2
F: Type u_1
instβΒΉ: MulZeroOneClass A
instβ: MonoidWithZeroHomClass F β A
f, g: F
h_pos: β {n : β}, 0 < n β βf n = βg n
h.zeroΞ±: Type ?u.48248
Ξ²: Type ?u.48251
A: Type u_2
F: Type u_1
instβΒΉ: MulZeroOneClass A
instβ: MonoidWithZeroHomClass F β A
f, g: F
h_pos: β {n : β}, 0 < n β βf n = βg n
n: β
h.succGoals accomplished! π#align ext_nat''Goals accomplished! πext_nat'' @[ext] theoremext_nat'': β {A : Type u_2} {F : Type u_1} [inst : MulZeroOneClass A] [inst_1 : MonoidWithZeroHomClass F β A] (f g : F), (β {n : β}, 0 < n β βf n = βg n) β f = gMonoidWithZeroHom.ext_nat {f g :β β*ββ: TypeA} : (β {A: Type ?u.51912n :n: ββ},β: Type0 <0: ?m.51965n β fn: βn = gn: βn) β f = g :=n: βext_nat'' f g #align monoid_with_zero_hom.ext_nat MonoidWithZeroHom.ext_nat end MonoidWithZeroHomClass section RingHomClass variable {ext_nat'': β {A : Type ?u.53467} {F : Type ?u.53466} [inst : MulZeroOneClass A] [inst_1 : MonoidWithZeroHomClass F β A] (f g : F), (β {n : β}, 0 < n β βf n = βg n) β f = gRR: Type ?u.53572SS: Type ?u.53575F :F: Type ?u.57182Type _} [NonAssocSemiringType _: Type (?u.57179+1)R] [NonAssocSemiringR: Type ?u.53572S] @[simp] theoremS: Type ?u.53554eq_natCast [eq_natCast: β {R : Type u_2} {F : Type u_1} [inst : NonAssocSemiring R] [inst_1 : RingHomClass F β R] (f : F) (n : β), βf n = βnRingHomClassRingHomClass: Type ?u.53589 β (Ξ± : outParam (Type ?u.53588)) β (Ξ² : outParam (Type ?u.53587)) β [inst : NonAssocSemiring Ξ±] β [inst : NonAssocSemiring Ξ²] β Type (max(max?u.53589?u.53588)?u.53587)FF: Type ?u.53578ββ: TypeR] (R: Type ?u.53572f :f: FF) : βF: Type ?u.53578n,n: ?m.53616ff: Fn =n: ?m.53616n :=n: ?m.53616eq_natCast'eq_natCast': β {A : Type ?u.54584} {F : Type ?u.54583} [inst : AddMonoidWithOne A] [inst_1 : AddMonoidHomClass F β A] (f : F), βf 1 = 1 β β (n : β), βf n = βnf <| map_onef: Ff #align eq_nat_castf: Feq_natCast @[simp] theoremeq_natCast: β {R : Type u_2} {F : Type u_1} [inst : NonAssocSemiring R] [inst_1 : RingHomClass F β R] (f : F) (n : β), βf n = βnmap_natCast [map_natCast: β {R : Type u_2} {S : Type u_3} {F : Type u_1} [inst : NonAssocSemiring R] [inst_1 : NonAssocSemiring S] [inst_2 : RingHomClass F R S] (f : F) (n : β), βf βn = βnRingHomClassRingHomClass: Type ?u.55181 β (Ξ± : outParam (Type ?u.55180)) β (Ξ² : outParam (Type ?u.55179)) β [inst : NonAssocSemiring Ξ±] β [inst : NonAssocSemiring Ξ²] β Type (max(max?u.55181?u.55180)?u.55179)FF: Type ?u.55170RR: Type ?u.55164S] (S: Type ?u.55167f :f: FF) : βF: Type ?u.55170n :n: ββ,β: Typef (f: Fn :n: βR) =R: Type ?u.55164n :=n: βmap_natCast'map_natCast': β {B : Type ?u.56359} {F : Type ?u.56358} [inst : AddMonoidWithOne B] {A : Type ?u.56357} [inst_1 : AddMonoidWithOne A] [inst_2 : AddMonoidHomClass F A B] (f : F), βf 1 = 1 β β (n : β), βf βn = βnf <| map_onef: Ff #align map_nat_castf: Fmap_natCast --Porting note: new theorem @[simp] theoremmap_natCast: β {R : Type u_2} {S : Type u_3} {F : Type u_1} [inst : NonAssocSemiring R] [inst_1 : NonAssocSemiring S] [inst_2 : RingHomClass F R S] (f : F) (n : β), βf βn = βnmap_ofNat [map_ofNat: β {R : Type u_2} {S : Type u_3} {F : Type u_1} [inst : NonAssocSemiring R] [inst_1 : NonAssocSemiring S] [inst_2 : RingHomClass F R S] (f : F) (n : β) [inst_3 : Nat.AtLeastTwo n], βf (OfNat.ofNat n) = OfNat.ofNat nRingHomClassRingHomClass: Type ?u.57193 β (Ξ± : outParam (Type ?u.57192)) β (Ξ² : outParam (Type ?u.57191)) β [inst : NonAssocSemiring Ξ±] β [inst : NonAssocSemiring Ξ²] β Type (max(max?u.57193?u.57192)?u.57191)FF: Type ?u.57182RR: Type ?u.57176S] (S: Type ?u.57179f :f: FF) (F: Type ?u.57182n :n: ββ) [Nat.AtLeastTwoβ: Typen] : (n: βf (OfNat.ofNatf: Fn) :n: βS) = OfNat.ofNatS: Type ?u.57179n :=n: βmap_natCastmap_natCast: β {R : Type ?u.58143} {S : Type ?u.58144} {F : Type ?u.58142} [inst : NonAssocSemiring R] [inst_1 : NonAssocSemiring S] [inst_2 : RingHomClass F R S] (f : F) (n : β), βf βn = βnff: Fn theoremn: βext_nat [ext_nat: β [inst : RingHomClass F β R] (f g : F), f = gRingHomClassRingHomClass: Type ?u.58259 β (Ξ± : outParam (Type ?u.58258)) β (Ξ² : outParam (Type ?u.58257)) β [inst : NonAssocSemiring Ξ±] β [inst : NonAssocSemiring Ξ²] β Type (max(max?u.58259?u.58258)?u.58257)FF: Type ?u.58248ββ: TypeR] (R: Type ?u.58242ff: Fg :g: FF) :F: Type ?u.58248f =f: Fg := ext_nat'g: Fff: Fg <|g: FGoals accomplished! πΞ±: Type ?u.58236
Ξ²: Type ?u.58239
R: Type u_2
S: Type ?u.58245
F: Type u_1
instβΒ²: NonAssocSemiring R
instβΒΉ: NonAssocSemiring S
instβ: RingHomClass F β R
f, g: Fβf 1 = βg 1#align ext_natGoals accomplished! πext_nat theoremext_nat: β {R : Type u_2} {F : Type u_1} [inst : NonAssocSemiring R] [inst : RingHomClass F β R] (f g : F), f = gNeZero.nat_of_injective {NeZero.nat_of_injective: β {n : β} [h : NeZero βn] [inst : RingHomClass F R S] {f : F}, Function.Injective βf β NeZero βnn :n: ββ} [β: Typeh : NeZero (h: NeZero βnn :n: βR)] [R: Type ?u.59352RingHomClassRingHomClass: Type ?u.59786 β (Ξ± : outParam (Type ?u.59785)) β (Ξ² : outParam (Type ?u.59784)) β [inst : NonAssocSemiring Ξ±] β [inst : NonAssocSemiring Ξ²] β Type (max(max?u.59786?u.59785)?u.59784)FF: Type ?u.59358RR: Type ?u.59352S] {S: Type ?u.59355f :f: FF} (F: Type ?u.59358hf : Function.Injectivehf: Function.Injective βff) : NeZero (f: Fn :n: βS) := β¨funS: Type ?u.59355h β¦h: ?m.60790NeZero.natCast_neNeZero.natCast_ne: β (n : β) (R : Type ?u.60792) [inst : AddMonoidWithOne R] [h : NeZero βn], βn β 0nn: βR <|R: Type ?u.59352hf <|hf: Function.Injective βfGoals accomplished! πΞ±: Type ?u.59346
Ξ²: Type ?u.59349
R: Type u_1
S: Type u_3
F: Type u_2
instβΒ²: NonAssocSemiring R
instβΒΉ: NonAssocSemiring S
n: β
hβ: NeZero βn
instβ: RingHomClass F R S
f: F
hf: Function.Injective βf
h: βn = 0βf βn = βf 0β© #align ne_zero.nat_of_injectiveGoals accomplished! πNeZero.nat_of_injective theoremNeZero.nat_of_injective: β {R : Type u_1} {S : Type u_3} {F : Type u_2} [inst : NonAssocSemiring R] [inst_1 : NonAssocSemiring S] {n : β} [h : NeZero βn] [inst_2 : RingHomClass F R S] {f : F}, Function.Injective βf β NeZero βnNeZero.nat_of_neZero {RR: Type u_1S} [SemiringS: ?m.61830R] [SemiringR: ?m.61827S] {S: ?m.61830F} [F: ?m.61839RingHomClassRingHomClass: Type ?u.61844 β (Ξ± : outParam (Type ?u.61843)) β (Ξ² : outParam (Type ?u.61842)) β [inst : NonAssocSemiring Ξ±] β [inst : NonAssocSemiring Ξ²] β Type (max(max?u.61844?u.61843)?u.61842)FF: ?m.61839RR: ?m.61827S] (S: ?m.61830f :f: FF) {F: ?m.61839n :n: ββ} [β: Typehn : NeZero (hn: NeZero βnn :n: βS)] : NeZero (S: ?m.61830n :n: βR) := .of_map (f :=R: ?m.61827f) (neZero :=f: FGoals accomplished! πΞ±: Type ?u.61806
Ξ²: Type ?u.61809
Rβ: Type ?u.61812
Sβ: Type ?u.61815
Fβ: Type ?u.61818
instββ΄: NonAssocSemiring Rβ
instβΒ³: NonAssocSemiring Sβ
R: Type u_1
S: Type u_2
instβΒ²: Semiring R
instβΒΉ: Semiring S
F: Type u_3
instβ: RingHomClass F R S
f: F
n: β
hn: NeZero βnNeZero (βf βn)) #align ne_zero.nat_of_ne_zero NeZero.nat_of_neZero end RingHomClass namespace RingHom /-- This is primed to match `eq_intCast'`. -/ theoremGoals accomplished! πeq_natCast' {eq_natCast': β {R : Type u_1} [inst : NonAssocSemiring R] (f : β β+* R), f = Nat.castRingHom RR} [NonAssocSemiringR: ?m.62990R] (f :R: ?m.62990β β+*β: TypeR) : f =R: ?m.62990Nat.castRingHomNat.castRingHom: (Ξ± : Type ?u.63021) β [inst : NonAssocSemiring Ξ±] β β β+* Ξ±R :=R: ?m.62990RingHom.ext <|RingHom.ext: β {Ξ± : Type ?u.63032} {Ξ² : Type ?u.63033} {x : NonAssocSemiring Ξ±} {x_1 : NonAssocSemiring Ξ²} β¦f g : Ξ± β+* Ξ²β¦, (β (x_2 : Ξ±), βf x_2 = βg x_2) β f = geq_natCast f #align ring_hom.eq_nat_cast'eq_natCast: β {R : Type ?u.63049} {F : Type ?u.63048} [inst : NonAssocSemiring R] [inst_1 : RingHomClass F β R] (f : F) (n : β), βf n = βnRingHom.eq_natCast' end RingHom @[simp, norm_cast] theorem Nat.cast_id (RingHom.eq_natCast': β {R : Type u_1} [inst : NonAssocSemiring R] (f : β β+* R), f = Nat.castRingHom Rn :n: ββ) :β: Typen.cast =n: βn := rfl #align nat.cast_id Nat.cast_id @[simp] theoremn: βNat.castRingHom_nat :Nat.castRingHom_nat: castRingHom β = RingHom.id βNat.castRingHomNat.castRingHom: (Ξ± : Type ?u.63190) β [inst : NonAssocSemiring Ξ±] β β β+* Ξ±β =β: TypeRingHom.idRingHom.id: (Ξ± : Type ?u.63206) β [inst : NonAssocSemiring Ξ±] β Ξ± β+* Ξ±β := rfl #align nat.cast_ring_hom_natβ: TypeNat.castRingHom_nat /-- We don't use `RingHomClass` here, since that might cause type-class slowdown for `Subsingleton`-/ instanceNat.castRingHom_nat: Nat.castRingHom β = RingHom.id βNat.uniqueRingHom {Nat.uniqueRingHom: {R : Type u_1} β [inst : NonAssocSemiring R] β Unique (β β+* R)R :R: Type ?u.63256Type _} [NonAssocSemiringType _: Type (?u.63256+1)R] : Unique (R: Type ?u.63256β β+*β: TypeR) where default :=R: Type ?u.63256Nat.castRingHomNat.castRingHom: (Ξ± : Type ?u.63295) β [inst : NonAssocSemiring Ξ±] β β β+* Ξ±R uniq :=R: Type ?u.63256RingHom.eq_natCast' namespace Pi variable {RingHom.eq_natCast': β {R : Type ?u.63304} [inst : NonAssocSemiring R] (f : β β+* R), f = castRingHom RΟ :Ο: Ξ± β Type ?u.64938Ξ± βΞ±: Type ?u.63375Type _} [βType _: Type (?u.63364+1)a, NatCast (a: ?m.63368ΟΟ: Ξ± β Type ?u.63364a)] /- Porting note: manually wrote this instance. Was `by refine_struct { .. } <;> pi_instance_derive_field` -/ instancea: ?m.63368natCast : NatCast (βnatCast: NatCast ((a : Ξ±) β Ο a)a,a: ?m.63396ΟΟ: Ξ± β Type ?u.63383a) := { natCast := funa: ?m.63396nn: ?m.63407_ β¦_: ?m.63410n } theoremn: ?m.63407nat_apply (n :n: ββ) (β: Typea :a: Ξ±Ξ±) : (Ξ±: Type ?u.63536n : βn: βa,a: ?m.63562ΟΟ: Ξ± β Type ?u.63544a)a: ?m.63562a =a: Ξ±n := rfl #align pi.nat_apply Pi.nat_apply @[simp] theoremn: βcoe_nat (n :n: ββ) : (β: Typen : βn: βa,a: ?m.64954ΟΟ: Ξ± β Type ?u.64938a) = funa: ?m.64954_ β¦ β_: ?m.66225n := rfl #align pi.coe_nat Pi.coe_nat end Pi theoremn: βSum.elim_natCast_natCast {Ξ±Ξ±: Type ?u.66355Ξ²Ξ²: Type ?u.66358Ξ³ :Ξ³: Type ?u.66361Type _} [NatCastType _: Type (?u.66355+1)Ξ³] (Ξ³: Type ?u.66361n :n: ββ) : Sum.elim (β: Typen :n: βΞ± βΞ±: Type ?u.66355Ξ³) (Ξ³: Type ?u.66361n :n: βΞ² βΞ²: Type ?u.66358Ξ³) =Ξ³: Type ?u.66361n := @Sum.elim_lam_const_lam_constn: βΞ±Ξ±: Type u_1Ξ²Ξ²: Type u_2Ξ³Ξ³: Type u_3n #align sum.elim_nat_cast_nat_cast Sum.elim_natCast_natCast /-! ### Order dual -/ open OrderDual instance [n: βh : NatCasth: NatCast Ξ±Ξ±] : NatCastΞ±: Type ?u.70314Ξ±α΅α΅ :=Ξ±: Type ?u.70314hh: NatCast Ξ±instance [instance: {Ξ± : Type u_1} β [h : AddMonoidWithOne Ξ±] β AddMonoidWithOne Ξ±α΅α΅h : AddMonoidWithOneh: AddMonoidWithOne Ξ±Ξ±] : AddMonoidWithOneΞ±: Type ?u.70358Ξ±α΅α΅ :=Ξ±: Type ?u.70358hh: AddMonoidWithOne Ξ±instance [instance: {Ξ± : Type u_1} β [h : AddCommMonoidWithOne Ξ±] β AddCommMonoidWithOne Ξ±α΅α΅h : AddCommMonoidWithOneh: AddCommMonoidWithOne Ξ±Ξ±] : AddCommMonoidWithOneΞ±: Type ?u.70402Ξ±α΅α΅ :=Ξ±: Type ?u.70402h @[simp] theorem toDual_natCast [NatCasth: AddCommMonoidWithOne Ξ±Ξ±] (Ξ±: Type ?u.70446n :n: ββ) : toDual (β: Typen :n: βΞ±) =Ξ±: Type ?u.70446n := rfl #align to_dual_nat_cast toDual_natCast @[simp] theorem ofDual_natCast [NatCastn: βΞ±] (Ξ±: Type ?u.70719n :n: ββ) : (ofDualβ: Typen :n: βΞ±) =Ξ±: Type ?u.70719n := rfl #align of_dual_nat_cast ofDual_natCast /-! ### Lexicographic order -/ instance [n: βh : NatCasth: NatCast Ξ±Ξ±] : NatCast (LexΞ±: Type ?u.70969Ξ±) :=Ξ±: Type ?u.70969hh: NatCast Ξ±instance [instance: {Ξ± : Type u_1} β [h : AddMonoidWithOne Ξ±] β AddMonoidWithOne (Lex Ξ±)h : AddMonoidWithOneh: AddMonoidWithOne Ξ±Ξ±] : AddMonoidWithOne (LexΞ±: Type ?u.71013Ξ±) :=Ξ±: Type ?u.71013hh: AddMonoidWithOne Ξ±instance [instance: {Ξ± : Type u_1} β [h : AddCommMonoidWithOne Ξ±] β AddCommMonoidWithOne (Lex Ξ±)h : AddCommMonoidWithOneh: AddCommMonoidWithOne Ξ±Ξ±] : AddCommMonoidWithOne (LexΞ±: Type ?u.71057Ξ±) :=Ξ±: Type ?u.71057h @[simp] theorem toLex_natCast [NatCasth: AddCommMonoidWithOne Ξ±Ξ±] (Ξ±: Type ?u.71101n :n: ββ) : toLex (β: Typen :n: βΞ±) =Ξ±: Type ?u.71101n := rfl #align to_lex_nat_cast toLex_natCast @[simp] theorem ofLex_natCast [NatCastn: βΞ±] (Ξ±: Type ?u.71374n :n: ββ) : (ofLexβ: Typen :n: βΞ±) =Ξ±: Type ?u.71374n := rfl #align of_lex_nat_cast ofLex_natCastn: β