首页 > 其他分享 >Natural Number Game Sol

Natural Number Game Sol

时间:2024-12-14 16:43:19浏览次数:4  
标签:rw Natural zero Level Game Number succ add rfl

https://adam.math.hhu.de/#/g/leanprover-community/nng4

Tutorial World

Level 1 / 8 : The rfl tactic

rfl

Level 2 / 8 : the rw tactic

rw[h]
rfl

Level 3 / 8 : Numbers

rw[two_eq_succ_one]
rw[one_eq_succ_zero]
rfl

Level 4 / 8 : rewriting backwards

rw[← one_eq_succ_zero]
rw[← two_eq_succ_one]
rfl

Level 5 / 8 : Adding zero

rw[add_zero b]
rw[add_zero c]
rfl

Level 6 / 8 : Precision rewriting

rw[add_zero b]
rw[add_zero c]
rfl

Level 7 / 8 : add_succ

rw[one_eq_succ_zero]
rw[add_succ]
rw[add_zero]
rfl

Level 8 / 8 : 2+2=4

nth_rewrite 2 [two_eq_succ_one]
rw[add_succ 2]
nth_rewrite 1 [one_eq_succ_zero]
rw[add_succ 2]
rw[add_zero 2]
rw[<- three_eq_succ_two]
rw[<- four_eq_succ_three]
rfl

Addition World

Level 1 / 5 : zero_add

induction n with d hd
rw[add_zero]
rfl
rw[add_succ 0]
rw[hd]
rfl

Level 2 / 5 : succ_add

induction b with d hd
rw[succ_eq_add_one]
rw[succ_eq_add_one]
rw[add_zero]
rw[add_zero]
rfl
rw[add_succ]
rw[add_succ]
rw[hd]
rfl

Level 3 / 5 : add_comm (level boss)

induction b with d hd
rw[add_zero]
rw[zero_add]
rfl
rw[add_succ]
rw[hd]
rw[succ_add]
rfl

Level 4 / 5 : add_assoc (associativity of addition)

induction b with d hd
rw[add_zero]
rw[zero_add]
rfl
rw[succ_add]
rw[add_succ]
rw[succ_add]
rw[add_succ]
rw[hd]
rfl

Level 5 / 5 : add_right_comm

induction b with d hd
rw[add_zero]
rw[add_zero]
rfl
rw[add_succ]
rw[succ_add]
rw[hd]
rw[add_succ]
rfl

标签:rw,Natural,zero,Level,Game,Number,succ,add,rfl
From: https://www.cnblogs.com/KiharaTouma/p/18606916

相关文章

  • HDU1711-Number Sequence
    开始刷KMP1(看毛片算法)ViewCodeHDU1711暴力就是A的数字个数*B的数字个数,10^10,还要乘个未知的数据个数:T,肯定超时 开始 回顾  学KMP ......
  • 关于攻防世界-Reverse-game的三种解法的探讨
    1.直接玩游戏输入12345678即可出flag2.动态调试下载下来是一个exe文件,可以用IDA打开这种题我更倾向于动调直接得到flag我们查壳没有保护壳,直接32打开进入字符串界面,找到显示的那部分int__cdeclmain_0(intargc,constchar**argv,constchar**envp){i......
  • Text Based Game
    Assignment 2– Text Based GameDeadline: 16:00,Dec 12, 20241 Process For Assignment 2Make sure you follow the process as outlined below.   Assignment 2 has a different structureandasomewhatdifferentapproach to Assignment......
  • [HBCPC2024] Points on the Number Axis A
    [HBCPC2024]PointsontheNumberAxisA题目描述Aliceisplayingasingle-playergameonthenumberaxis.Thereare\(n\)pointsonthenumberaxis.Eachtime,theplayerselectstwopoints.Thetwopointswillberemoved,andtheirmidpointwillbeadded.......
  • 自动化处理: Unhandled exception. System.IO.IOException: The configured user limit
    #!/bin/bash#设置root密码为环境变量exportROOT_PASSWORD="your_root_password_here"#检查是否以普通用户运行if["$EUID"-eq0];thenecho"不要以root权限直接运行此脚本"exitfi#打印当前的max_user_instances值echo"当前的max_user_instances值:"su......
  • C#自动化处理: Unhandled exception. System.IO.IOException: The configured user lim
    usingSystem;usingSystem.Diagnostics;classProgram{//定义root密码(请用你的实际密码替换)privateconststringRootPassword="your_root_password_here";staticvoidMain(){try{//需要执行的命令列表......
  • Text Based Game
    Assignment2–TextBasedGameForeachclassrefertoitscorrespondingtesttoverifyfieldandmethodnaminconventions.Althoughtherearemanywaystoconstructanapplication,youarerequiredtadheretotherulesstipulatedbelow(toachievemarks......
  • [LeetCode] 1524. Number of Sub-arrays With Odd Sum
    Givenanarrayofintegersarr,returnthenumberofsubarrayswithanoddsum.Sincetheanswercanbeverylarge,returnitmodulo109+7.Example1:Input:arr=[1,3,5]Output:4Explanation:Allsubarraysare[[1],[1,3],[1,3,5],[3],[3,5],[5]]Allsu......
  • Model MIP Puzzle Game
    Theaimofthispracticalistomodelapuzzlegamecalled‘Stitch’asaMIPproblem,usingthelinprogfunctioninscipy.WewillthenextendourMIPmodeltoproducenew‘Stitch’puzzles.Youwillalsoprovideareport,intendedtobereadbyanon-spe......
  • [LeetCode] 2684. Maximum Number of Moves in a Grid
    Youaregivena0-indexedmxnmatrixgridconsistingofpositiveintegers.Youcanstartatanycellinthefirstcolumnofthematrix,andtraversethegridinthefollowingway:Fromacell(row,col),youcanmovetoanyofthecells:(row-1,col+......