CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

Try doing some basic maths questions in the Lean Theorem Prover. Functions, real numbers, equivalence relations and groups. Click on README.md and then on "Open in CoCalc with one click".

Project: Xena
Views: 18536
License: APACHE
oleanfile3.4.2, commit cbd2b6686ddb�p�~�inittacticcore�Zexport_decloptionnonenonesomesomeexport_declboolffffttttexport_declhas_andthenandthenandthenexport_declhas_powpowpowexport_declhas_appendappendappendexport_decldecidableis_trueis_trueis_falseis_falseto_boolto_boolexport_declhas_purepurepureexport_declhas_bindbindbindexport_declhas_monad_lift_tmonad_lift!monad_liftexport_declmonad_functor_tmonad_map$monad_mapexport_declmonad_runrun'runexport_decllistmmap*mmapmmap'*mmap'mfilter*mfiltermfoldl*mfoldlexport_declnativenat_map3rb_mapmkexport_declname_mapnativerb_mapmkexport_declexpr_mapnativerb_mapmkexport_decltacticinteraction_monadfailedfailexport_decltactic_resultinteraction_monadresultexport_decltacticFtransparencyreducibleGreduciblesemireducibleGsemireducibleexport_decltacticmk_simp_attrLmk_simp_attrexport_declmonad_exceptthrowOthrowcatchOcatchexport_declmonad_except_adapteradapt_exceptTadapt_exceptexport_declmonad_state_adapteradapt_stateWadapt_stateexport_declmonad_readerreadZreadexport_declmonad_reader_adapteradapt_reader]adapt_readerexport_declis_lawful_functormap_const_eq`map_const_eqid_map`id_mapcomp_map`comp_mapexport_declis_lawful_applicativeseq_left_eqgseq_left_eqseq_right_eqgseq_right_eqpure_seq_eq_mapgpure_seq_eq_mapmap_puregmap_pureseq_puregseq_pureseq_assocgseq_assocexport_declis_lawful_monadbind_pure_comp_eq_maptbind_pure_comp_eq_mapbind_map_eq_seqtbind_map_eq_seqpure_bindtpure_bindbind_assoctbind_assocdecltacticreorder_goals_main_aux_param_0α�gslistprodboola}new_goals���Fnew_goalscases_on�id_rhs
has_appendappend
listhas_append	listmap		prodsnd	�filterfunctioncompcoe(coe_to_lift(coe_base(coe_bool_to_Prop'bnotprodfst	acoe_decidable_eq%9<"$7=�AGMO"M�PInfoVMR_lambda_1VMR_lambda_2VMR_lambda_3VMRVMC�c
VMC��
	�VMC��
�VMC'���
!��filter_main��map_main�����append_main������declequations_eqn_1_aux_param_0��eq�MM}new_goalsnon_dep_firsteMMM M#p%p(6w9<M�pA>tuy|�pA=��eqrefleid_deltaek�PInfo�ATTR_refl_lemma���EqnL�declequations_eqn_2_aux_param_0��fi}new_goalsnon_dep_only�������PInfo�ATTR����EqnL�declequations_eqn_3_aux_param_0��fi}new_goalsallt������PInfo�ATTR����EqnL�decl}reorder_goalsu_1�������	����M�PInfo�VMR�VMC���doc�With `gs` a list of proof goals, `reorder_goals gs new_g` will use the `new_goals` policy `new_g` to rearrange the
   dependent goals to either drop them, push them to the end of the list or leave them in place. The `bool` values in
   `gs` indicates whether the goal is dependent or not.decl�equations_eqn_1��������M�
Mj�
��
M�map

�MMprodsnd
M�filter
��
�(6�9prodfst
M��A��	9�	������A�����equations_eqn_1
M�PInfo�ATTR����EqnL�decl�equations_eqn_2�������������equations_eqn_2
M�PInfo�ATTR����EqnL�decl�equations_eqn_3�������������equations_eqn_3
M�PInfo�ATTR����EqnL�decl�_sunfold���������������	��	�	���(6���A��9�M�$�%�'���A�/M��6��$M�PInfo�prvhas_opt_auto_param_inst_for_apply_private���̑has_opt_auto_param_inst_for_applydecl�mslist�nameexprbooltttactic��S��U�mfoldl�Tinteraction_monadmonadtactic_state�Rrm�R �Tmonadto_has_bind�T�]�Q}infer_type�snd�M�Qtype�Q�f}is_classbreturn�T�]bor�y�yexpris_napp_ofMnamemk_string
Stropt_paramnameanonymousbit0natnathas_addhas_oneone��nathas_one�|�}
Strauto_param�����PInfo�$VMR�_lambda_1VMR�_lambda_2VMR�VMC�$αVMC��&s�\��R�
tacticinfer_type	�tacticis_class		�	Cnameanonymousmcharof_nata�r�a�p�_�t�p�o�stringemptystringstr�	�	�	�	�	�	�	�	namemk_stringexpris_napp_of	?ABD	E��m�a�r�a�p�_�o�t�u�a���	�	�	�	�	�	�	�	�	�	��
	~���	��	�����VMC�
$��S���listmfoldl_mainprvtry_apply_opt_auto_param_instance_for_apply����try_apply_opt_auto_param_instance_for_applydecl�cfg}apply_cfgms�S�Tunit�����S�W��mwhen�T�]��f�K�Q��}get_goalsgs���f����listmmap'�T�]�R��m�R��functormap�Tapplicativeto_functor�T�to_applicative�T�]9}is_assigned�mhas_bindand_then�����T�e����}set_goalslistcons�Q�mlistnil�Q}try��}apply_instancewhen�T�]coe_sortcoe_sort_bool�opt_parambooldecidable_eq���P��}apply_opt_param�����auto_param�����P��}apply_auto_paramM_x����M�PInfo�+VMR�_lambda_1VMR�_lambda_2VMR�_lambda_3VMR�_lambda_4VMR�_lambda_5VMR�VMC�7+�VMC�8+s�\_fresh
����R
tacticis_assigned			
VMC�9?+��\�@�R�=_fresh
�����
tacticset_goals	
Fapply_instancetactictry	#Fapply_opt_param�J
�2_main��7when(	)9Fapply_auto_param�J
�L��7�MVMC�:
.��R�E���9�8��7mwhenVMC�;!+��\�=_fresh
����S�E��tacticget_goals	�:��7listmmap'_main	�GVMC�
+��S����;���7�Odecl�����retry_apply_aux_maine�Qcfg����K�L�R�T�S�[�Q�\�����W�has_orelseorelse�Talternativeto_has_orelse�Ttacticalternative�S}focus1�S�g�S}targettgt�Q� �it�Q���S}unifyMFtransparencysemireducible��_x���%}exact�)_x�����S��gs'��	r�S}reorder_goals�R�.}apply_cfgnew_goals�%�������QM�map�R�Q�l_x���w�SM� �g�Q�i	e�Q}whnf�)�P_p�Q_a�Qexprcases_on�P�w�Q�a���}apply_core�.�zlevel�m�z�Ma_1�K�p��i�8�.�z�Ma_1�Ma_2�Q��i�8�z�Ma_1�Ma_2binder_infoa_3�Q��i�z�z�Qa_1�Q�v�z�Ma_1��a_2�Q���z�Ma_1��a_2�Qa_3�Q�� }mk_meta_varMv�Q	b�xhas_varM� }head_betacoe_fn�Qexprhas_coe_to_fun�P
Me�Q
�RecFn�Z�����prodmk�RM���M�Q�8		�z�Ma_1�Q���zmacro_defa_1���v�PInfo�Z5prvretry_apply_aux_main�ZVMR�Z_lambda_1VMR�Z_rec_1VMR�Z_lambda_2VMR�Z_lambda_3VMR�Z_lambda_4VMR�Z_lambda_5VMR�ZVMC��5��\�=_fresh��+�=_fresh��)�Q�=_fresh��%�M�=_fresh����=_fresh�����=_fresh���Qexprapptactichead_beta	�Z	VMC��R5a�\n�Q�=_fresh�����=_fresh������=_fresh����Qexprcases_on
 &,FLtacticapply_core������������tacticmk_meta_var	0?
exprhas_var��	��D	
����VMC��5��R
VMC��5��\�=_fresh��I�S�=_fresh��G�������G	VMC��F5��\�=_fresh��=��=_fresh��<���=_fresh��;�Qtactictarget	@��	9tacticunify	2	tacticexact	+�T	$

�n�S��)
0
7	
>VMC��5��\����������Q��	tacticwhnf	��VMC�Z5���\���[�Q����Ffocus1interaction_monad_orelseprv���Ydecl�Y��Z�PInfo�Y5VMR�YVMC�Y5�Zprvretry_apply����;;retry_applydecl��e�Qcfg������Q�������iM�YM���	�PInfo��EVMR��VMC��E�������Q�Z����decl}apply'e�Qcfgopt_param��Fapply_cfgmk�)�Pj�P�P�P�P����Q������f�S�S��Mr�S�%�M�K
�PInfo��N	VMR��VMC��N	��\�������Q��	�	doc�� `apply'` mimics the behavior of `apply_core`. When
`apply_core` fails, it is retried by providing the term with meta
variables as additional arguments. The meta variables can then
become new goals depending on the `cfg.new_goals` policy.

`apply'` also finds instances and applies opt_params and auto_params.decl}fapply'e�Q����Q�}apply'����P�P�P�P�PInfo��T	VMR��VMC��T	���Q��doc��Same as `apply'` but __all__ arguments that weren't inferred are added to goal list.decl}eapply'��e�Q�������P�P�P�P�PInfo��W	VMR��VMC��W	���Q��doc��Same as `apply'` but only goals that don't depend on other goals are added to goal list.prvrelation_tactic��9��3relation_tacticdecl��md}transparencyop_for�environment��Moption�Mtac_namestring��������������g���Z�!}instantiate_mvarstgt�Q�f���}get_envenv�	r�Qexprget_app_fn�PM_a�optioncases_on�M������}fail���stringhas_to_format�;�stringhas_append�k
Str tactic failed, target is not a relation application with the expected property.val�M���}mk_constr�Q�����������P��P�P�P�P_x�S�w��unitstar�kMexprconst_name�P
�PInfo��[VMR��_lambda_1VMR��VMC���[���\�=_fresh���Q�=_fresh����=_fresh����=_fresh����=_fresh����const_name	�� �_c_1t�_c_2a�_c_3c�	_c_4i�
_c_5l�_c_6e�_c_7d�
_c_8r�_c_9n�_c_10o�_c_11p�_c_12h�_c_13.�y�
	x�
w�
	

s�
g�,�

f�	
	��	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	stringappendstringhas_to_format?fail
Fmk_const	������	����
��	
��	VMC��-[��\�����������	tacticinstantiate_mvars
	'Fget_env	 �get_app_fn_main	��Q	�%doc��`relation_tactic` finds a proof rule for the relation found in the goal and uses `apply'` to make one proof step.decl}reflexivity'md����)���>�`����environmentrefl_for
Strreflexivity�PInfo�=g	VMR�=VMC�=?g	�>�`e�_c_1i�_c_2y�t�v�x�l�f�r���	�	�	�	�	�	�	�	�	�	�	environmentrefl_for��doc�=Similar to `reflexivity` with the difference that `apply'` is used instead of `apply`decl}symmetry'�amd�`���cenvironmentsymm_for
Strsymmetry�PInfo�Ek	VMR�EVMC�E0k	�F�`y�_c_1m�_c_2r�t�e�s���	�	�	�	�	�	�	�	environmentsymm_for��doc�ESimilar to `symmetry` with the difference that `apply'` is used instead of `apply`decl}transitivity'�amd�`���cenvironmenttrans_for
Strtransitivity�PInfo�Mo	VMR�MVMC�MBo	�N�`t�_c_1i�_c_2y�v�s�n�a�r���	�	�	�	�	�	�	�	�	�	�	�	environmenttrans_for��doc�MSimilar to `transitivity` with the difference that `apply'` is used instead of `apply`decl}interactiveapply'qinteractiveparsepexpra�wexprreflect���Xtypestexpr���W����Uconcat_tags� }i_to_expr_for_applyh�Q�����PInfo�V{	VMR�V_lambda_1VMR�VVMC�c{	��\�=_fresh
����tactici_to_expr_for_apply	��VMC�V{	�W��c�ginteractiveconcat_tagsdoc�VSimilarly to `apply`, the `apply'` tactic tries to match the current goal against the conclusion of the type of term.

It differs from `apply` in that it does not unfold definition in order to find out what the assumptions of the provided term is. It is especially useful when defining relations on function spaces (e.g. `≤`) so that rules like transitivity on `le : (α → β) → (α → β) → (α → β)` will be considered to have three parameters and two assumptions (i.e. `f g h : α → β`, `H₀ : f ≤ g`, `H₁ : g ≤ h`) instead of three parameters, two assumptions and then one more parameter (i.e. `f g h : α → β`, `H₀ : f ≤ g`, `H₁ : g ≤ h`, `x : α`). Whereas `apply` would expect the goal `f x ≤ h x`, `apply'` will work with the goal `f ≤ h`.decl�Ufapply'��q�������tacticfapply'�PInfo�k�	VMR�k_lambda_1VMR�kVMC�o�	��\�=_fresh
��8��h	��VMC�k�	�l��o�jdoc�kSimilar to the `apply'` tactic, but does not reorder goals.decl�Ueapply'��q�������tacticeapply'�PInfo�s�	VMR�s_lambda_1VMR�sVMC�w�	��\�=_fresh����h	��VMC�s�	�t��w�jdoc�sSimilar to the `apply'` tactic, but only creates subgoals for non-dependent premises that have not been fixed by type inference or type class resolution.decl�Uapply_with'q�}leanparserpexprstdprecmaxcfg�����|����������� ��Me�Q��M�PInfo�{�	VMR�{_lambda_1VMR�{VMC���	��\�=_fresh������=_fresh������h	��VMC�{�	�����|�����jdoc�{Similar to the `apply'` tactic, but allows the user to provide a `apply_cfg` configuration object.decl�Umapply'��q�������e�Q�������PInfo���	VMR��_lambda_1VMR��VMC���	��\�=_fresh�#���h	��VMC���	������jdoc��Similar to the `apply'` tactic, but uses matching instead of unification.
`mapply' t` is equivalent to `apply_with' t {unify := ff}`decl�Ureflexivity'����tacticreflexivity'�)�PInfo���	VMR��VMC���	�=doc��Similar to `reflexivity` with the difference that `apply'` is used instead of `apply`.decl�Urefl'�����PInfo���	VMR��VMC���	�=doc��Shorter name for the tactic `reflexivity'`.decl�Usymmetry'��v�Xloc�[��interactivelochas_reflect�^location�������cases_on���������try_applyh�Q}symmetry_hyp�)tacticsymmetry'�)��wildcard��K�����apply������nslistreverse��PInfo���	VMR��_lambda_1VMR��VMC��� ���Qtacticsymmetry_hypVMC���	���\���		�E���Xloctry_apply�reverse�E���Xlocapplydoc��`symmetry'` behaves like `symmetry` but also offers the option `symmetry' at h` to apply symmetry to assumption `h`decl�Utransitivity'q�v��w�[��optionhas_reflect�w�|
Quote�woptionalleanparser�~alternative�w�~����������tactictransitivity'�)_a���$�w���������Uskip��w���f�N�L�Q�Q��}target_lhs_rhs_p��_a��prodcases_on�M��������fst�Msnd�����Q�Q������snd_fst�Qsnd_snd�Q����iMt�Q�}i_to_exprexprsubst���	
Quote_x_1_�G_x_2���H
MTyEto_pexpr�Qexprhas_to_pexpr��wpexprhas_to_pexpr�zs�Q�&	�)���PInfo���	VMR��VMC��K�	��\�����M	E	�iskipCtactictarget_lhs_rhs	=	��	6��to_pexpr�����exprsubst���gi_to_expr	'/

��4
;
Bdoc��Similar to `transitivity` with the difference that `apply'` is used instead of `apply`.EndFile